Skip to content

Commit

Permalink
Add recommendation to preserve order where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Apr 5, 2024
1 parent df0d201 commit 368a48b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/Appendix A -- Notation Conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,11 @@ the set of keys across all entries is unique but the values across all entries
may repeat. A map is unordered unless explicitly stated otherwise (as an
"ordered map"). For clarity the term "unordered map" may be used when the lack
of an order is semantically important.

**Preserving order**

To improve legibility, when possible implementations should preserve observable
order for unordered data collections. For example, if applying a grammar to an
input string produces an unordered set, serializing that set (to a string or
other observable output) should produce the same order found in the original
input string.
11 changes: 11 additions & 0 deletions spec/Section 4 -- Introspection.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,17 @@ Tools built using GraphQL introspection should respect deprecation by
discouraging deprecated use through information hiding or developer-facing
warnings.

**Ordering**

When possible, implementations should preserve observable order for unordered
data collections. For example, if a schema was produced from a source
{TypeSystemDocument} then introspection of fields, input fields, arguments, enum
values, directives, union members, implemented interfaces and so on should
produce the same order as found in the source.

Note: This recommendation is to improve legibility and stability of schema
representations.

**Schema Introspection Schema**

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

0 comments on commit 368a48b

Please sign in to comment.