graphql-tools icon indicating copy to clipboard operation
graphql-tools copied to clipboard

printSchemaWithDirectives always prints subscription on schema

Open jdolle opened this issue 9 months ago • 1 comments

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 generate in the terminal.

    Please make sure the GraphQL Tools package versions under package.json matches 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

jdolle avatar Apr 29 '24 23:04 jdolle

After some more testing, I found it was printSchemaWithDirectives that was adding the subscription.

jdolle avatar Apr 30 '24 00:04 jdolle