Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommend that order of unordered collections is maintained where possible #1092

Open
wants to merge 1 commit into
base: data-collections
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading