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

globalGqlIdentifierName is inconsistently forced lowercase so doesn't work with mixed case identifiers

Open fantastiskm opened this issue 1 year 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.

  • [x] 2. A failing test has been provided
  • [x] 3. A local solution has been provided
  • [x] 4. A pull request is pending review

Describe the bug

globalGqlIdentifierName are set to be lower case in tag-pluck but when the visitor uses them it does a case sensitive compare

To Reproduce Steps to reproduce the behavior:

pluckConfig: {
globalGqlIdentifierName: ['helloGql']
}
const query = helloGql(`
[snip]
`);

Expected behavior

Case sensitive identifiers can match. Either globalGqlIdentifierName shouldn't be converted to lower case or identifiers in the code should be. Changing the comparison to be case insensitive should not break backward compatibility whereas changing it to be case sensitive may.

Environment:

  • OS: MacOs
  • @graphql-tools/...: 8.3
  • NodeJS: 18

Additional context

fantastiskm avatar Feb 29 '24 09:02 fantastiskm

https://github.com/ardatan/graphql-tools/pull/5945

fantastiskm avatar Mar 08 '24 12:03 fantastiskm