Skip to content

Commit 6395f28

Browse files
authored
Merge pull request #164 from grafbase/tomhoule-okmzoqtuwrsz
protoc-gen-grafbase-subgraph: release 0.3.0
2 parents 810cb24 + 037de4f commit 6395f28

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/protoc-gen-grafbase-subgraph/CHANGELOG.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
## Unreleased
22

3-
### Added
3+
## 0.3.0 - 2025-08-13
44

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
106

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
1214

1315
- **Proto3 optional field support** added. The generator now properly handles proto3 optional fields:
1416
- Non-optional scalar and enum fields in proto3 are rendered as non-nullable (`Type!`) in GraphQL output types
@@ -17,30 +19,28 @@
1719
- Input types remain nullable for all fields
1820
- The generator now declares support for `FEATURE_PROTO3_OPTIONAL` to work with proto3 files containing optional fields
1921

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:
2131
- Use `option (grafbase.graphql.derive_field) = {entity: "User", is: "{ id: user_id }"};` on fields
2232
- Automatically generates reference fields with `@derive` and `@is` directives
2333
- Creates stub entity types with `@key` directives if the type is not already defined
2434
- Supports custom relation field names with the `name` parameter
2535
- The `@is` directive uses the value from the `is` parameter directly
2636
- Enables cross-subgraph entity references in federated schemas
2737

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:
2939
- Use `option (grafbase.graphql.argument_directives) = "@constraint(minLength: 1)";` in method options
3040
- Supports multiple directives in a single string, separated by spaces
3141
- Works with both Query and Mutation fields
3242
- Can be combined with existing method directives
3343

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-
4444
### Fixed
4545

4646
- 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)

cli/protoc-gen-grafbase-subgraph/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "protoc-gen-grafbase-subgraph"
3-
version = "0.2.0"
3+
version = "0.3.0"
44
edition.workspace = true
55
license.workspace = true
66
homepage.workspace = true

0 commit comments

Comments
 (0)