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 introspection output #1239

Merged
merged 4 commits into from
Jan 17, 2024

Conversation

audunhalland
Copy link
Contributor

@audunhalland audunhalland commented Jan 17, 2024

Follows #1237
Related to #1134

The type list sent from juniper through introspection to GraphiQL has random (but deterministic) order currently (based on FNV string hash of the type name).

Inspired by #1237, I was interested in improving this.

This PR applies a sort order quite similar to the SDL sorter. The introspection data has a slightly different layout, but comparable.

To verify that the order is nice, stable and deterministic I removed the test sorter from the schema_introspection test.

@tyranron tyranron added enhancement Improvement of existing features or bugfix k::api Related to API (application interface) labels Jan 17, 2024
@tyranron tyranron added this to the 0.16.0 milestone Jan 17, 2024
@tyranron tyranron added the area::introspection Related to GraphQL introspection label Jan 17, 2024
Copy link
Member

@tyranron tyranron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@audunhalland thanks!

@tyranron tyranron linked an issue Jan 17, 2024 that may be closed by this pull request
@tyranron tyranron enabled auto-merge (squash) January 17, 2024 13:38
@tyranron tyranron merged commit a1bc775 into graphql-rust:master Jan 17, 2024
173 checks passed
@audunhalland audunhalland deleted the sorted-introspection branch February 3, 2024 02:40
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consistent order of definitions in Schema::as_schema_language output
2 participants