Skip to content

Commit b9725d7

Browse files
benjieleebyron
authored andcommitted
Add recommendation to preserve order where possible
1 parent ccf23e3 commit b9725d7

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 @@ entry has a unique key, and can be directly referenced by that key.
247247
:: An _ordered map_ is a map which has a defined order. An entry added to an
248248
ordered map, which does not have an entry with that key, is ordered after
249249
existing entries.
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)