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

make globalGqlIdentifierName case sensitive

Open fantastiskm opened this issue 1 year ago • 3 comments
trafficstars

Description

Currently globalGqlIdentifierNames are converted to lower case before being used for matching. This patch removes this conversion so they match in the file if the identifier in the code source is not all lower case. Previously if you had a mixed case globalGqlIdentifierName in the source code it would not match.

Eg: const x = testGql( could not be plucked using globalGqlIdentifierName as it is mixed case.

It also re-enables tests

Related # 5944

Type of change

Please delete options that are not relevant.

  • [x] Bug fix (non-breaking change which fixes an issue)

Screenshots/Sandbox (if appropriate/relevant):

Adding links to sandbox or providing screenshots can help us understand more about this PR and take action on it as appropriate

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [x] unit test
  • [x] used in own project

Test Environment:

  • OS: MacOS
  • @graphql-tools/...: master
  • NodeJS: 18

Checklist:

  • [ ] I have followed the CONTRIBUTING doc and the style guidelines of this project
  • [x] I have performed a self-review of my own code
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [x] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [x] New and existing unit tests and linter rules pass locally with my changes
  • [ ] Any dependent changes have been merged and published in downstream modules

Further comments

fantastiskm avatar Feb 29 '24 09:02 fantastiskm

⚠️ No Changeset found

Latest commit: 54026040bfb001d137a716403dbf8a76d2430408

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Feb 29 '24 09:02 changeset-bot[bot]

Why would we make it case insensitive? Why don't we solve the issue directly? If identifier name is lowercased in somewhere, let's remove that instead.

ardatan avatar Feb 29 '24 10:02 ardatan

Totally works for me especially as identifiers are normally case sensitive. I just didn't want to break existing code ;) I've updated the branch

fantastiskm avatar Feb 29 '24 13:02 fantastiskm