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

graphql-tag-pluck can't be configured to ignore gql`...`

Open Wojonatior opened this issue 2 years 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

I have tried a number of configurations, but I have not been able to get graphql-tag-pluck to ignore the default gql tag. I have further noticed that even custom tags that include gql are still picked up when the globalGqlIdentifierName property is configured. For example I had a custom tag gql_ecommerce and that tag was still picked up.

To Reproduce Steps to reproduce the behavior:

Configure globalGqlIdentifierName to an empty list of tags. Run the graphql-code-generator. gql tags are still picked up and processed by the codegen.

Expected behavior

Tags that are not listed in the globalGqlIdentifierName to not be picked up by graphql-tag-pluck

Environment:

  • OS: MacOS 12.3
  • "@graphql-tools/graphql-tag-pluck": "7.5.0",
  • NodeJS: 19.7.0

Additional context I understand the use case I have may be strange, I can elaborate on why it's needed if desired, but the inability to unset tags has been a point of frustration with using the codegen.

Wojonatior avatar Apr 14 '23 13:04 Wojonatior

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

ardatan avatar Apr 14 '23 14:04 ardatan