We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Progress of the issue based on the Contributor Workflow
Make sure to fork this template and run yarn generate in the terminal. Please make sure the GraphQL Tools package versions under package.json matches yours.
Make sure to fork this template and run yarn generate in the terminal.
yarn generate
Please make sure the GraphQL Tools package versions under package.json matches yours.
package.json
Describe the bug
When I use stitch & delegate, some fields described in selectionSet does not pass to the source schema.
To Reproduce Steps to reproduce the behavior:
https://codesandbox.io/p/devbox/t2xglt
import { buildSchema, graphql } from 'graphql'; import { addResolversToSchema } from '@graphql-tools/schema'; import { stitchSchemas } from '@graphql-tools/stitch'; import { delegateToSchema } from '@graphql-tools/delegate'; const sub_schema = addResolversToSchema({ schema: buildSchema(` type Query { current_user: User } type User { id: ID! name: String! age: Int! } `), resolvers: { Query: { current_user: () => ({ id: '5', name: 'John Doe', age: 10 }), }, }, }); const stitched_schema = stitchSchemas({ subschemas: [ { schema: sub_schema, createProxyingResolver: (options) => { return (_parent, _args, context, info) => { const operationName = info.operation.name ? info.operation.name.value : undefined; return delegateToSchema({ schema: options.subschemaConfig, operation: options.operation, context, info, operationName, }); }; }, }, ], resolvers: { User: { name: { selectionSet: '{ age }', resolve: (parent) => `${parent.name}(${parent.age})`, }, }, }, }); console.log((await graphql({ schema: stitched_schema, source: '{ current_user { name } }' })).data.current_user.name);
Expected behavior
John Doe(10)
John Doe(undefined)
Environment:
Additional context
It works well with @graphql-tools/delegate: 10.0.9
@graphql-tools/delegate: 10.0.9
I think #6134 makes this problem. If I change if (!skipAddingDependencyNodes) to if (true) (ignore changes of the PR), I can get the correct answer.
if (!skipAddingDependencyNodes)
if (true)
If I add an another field instead of overriding existing fields (ie. name -> name_age), it works well.
The text was updated successfully, but these errors were encountered:
Fix ardatan/graphql-tools#6637
c1f969d
09cc419
No branches or pull requests
Issue workflow progress
Progress of the issue based on the
Contributor Workflow
Describe the bug
When I use stitch & delegate, some fields described in selectionSet does not pass to the source schema.
To Reproduce Steps to reproduce the behavior:
https://codesandbox.io/p/devbox/t2xglt
Expected behavior
John Doe(10)
John Doe(undefined)
Environment:
Additional context
It works well with
@graphql-tools/delegate: 10.0.9
I think #6134 makes this problem.
If I change
if (!skipAddingDependencyNodes)
toif (true)
(ignore changes of the PR), I can get the correct answer.If I add an another field instead of overriding existing fields (ie. name -> name_age), it works well.
The text was updated successfully, but these errors were encountered: