|
1 | 1 | ## Unreleased |
2 | 2 |
|
3 | | -### Added |
| 3 | +## 0.3.0 - 2025-08-13 |
4 | 4 |
|
5 | | -- **Composite schemas shortcuts** added. New protobuf options for simplified composite schemas directives: |
6 | | - - `key` option generates `@key` directives on types |
7 | | - - `lookup` option generates `@lookup` directive on RPC methods |
8 | | - - `argument_is` option on RPC methods generates `@is` directive on the input argument - a shortcut for `grafbase.graphql.argument_directives = "@is(field: \"...\")"` |
9 | | - - `join_field` option generates fields with `@require` and `@grpcMethod` directives, with proper type resolution |
| 5 | +### Added |
10 | 6 |
|
11 | | -- **Input argument directives** added. You can now add GraphQL directives to RPC method input argument, that corresponds to the input of the RPC method, using the `argument_directives` option on methods. |
| 7 | +- **Multiple subgraphs support** added. Support for generating multiple GraphQL files based on service annotations: |
| 8 | + - Services can now have a `subgraph_name` option that maps them to different subgraph files |
| 9 | + - When any service has a `subgraph_name`, the tool automatically switches to multi-file mode |
| 10 | + - Generated files are named `<subgraph_name>.graphql` instead of the default `schema.graphql` |
| 11 | + - Each subgraph file only includes the services and types relevant to that specific subgraph |
| 12 | + - Multiple services can map to the same subgraph |
| 13 | + - Services without `subgraph_name` in multi-file mode are ignored without warning |
12 | 14 |
|
13 | 15 | - **Proto3 optional field support** added. The generator now properly handles proto3 optional fields: |
14 | 16 | - Non-optional scalar and enum fields in proto3 are rendered as non-nullable (`Type!`) in GraphQL output types |
|
17 | 19 | - Input types remain nullable for all fields |
18 | 20 | - The generator now declares support for `FEATURE_PROTO3_OPTIONAL` to work with proto3 files containing optional fields |
19 | 21 |
|
20 | | -- **Composite schema entity references with @derive** added. You can now create federation-style entity references using the `derive_field` option on messages: |
| 22 | +- **Composite schemas shortcuts** added. New protobuf options for simplified composite schemas directives: |
| 23 | + - `grafbase.graphql.key` option generates `@key` directives on types |
| 24 | + - `grafbase.graphql.lookup` option generates `@lookup` directive on RPC methods |
| 25 | + - `grafbase.graphql.argument_is` option on RPC methods generates `@is` directive on the input argument - a shortcut for `grafbase.graphql.argument_directives = "@is(field: \"...\")"` |
| 26 | + - `grafbase.graphql.join_field` option generates fields with `@require` and `@grpcMethod` directives, with proper type resolution |
| 27 | + |
| 28 | +- **Input argument directives** added. You can now add GraphQL directives to RPC method input argument, that corresponds to the input of the RPC method, using the `grafbase.graphql.argument_directives` option on methods. |
| 29 | + |
| 30 | +- **Composite schema entity references with @derive** added. You can now create federation-style entity references using the `grafbase.graphql.derive_field` option on messages: |
21 | 31 | - Use `option (grafbase.graphql.derive_field) = {entity: "User", is: "{ id: user_id }"};` on fields |
22 | 32 | - Automatically generates reference fields with `@derive` and `@is` directives |
23 | 33 | - Creates stub entity types with `@key` directives if the type is not already defined |
24 | 34 | - Supports custom relation field names with the `name` parameter |
25 | 35 | - The `@is` directive uses the value from the `is` parameter directly |
26 | 36 | - Enables cross-subgraph entity references in federated schemas |
27 | 37 |
|
28 | | -- **Input argument directives support** added. You can now add GraphQL directives to RPC method input arguments using the `argument_directives` option: |
| 38 | +- **Input argument directives support** added. You can now add GraphQL directives to RPC method input arguments using the `grafbase.graphql.argument_directives` option: |
29 | 39 | - Use `option (grafbase.graphql.argument_directives) = "@constraint(minLength: 1)";` in method options |
30 | 40 | - Supports multiple directives in a single string, separated by spaces |
31 | 41 | - Works with both Query and Mutation fields |
32 | 42 | - Can be combined with existing method directives |
33 | 43 |
|
34 | | -- **Multiple subgraphs support** added. Support for generating multiple GraphQL files based on service annotations: |
35 | | - |
36 | | - - Services can now have a `subgraph_name` option that maps them to different subgraph files |
37 | | - - When any service has a `subgraph_name`, the tool automatically switches to multi-file mode |
38 | | - - Generated files are named `<subgraph_name>.graphql` instead of the default `schema.graphql` |
39 | | - - Each subgraph file only includes the services and types relevant to that specific subgraph |
40 | | - - Multiple services can map to the same subgraph |
41 | | - - Subgraph names must match the pattern `[a-zA-Z][a-zA-Z0-9-]*` |
42 | | - - Services without `subgraph_name` in multi-file mode are ignored without warning |
43 | | - |
44 | 44 | ### Fixed |
45 | 45 |
|
46 | 46 | - In some scenarios, the plugin would panic because packages were not provided in alphabetical order. This is fixed. (https://github.com/grafbase/extensions/pull/144) |
|
0 commit comments