Skip to content

Commit 368a48b

Browse files
committed
Add recommendation to preserve order where possible
1 parent df0d201 commit 368a48b

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

spec/Appendix A -- Notation Conventions.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,3 +247,11 @@ the set of keys across all entries is unique but the values across all entries
247247
may repeat. A map is unordered unless explicitly stated otherwise (as an
248248
"ordered map"). For clarity the term "unordered map" may be used when the lack
249249
of an order is semantically important.
250+
251+
**Preserving order**
252+
253+
To improve legibility, when possible implementations should preserve observable
254+
order for unordered data collections. For example, if applying a grammar to an
255+
input string produces an unordered set, serializing that set (to a string or
256+
other observable output) should produce the same order found in the original
257+
input string.

spec/Section 4 -- Introspection.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,17 @@ Tools built using GraphQL introspection should respect deprecation by
117117
discouraging deprecated use through information hiding or developer-facing
118118
warnings.
119119

120+
**Ordering**
121+
122+
When possible, implementations should preserve observable order for unordered
123+
data collections. For example, if a schema was produced from a source
124+
{TypeSystemDocument} then introspection of fields, input fields, arguments, enum
125+
values, directives, union members, implemented interfaces and so on should
126+
produce the same order as found in the source.
127+
128+
Note: This recommendation is to improve legibility and stability of schema
129+
representations.
130+
120131
**Schema Introspection Schema**
121132

122133
The schema introspection system is itself represented as a GraphQL schema. Below

0 commit comments

Comments
 (0)