Can type merging and gateway schema extension coexists? #6029
Unanswered
MirkoGibin
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone.
If I try to add a resolver to the stitching configuration, type merging does not work for the result of the resolver.
I have a book schema and a library schema. Stitching among them works fine: if I call
allLibraries
orallBooks
queries I can easily navigate through the graph.Lets say I want to hide to client all subschemas queries and expose only the query
exposedQuery
defined here in the stitching configuration (maybe a dumb example, but it was the simplest one I could think of). TheexposedQuery
resolver then usesdelegateToSchema
to "redirect" the query to the right subschema.I can compose a valid query with
exposedQuery
that let me navigate through the graph but, when I execute it, it fails withCannot return null for non-nullable field Library.books
.Since the query is valid against the schema I was expecting I could be able to resolve all fields using the type merging configurations.
Why stitching is not working with the
exposedQuery
resolver? Am I misusing something?CodeSanbox Example
To Reproduce
Gateway implementation
Dependencies
Beta Was this translation helpful? Give feedback.
All reactions