Skip to content
New issue

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

printSchemaWithDirectives always prints subscription on schema #6115

Open
4 tasks
jdolle opened this issue Apr 29, 2024 · 1 comment
Open
4 tasks

printSchemaWithDirectives always prints subscription on schema #6115

jdolle opened this issue Apr 29, 2024 · 1 comment

Comments

@jdolle
Copy link

jdolle commented Apr 29, 2024

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
Copy link
Author

jdolle commented Apr 30, 2024

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

@jdolle jdolle changed the title PruneSchema does not remove unused root types printSchemaWithDirectives always prints subscription on schema Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant