At a glance
- Project
- GraphQL Spec
- Identifier
- #1092
- Stage
- RFC 3 / Accepted
- Champion
- @benjie
- Updated
- 2025-09-03
- Latest activity
- Pull request merged on
- Source
- Pull request
- Related RFCs
- #1091
Pull request 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
September 2025
- Pull request merged on by leebyron
- 5 commits pushed on
- @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'"
July 2025
- @benjie committed "Merge branch 'main' into maintain-order" on
June 2025
- Top comment edited on by benjie
- Advanced to RFC 3 on by leebyron
- Discussed in GraphQL WGNext Steps
Lee: Clean up and merge parts 1 and 2 of Benjie's data collections trilogy PRs
Zoom summary · GraphQL WG · 2025-06-26Next StepsLee: Review and simplify the data structures notation section at the top of the GraphQL spec before merging related PRs
Zoom summary · GraphQL WG · 2025-06-26The group discusses several RFC (Request for Comments) proposals and their progress. They accept and merge a proposal about not excluding the schema keyword if the schema has a description, noting that GraphQL JS already implements this behavior. They also review a set of three related pull requests about data collections, which Benjie wants included in the next spec release to improve accuracy and precision. Lee agrees to include these changes, marking them as accepted, but notes he will make some editorial simplifications before merging. The meeting concludes with a brief mention of additional linked pull requests related to the data collections proposal.
Zoom summary · GraphQL WG · 2025-06-26Benjie proposes three changes to improve consistency in GraphQL schema definitions. The first two changes are approved: one clarifies that fields should be returned in a consistent order when possible, and the other recommends maintaining order for unordered elements like enums. The third change, which explicitly marks certain schema parts as ordered, is set aside for further discussion due to potential implications for performance and implementation flexibility. Lee agrees to merge the first two changes.
Zoom summary · GraphQL WG · 2025-06-26 - On the agenda for GraphQL WG
12 listed attendees · 16 agenda items · 9 linked RFCs
- Discussion: AI and GraphQL (10m, Jory)
- Discussion: GraphQL-over-HTTP partial success status code (5m, Benjie)
- RFC2: Descriptions on executable definitions (5m, Stephen) #892
- RFC0: Don't exclude schema with description (3m, Benjie) #1167
- Spec format: Always use 'Assert:' (2m, Benjie)
- RFC2: Schema coordinates (5m, Mark) #794
- Editorial: Define "execution result" and "request error result" (5m, Rob)
- Editorial: Step 1 in the data collections trilogy (5m, Benjie) #1102 #1092
- RFC3: Merge OneOf (2m, Benjie) #825
- RFC3: Merge prevent @skip/@include on root subscription set (2m, Benjie) #860
- RFC2: Default value coercion rules (10m, Benjie) #793
- Discussion: Section 3 (Type System) and execution vs request error (5m, Benjie)
- Editorial: Replace ExecuteSelectionSet with ExecuteCollectFields (2m, Benjie)
- RFC1: Disabling error propagation/service capabilities (15m, Benjie) #1163
- Spec cut - vibe check (5m, Benjie)
- Appendix C - builtin definitions (5m, Martin)
May 2025
- Discussed in GraphQL WGNext Steps
Lee to review and provide feedback on the "data collections trilogy" PRs.
Zoom summary · GraphQL WG · 2025-05-01In the meeting, Benjie discussed the data collections trilogy, which includes three pull requests. The first defines the data collections used in the spec, the second recommends maintaining the order of things, and the third specifies the specific ordering of certain things. Lee and Michael discussed the order of enum values and the potential for breaking existing implementations if order is enforced. Pascal suggested a difference between the result and the schema, as the order of fields in the result can be controlled, but not in the schema. Lee proposed making most things ordered but not requiring it, to avoid breaking existing implementations. The team agreed to merge the first pull request and review the second and third ones. The changes are intended to be editorial, clarifying the meaning of terms like list and set.
Zoom summary · GraphQL WG · 2025-05-01
April 2025
- On the agenda for GraphQL WG
11 listed attendees · 16 agenda items · 14 linked RFCs
- Let's set a July 1st deadline for spec release (2m, Benjie)
- Open Telemetry Sub Commitee announcement (2m, Pascal)
- Add 'extensions' to request (5m, Benjie) #976
- Provision for unknown request information (5m, Martin)
- Defer/Stream Updates (10m, Rob) DeferStream
- Benjie's editorial PRs (20m, Benjie)
- Clarify "before execution begins" (10m, Benjie and Martin)
- Disabling error propagation proposal (10m, Alex) #1153
- Reaching a consensus on Semantic Nullability (25m, Alex) SemanticNullability wg#1700 #1065
- Make includeDeprecated non-null (10m, Martin) #1142
- Please give feedback on the following (2m, Martin)
- Implementations may not deprecate a field that the interface hasn't deprecated (2m, Benjie) #1053
- Prevent @skip and @include on root subscription selection set (5m, Benjie) #860
- OneOf Input Objects (10m, Benjie) #825
- Default value coercion rules (15m, Benjie) #793
- Define Data Collections used in the spec (20m, Benjie) #1102 #1092 #1063
July 2024
- Top comment edited on by benjie
June 2024
- On the agenda for GraphQL WG
9 listed attendees · 5 agenda items · 4 linked RFCs
- Editorial change to "composite" term (2m, Jovi)
- Editorial: show how the parts of a request are passed to ExecuteRequest (5m, Benjie)
- Move Fragment Arguments RFC to RFC2? (10m, Jovi) #1081
- Define data collections used in the spec (10m, Benjie) #1091 #1092 #1063
- Fix reference mistake in subscription execution (5m, Benjie)
April 2024
- Top comment edited on by benjie
- Pull request created on by benjie
- @benjie committed "Add recommendation to preserve order where possible" on
- Advanced to RFC 2 on by benjie