Recommend that order of unordered collections is maintained where possible
At a glance​
- Identifier: #1092
- Stage: RFC2: Draft
- Champion: @benjie
- PR: Recommend that order of unordered collections is maintained where possible
- Related:
Timeline​
- Added to 2024-06-06 WG agenda
- Spec PR created on 2024-04-05 by benjie
- Commit pushed: Add recommendation to preserve order where possible on 2024-04-05 by @benjie
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).
The previous PR in this stack is:
- #1102
The next PR in this stack is:
- #1063