Showcase Auto Global Object Identification #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using prereleased packages from graphql-hive/gateway#1232
Gotchas
Why extra
schema.graphql
?Because Hive Gateway adds the GOT1 automatically during runtime, i.e. Node interfaces don't exist during composition and hence are not in the supergraph.
But Relay needs the actual schema it's dealing with, so we generate an additional
schema.graphql
with the Node intereface, besides thesupergraph.graphql
consumed by Hive Gateway, that contains everything for Relay.Why are subraphs not encoding the ID to global IDs?
Because they don't need to. The automatic GOT1 feature handles all that, the subgraphs can continue using their local ID.
Why use
nodeId
as interface ID field in Relay?Read Why
nodeId
? in the PR.Why
PosterBylineFragment
is spreading Actor implementations?To access the
nodeId
. At the moment, the automatic GOT1 does not support interfaces (interface Actor implements Node). But not to worry, it will support it before merging the PR and releasing stable!Footnotes
Global Object Identification ↩ ↩2 ↩3