Issue workflow progress
Progress of the issue based on the
Contributor Workflow
Describe the bug
Using stitchSchemas({ mergeDirectives: true }) results in directives on queries to be omitted from the operation definition. Directives from other places (e.g. fields in the query) are preserved.
Schema:
directive @test on QUERY | FIELD
type Query {
hello: String
}
Request:
query Hello @test { # this is lost
hello @test # this is preserved
}
Parsed query:
query Hello {
__typename
hello @test
}
To Reproduce Steps to reproduce the behavior:
https://codesandbox.io/p/devbox/graphql-schema-stitching-kx4lvh
Expected behavior
All directives are present in OperationDefinitionNode in resolvers.
Environment:
- OS: OSX
@graphql-tools/stitch: 10.1.1
- NodeJS: 22
Issue workflow progress
Progress of the issue based on the
Contributor Workflow
Describe the bug
Using
stitchSchemas({ mergeDirectives: true })results in directives on queries to be omitted from the operation definition. Directives from other places (e.g. fields in the query) are preserved.Schema:
Request:
Parsed query:
To Reproduce Steps to reproduce the behavior:
https://codesandbox.io/p/devbox/graphql-schema-stitching-kx4lvh
Expected behavior
All directives are present in
OperationDefinitionNodein resolvers.Environment:
@graphql-tools/stitch:10.1.1