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

Conversation

benjie
Copy link
Member

@benjie benjie commented Apr 5, 2024

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:

The next PR in this stack is:

@benjie benjie added the 💭 Strawman (RFC 0) RFC Stage 0 (See CONTRIBUTING.md) label Apr 5, 2024
@benjie benjie changed the title Recommend that order of unordered types is maintained where possible Recommend that order of unordered collections is maintained where possible Apr 5, 2024
@benjie benjie added 📄 Draft (RFC 2) RFC Stage 2 (See CONTRIBUTING.md) and removed 💭 Strawman (RFC 0) RFC Stage 0 (See CONTRIBUTING.md) labels Apr 5, 2024
@benjie
Copy link
Member Author

benjie commented Apr 5, 2024

This was split from RFC2 PR #1063, so I have marked it as RFC 2 itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📄 Draft (RFC 2) RFC Stage 2 (See CONTRIBUTING.md)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants