Skip to content

Sort fields before printing to get a more stable diff#889

Merged
wincent merged 3 commits intographql:masterfrom
tberman:master
May 30, 2017
Merged

Sort fields before printing to get a more stable diff#889
wincent merged 3 commits intographql:masterfrom
tberman:master

Conversation

@tberman
Copy link
Copy Markdown
Contributor

@tberman tberman commented May 27, 2017

Sort the fields of an object similar to how types are being sorted.

ast
);
}).to.throw('Subscription must return AsyncIterable. Received: test');
}).to.throw('Subscription must return Async Iterable. Received: test');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for fixing.

@wincent
Copy link
Copy Markdown
Contributor

wincent commented May 30, 2017

Thnaks @tberman.

@wincent wincent merged commit f5dd099 into graphql:master May 30, 2017
@leebyron
Copy link
Copy Markdown
Contributor

leebyron commented Jun 20, 2017

Unfortunately this PR broke how this utility is used for printing schema in tests and tools - the sorted behavior changed which fields appear first which some tools rely on.

I'm reverting this change, I suggest if stable diffs are required via field sorting, that fields are sorted while still in the schema rather than during printing of the schema. Otherwise the defined order of fields is stable and should be kept stable by this function as well.

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.

4 participants