dimaMachina / graphql-eslint

ESLint parser, plugin and set rules for GraphQL (for schema and operations). Easily customizable with custom rules. Integrates with IDEs and modern GraphQL tools.
https://the-guild.dev/graphql/eslint
MIT License
795 stars 103 forks source link

[#2291] Support the '...' group for alphabetizing fragment spreads #2293

Open yoavsion opened 4 months ago

yoavsion commented 4 months ago

Description

Adds a group type to the groups property of the alphabetize rule indicating where fragment spreads should be in a selection set.

Similarly to the '*' group, which stands for "everything else," the '...' stands for "all fragment spreads."

Fixes #2291

Type of change

How Has This Been Tested?

Added the following unit tests, ran yarn test and verified that the error messages match the expected ones:

Checklist:

Further comments

When working on this change, the display name for a fragment spread was showing undefined <fragment name>, which was because there was no name mapping for that Kind — so I went ahead and added display names for all Kind values, and sorted the map.

changeset-bot[bot] commented 4 months ago

🦋 Changeset detected

Latest commit: b3d0b6f988766c227a522a0102d660d6e20a7c4f

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

This PR includes changesets to release 1 package | Name | Type | | ----------------------------- | ----- | | @graphql-eslint/eslint-plugin | Minor |

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