Loosen must to should for serialization supporting ordered maps.#191
Merged
Loosen must to should for serialization supporting ordered maps.#191
Conversation
5eaa640 to
db8e442
Compare
|
I added some commit comments to 5eaa640 with some suggestions. |
db8e442 to
733f8b5
Compare
Collaborator
Author
|
Updated with your feedback |
f7d3141 to
949aea3
Compare
spec/Section 7 -- Response.md
Outdated
| the pairs are represented in an ordered manner. In other words, while the JSON | ||
| strings `{ "name": "Mark", "age": 30 }` and `{ "age": 30, "name": "Mark" }` | ||
| encode the same value, they also have observably different property orderings. | ||
| While not every JSON generator allows for control over the order in which |
Contributor
There was a problem hiding this comment.
I might remove this bit, and do something like:
From the above, the spec notes that "Serialization formats which can represent an ordered map should preserve the order of requested fields as defined by query execution." Hence, if the query was { name, age }, a GraphQL server vending JSON should respond with { "name": "Mark", "age": 30 }, preserving the order of the requested fields in the JSON serialization.
949aea3 to
ef55027
Compare
Collaborator
Author
|
Simplified a bit, including @dschafer's feedback |
f7917cd to
3da4a90
Compare
GraphQL should work correctly with many serialization techniques, not just JSON. Even within JSON, the GraphQL spec mentions ordered maps while the JSON spec describes unordered maps. This changes the language in the GraphQL spec to: * Use should instead of must where ordered map support might not be possible, thus supporting more environments. * Add clarifying language to JSON encoding section describing expectations for ordering. Fixes #168
3da4a90 to
b22c73c
Compare
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GraphQL should work correctly with many serialization techniques, not just JSON. Even within JSON, the GraphQL spec mentions ordered maps while the JSON spec describes unordered maps. This changes the language in the GraphQL spec to:
Fixes #168