You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem likely caused by operation: "query" being hardcoded into default createMergedTypeResolver, actually changing to operation: info.operation.operation on both occurrence will fix it.
Still I do not understand the origin that, no error is thrown for the example of v1 even it is a validation error at stitched schema (Attempt to run Query.fieldName while only Mutation.fieldName exists).
For v1, In the case of using a remote executor at step 4, no query is received on the remote server.
Issue workflow progress
Progress of the issue based on the Contributor Workflow
Describe the bug
If a graphql query is
mutation
, at step 4 onward,query
is being executed instead ofmutation
https://www.graphql-tools.com/docs/schema-stitching/stitch-type-merging#merging-flow
If such field name is not defined in Query of stitched schema, the merged resolver fails silently returning null result.
To Reproduce
Example 1: Has
Mutation.*User
, notQuery.*User
https://github.com/flyingmilktea/graphql-bug-reproduce/tree/mutation-fwd-query-v1
Result:
Example 2: Added
Query.*User
to both serverhttps://github.com/flyingmilktea/graphql-bug-reproduce/tree/mutation-fwd-query-v2
Expected behavior
Environment:
Additional context
graphql-tools/packages/stitch/src/createMergedTypeResolver.ts
Lines 5 to 61 in bccf659
The problem likely caused by
operation: "query"
being hardcoded into defaultcreateMergedTypeResolver
, actually changing tooperation: info.operation.operation
on both occurrence will fix it.Still I do not understand the origin that, no error is thrown for the example of
v1
even it is a validation error at stitched schema (Attempt to run Query.fieldName while only Mutation.fieldName exists).Thanks @Abbywpy for help on testing the problem
The text was updated successfully, but these errors were encountered: