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

Directive definition is changed from pruning. #4998

Open
4 tasks
Samjin opened this issue Jan 27, 2023 · 3 comments
Open
4 tasks

Directive definition is changed from pruning. #4998

Samjin opened this issue Jan 27, 2023 · 3 comments

Comments

@Samjin
Copy link

Samjin commented Jan 27, 2023

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

The scalar _FieldSet is removed from directive definition.
image
It's not breaking client because the graphql tool selectively prune unused types from a schema, but it removes parameter from directive definition. In this case, when the schema didn't use a directive, it will remove scalar _FieldSet from directive.
Removing directive's parameter alters its definition, and these fields: _FieldSet! is required for the directive. I think we should either keep the fields: _FieldSet! or remove directive completely so the definition remains correct in schema.

To Reproduce
Codesandbox link

Expected behavior
Do not remove types used in directive definition

Environment:

  • OS: MacOS
  • @graphql-tools/utils: 9.1.4
  • NodeJS: 14

Additional context

@ardatan
Copy link
Owner

ardatan commented Feb 2, 2023

Could you create a PR with a failing test? Thanks!

@Samjin
Copy link
Author

Samjin commented Mar 9, 2023

hi @ardatan here it is CodeSandbox link

@ardatan
Copy link
Owner

ardatan commented Mar 9, 2023

PRs are welcome as I already said in my previous PR :) to fix it or at least with a failing test if anyone is interested in.

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

2 participants