At a glance
- Identifier: #1092
- Stage: RFC 3 / Accepted
- Champion: @benjie
- Latest activity: 5 commits pushed on 2025-09-01
- Spec PR: https://github.com/graphql/graphql-spec/pull/1092
- Related:
Spec PR description
For legibility and consistency reasons, it's helpful if the order of unordered collections is maintained. For example, an enum describes a set (unordered) of possible values, but it would be irritating if every time you introspected the API or built an SDL for it the enum values were in a different (random) order. This PR recommends that you maintain the initial order that such unordered collections were created with. Theoretically, this means that if you generate SDL from a schema (e.g. via introspection) and then build a new cloned schema from this SDL, generating SDL from this cloned schema (e.g. via introspection) should match the original SDL (i.e. printSchema(schema) == printSchema(buildClientSchema(introspectionFromSchema(schema))))
This PR builds on #1091 and is a change extracted from #1063 as discussed at last night's WG meeting. It does need to be stacked since it also adds the ordering details to Appendix A (originally we thought it might be able to be separate).
This is PR 2 of 3 in the "data collections" trilogy stack
The previous PR in this stack is:
- #1102
The next PR in this stack is:
- #1063
Timeline
- 5 commits pushed on 2025-09-01:
- leebyron committed "Merge branch 'main' into maintain-order"
- leebyron committed "wordsmithing"
- leebyron committed "another round of clarification"
- leebyron committed "explicit data structure in example"
- leebyron committed "use 'required'"
- Commit pushed on 2025-07-03 by benjie: Merge branch 'main' into maintain-order
- Added to WG agenda on 2025-05-01
- Added to WG agenda on 2025-04-03
- Added to WG agenda on 2024-06-06
- Spec PR created on 2024-04-05 by benjie
- Commit pushed on 2024-04-05 by benjie: Add recommendation to preserve order where possible