-
Notifications
You must be signed in to change notification settings - Fork 23
Automatic Global Object Identification #1232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🚀 Snapshot Release (
|
Package | Version | Info |
---|---|---|
@graphql-tools/federation |
3.3.0-alpha-528b9ad3ecc81ee9fc6444ab0046799f44e1cd10 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/fusion-runtime |
0.12.0-alpha-528b9ad3ecc81ee9fc6444ab0046799f44e1cd10 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/gateway |
1.15.3-alpha-528b9ad3ecc81ee9fc6444ab0046799f44e1cd10 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/nestjs |
1.0.17-alpha-528b9ad3ecc81ee9fc6444ab0046799f44e1cd10 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/plugin-aws-sigv4 |
1.0.14-alpha-528b9ad3ecc81ee9fc6444ab0046799f44e1cd10 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-opentelemetry |
1.3.61-alpha-528b9ad3ecc81ee9fc6444ab0046799f44e1cd10 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-prometheus |
1.3.49-alpha-528b9ad3ecc81ee9fc6444ab0046799f44e1cd10 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/gateway-runtime |
1.10.0-alpha-528b9ad3ecc81ee9fc6444ab0046799f44e1cd10 |
npm ↗︎ unpkg ↗︎ |
🚀 Snapshot Release (Bun Docker Image)The latest changes of this PR are available as image on GitHub Container Registry (based on the declared
|
🚀 Snapshot Release (Node Docker Image)The latest changes of this PR are available as image on GitHub Container Registry (based on the declared
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR automatically implements the GraphQL Global Object Identification Specification by introducing a Node interface and related Query fields to support global object identification. Key changes include updating configuration types, propagating the globalObjectIdentification flag through gateway, fusion and federation runtime, and adding a new module for creating global ID definitions and resolvers.
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
packages/runtime/src/types.ts | Added boolean flag and accompanying documentation for global object identification. |
packages/runtime/src/createGatewayRuntime.ts | Propagated the new flag to the gateway runtime configuration. |
packages/fusion-runtime/src/unifiedGraphManager.ts | Passed and stored globalObjectIdentification in the manager. |
packages/federation/src/supergraph.ts | Integrated globalObjectIdentification into stitching options and resolver merging. |
packages/federation/tests/getStitchedSchemaFromLocalSchemas.ts | Updated function signature with the new flag and adjusted error handling. |
packages/federation/src/globalObjectIdentification.ts | New module for creating Node definitions and resolvers for global IDs. |
packages/federation/src/managed-federation.ts | Passed globalObjectIdentification into managed federation functions. |
packages/batch-delegate/src/getLoader.ts | Updated usage of returnType while preserving backwards compatibility. |
e2e/global-object-identification/* | Added end-to-end tests and configuration showcasing the new feature. |
.changeset/* | Updated changeset with release notes and dependency updates. |
df37143
to
1399055
Compare
1399055
to
96e0a18
Compare
Automatic implementation of the GraphQL Global Object Identification Specification by adding a
Node
interface andnode(id: ID!): Node
field to theQuery
type.The
Node
interface will have anodeId
(notid
!) field used as the global identifier. It is intentionally notid
to avoid collisions with existingid
fields in subgraphs.Features
See global-object-identification E2E tests which adds Global Object Identification to the the usual Apollo Federation inventory+products+users+reviews example.
Why
nodeId
?We use the
nodeId
as the Global Object Identifier avoid possible collisions withid
fields that are common to exist in subgraphs.Hive Gateway
CLI
Programmatic Usage
Configuring
Instead of passing
true
to theglobalObjectIdentification
option that enables and sets the defaults, you can instead pass a configuration object and adjust the behaviour.TODOs
nodes(ids: [ID!]!)
for batchingnodeId
field name in Node interfaceNode
interfacesWhat to do? Remove from subgraphs? Merge?Error? ✅interface Actor implements Node { ... }
)Ref GW-268