Skip to content

Reordered properties in JSON response according to recommendation in GraphQL spec #158

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

Merged
merged 1 commit into from
Mar 23, 2019

Conversation

bsara
Copy link
Contributor

@bsara bsara commented Mar 8, 2019

In the official GraphQL spec, it says the following:

When errors is present in the response, it may be helpful for it to appear first when serialized to make it more clear when errors are present in a response during debugging.

In my own personal debugging, I've found that my teammates and I often overlook errors because the property is located after data. The same goes for extensions. This pull request changes the response message property order to the following:

  • errors
  • extensions
  • data

… the following order: errors, extensions, data (this is as recommended by the GraphQL spec)
@oliemansm oliemansm merged commit 40ea03c into graphql-java-kickstart:master Mar 23, 2019
@oliemansm
Copy link
Member

@bsara Thanks for the contribution!

@bsara
Copy link
Contributor Author

bsara commented Mar 25, 2019

@oliemansm thanks!

@bsara bsara deleted the json-property-order branch March 25, 2019 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants