graphql-rust / juniper

GraphQL server library for Rust
Other
5.72k stars 425 forks source link

Stable order in introspection output #1239

Closed audunhalland closed 10 months ago

audunhalland commented 10 months ago

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 https://github.com/graphql-rust/juniper/pull/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.