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

Stable order in generated schema's SDL (#1134) #1237

Merged
merged 4 commits into from
Jan 15, 2024

Conversation

tyranron
Copy link
Member

@tyranron tyranron commented Jan 12, 2024

Resolves #1134, #865

Synopsis

See #1134 for details:

Currently, the order persists between compilations as long as there are no changes to schema, but a change to one item commonly results in multiple unrelated items changing their position.

Solution

The solution is based on the #1134 (comment) approach, proposed and implemented by @michael-groble for the graphql-parser directly.

We ship it without waiting for a graphql-parser, and later can switch to the solution provided by the graphql-parser out-of-the-box.

Additionally

This PR removes the graphql-parser Cargo feature of juniper, because it effectively exposed the RootNode::as_parser_document() method only, hardly overlapping with the schema-language Cargo feature exposing RootNode::as_schema_language() method only.

Since they're very similar, now it's only the schema-language Cargo feature is left, exposing both RootNode::as_sdl() and RootNode::as_document() methods.

Checklist

  • Documentation is updated.
  • Tests are updated.
  • Changelog entry is added.

@tyranron tyranron added enhancement Improvement of existing features or bugfix semver::breaking Breaking change in terms of SemVer k::api Related to API (application interface) labels Jan 12, 2024
@tyranron tyranron added this to the 0.16.0 milestone Jan 12, 2024
@tyranron tyranron self-assigned this Jan 12, 2024
@tyranron tyranron marked this pull request as ready for review January 12, 2024 18:10
@tyranron tyranron requested a review from LegNeato January 12, 2024 18:10
@tyranron
Copy link
Member Author

@LegNeato please look whether you have any comments on this.

@tyranron tyranron removed the request for review from LegNeato January 15, 2024 16:21
@tyranron tyranron merged commit e64287c into master Jan 15, 2024
173 checks passed
@tyranron tyranron deleted the 1134-stable-schema-order branch January 15, 2024 16:26
@tyranron tyranron added the area::introspection Related to GraphQL introspection label Jan 17, 2024
@tyranron tyranron linked an issue Mar 12, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area::introspection Related to GraphQL introspection enhancement Improvement of existing features or bugfix k::api Related to API (application interface) semver::breaking Breaking change in terms of SemVer
Projects
None yet
1 participant