Skip to content

Commit 92b41db

Browse files
IvanGoncharovleebyron
authored andcommitted
Change order of fields inside Response (#384)
* Change order of fields inside Response To reflect change from graphql/graphql-js#838 * Update Section 7 -- Response.md Remove "first" and "next" and include an explicit note about errors appearing first when serialized as a convenience.
1 parent 9bb65f1 commit 92b41db

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

spec/Section 7 -- Response.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,16 @@ objects in the response as unordered Maps and arrive at a valid value.
8585

8686
A response to a GraphQL operation must be a map.
8787

88-
If the operation included execution, the response map must contain a first entry
89-
with key `data`. The value of this entry is described in the "Data" section. If
90-
the operation failed before execution, due to a syntax error, missing
91-
information, or validation error, this entry must not be present.
92-
93-
If the operation encountered any errors, the response map must contain a next
88+
If the operation encountered any errors, the response map must contain an
9489
entry with key `errors`. The value of this entry is described in the "Errors"
9590
section. If the operation completed without encountering any errors, this entry
9691
must not be present.
9792

93+
If the operation included execution, the response map must contain an entry
94+
with key `data`. The value of this entry is described in the "Data" section. If
95+
the operation failed before execution, due to a syntax error, missing
96+
information, or validation error, this entry must not be present.
97+
9898
The response map may also contain an entry with key `extensions`. This entry,
9999
if set, must have a map as its value. This entry is reserved for implementors
100100
to extend the protocol however they see fit, and hence there are no additional
@@ -104,6 +104,9 @@ To ensure future changes to the protocol do not break existing servers and
104104
clients, the top level response map must not contain any entries other than the
105105
three described above.
106106

107+
Note: When `errors` is present in the response, it may be helpful for it to
108+
appear first when serialized to make it more clear when errors are present
109+
in a response during debugging.
107110

108111
### Data
109112

0 commit comments

Comments
 (0)