graphql-tools
graphql-tools copied to clipboard
printSchemaWithDirectives always prints subscription on schema
trafficstars
Issue workflow progress
Progress of the issue based on the Contributor Workflow
- [ ] 1. The issue provides a reproduction available on Github, Stackblitz or CodeSandbox
Make sure to fork this template and run
yarn generatein the terminal.Please make sure the GraphQL Tools package versions under
package.jsonmatches yours. - [ ] 2. A failing test has been provided
- [ ] 3. A local solution has been provided
- [ ] 4. A pull request is pending review
Describe the bug
Given the following schema:
schema {
query: Query
mutation: Mutation
subscription: Subscription
}
type Query {
foo: Boolean
}
pruneSchema should remove the mutation and subscription from the root schema object:
schema {
query: Query
}
type Query {
foo: Boolean
}
To Reproduce Steps to reproduce the behavior:
Expected behavior
Environment:
- OS:
@graphql-tools/...:- NodeJS:
Additional context
After some more testing, I found it was printSchemaWithDirectives that was adding the subscription.