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

fix(hasura-allow-list): nested fragment definitions order in document order #822

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

voldern
Copy link

@voldern voldern commented Aug 15, 2024

Description

Fixes issue when using hasura-allow-list with fragmentsOrder set to 'document' and the fragments are spread across different files. The order of the fragments end up in reverse order. Sort by the key in the FragmentSpread visitor to get the same order of fragments in the query allow list as generated by other plugins when fragmentsOrder is set to document.

Related #821

Type of change

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

How Has This Been Tested?

I tested the change using the reproduction example in the following repo: https://github.com/voldern/hasura-allowlist-reproduction. In addition to that I've tested it and used it in our own repository for a week now without issues.

See issue for steps to reproduce issue.

Checklist:

  • I have followed the
    CONTRIBUTING doc and the
    style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link

changeset-bot bot commented Aug 15, 2024

🦋 Changeset detected

Latest commit: 0d1e2ed

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@graphql-codegen/hasura-allow-list Patch

Not sure what this means? Click here to learn what changesets are.

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

Fixes issue when using hasura-allow-list with fragmentsOrder set to 'document' and
the fragments are spread across different files. The order of the
fragments end up in reverse order.
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

Successfully merging this pull request may close these issues.

1 participant