At a glance
- Project
- GraphQL Spec
- Identifier
- #1063
- Stage
- RFC 2 / Draft
- Champion
- @benjie
- Updated
- 2025-09-01
- Latest activity
- Pull request closed on
- Source
- Pull request
Pull request description
UPDATE 2025-06-26: The motivation of this PR is to make introspection stable (and, related, to make printSchema() stable, and to make printSchema(buildSchema(printSchema(schema))) === printSchema(schema)).
UPDATE 2024-04-05: Following last night's WG meeting, this PR has been split into 3 parts, and is now PR 3 of 3 in the "data collections" trilogy stack
- #1102
- #1092
- #1063 (this one)
As raised by @cdaringe in #1062, enum values don't dictate an explicit order. On scanning through the spec in more detail, it turns out this is true of a few other things too.
Everything in SDL is implicitly ordered (since it's a textual representation, one thing after another) and everything in introspection is implicitly ordered (because it's represented via lists). E.g. in introspection, enumValues is a list, and a list is inherently ordered.
I feel it's an unwritten rule that GraphQL introspection should be stable (i.e. introspect the exact same schema twice with the exact same introspection query and the results should be the same). Thus, there should be an order (dictated by the schema designer), and I'd like to make that more explicit.
I researched the current status, and I think we can start to fix this with the few minor edits I made to the spec in this PR, in particular:
- changing from using the word
set(which is generally perceived as unordered) to the wordlist(which is always ordered), - specifying list for things that are currently ambiguous.
Generally this was achieved by copying text from similar things, e.g. the directive arguments copied from field arguments; input object fields copied from object fields.
I know that @IvanGoncharov has been very careful in graphql-js to ensure that ordering is stable, I believe he ensures that introspection -> SDL -> introspection always results in the same results.
Status before this PR (emphasis mine)
Object fields: ordered :white_check_mark:
GraphQL Objects represent a list of named fields, each of which yield a value of a specific type.
Object field arguments: ordered :white_check_mark:
Object field arguments are defined as a list of all possible argument names and their expected input types
Object interfaces: not declared? :disappointed:
An object type may declare that it implements one or more unique interfaces.
(I couldn't find anything in Section 3 declaring set/list.)
Input object fields: a "set" :x:
A GraphQL Input Object defines a set of input fields
Enum values: a "set" :x:
However Enum types describe the set of possible values
Directive arguments: not declared? :disappointed:
(I couldn't find anything in Section 3 declaring set/list.)
Timeline
September 2025
- Pull request closed on
June 2025
- Top comment edited on by benjie
- Marked as Ready for Next Stage on by benjie
- Discussed in GraphQL WGNext Steps
Lee: 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
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
- @benjie committed "Clarify wording" on
June 2024
- 3 commits pushed on
- @benjie committed "Interface fields do not need to be implemented in order."
- @benjie committed "Interfaces an object implements are ordered"
- @benjie committed "Unions are ordered."
- 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
- 3 commits pushed on
- @benjie committed "Define Data Collections used in the spec"
- @benjie committed "Add recommendation to preserve order where possible"
- @benjie committed "Be explicit about the ordering of data types"
- Advanced to RFC 2 on by leebyron
- Discussed in GraphQL WG
March 2024
- Top comment edited on by benjie
January 2024
- On the agenda for GraphQL WG
7 listed attendees · 8 agenda items · 1 linked RFC
- Agree to Membership Agreement, Participation & Contribution Guidelines and Code of Conduct (1m, Lee)
- Introduction of attendees (5m, Lee)
- Determine volunteers for note taking (1m, Lee)
- Review agenda (2m, Lee)
- Review prior secondary meetings (5m, Lee)
- Review previous meeting's action items (5m, Lee)
- Update on TSC membership vote (5m, Lee)
- Type system ordering RFC (15m, Benjie) #1063
November 2023
- Advanced to RFC 0 on by benjie
- Top comment edited on by benjie
- Pull request created on by benjie