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

feat(federation): Deterministically sort composed schema #824

Merged
merged 4 commits into from
Jun 22, 2021

Conversation

trevor-scheer
Copy link
Member

This adds a final transform to the composed schema which sorts types, fields, and anything else which can be sorted lexicographically. This guarantees a deterministic output in the case of the composition algorithm changing and provides readers of the schema with a more consistent way to find what they're looking for.

Copy link
Contributor

@martijnwalraven martijnwalraven left a comment

Choose a reason for hiding this comment

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

I haven't reviewed the changes in tests, but the actual invocation of lexicographicSortSchema seems pretty straightforward :)

@trevor-scheer trevor-scheer force-pushed the trevor/sort-supergraphsdl branch from 581fa76 to d7ceb67 Compare June 22, 2021 13:56
@trevor-scheer trevor-scheer merged commit 4a4a099 into main Jun 22, 2021
@trevor-scheer trevor-scheer deleted the trevor/sort-supergraphsdl branch June 22, 2021 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants