prisma-labs / get-graphql-schema

Fetch and print the GraphQL schema from a GraphQL HTTP endpoint. (Can be used for Relay Modern.)
665 stars 63 forks source link

feat: Add option to sort schema using lexicographicSortSchema #41

Open clord opened 4 years ago

clord commented 4 years ago

This can be helpful for avoiding merge issues, for example.

clord commented 4 years ago

@maticzav not sure who to ping. I'm using get-graphql-schema for a project but the schema is always changing order on the backend, causing merge conflicts. we need to commit since there is no single source of truth for schema, it depends on which feature is being worked on. this new option would sort using built-in lexicographic schema sorting.

beaugunderson commented 3 years ago

Also interested in this, I tried jq --sort-keys and json-sort-cli and neither provided a stable ordering.

I'll note that even the non-JSON output changes order sometimes.