Skip to content

Consider reducing the criticality of adding new union members? #2877

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

Open
martinbonnin opened this issue Apr 1, 2025 · 0 comments
Open

Consider reducing the criticality of adding new union members? #2877

martinbonnin opened this issue Apr 1, 2025 · 0 comments

Comments

@martinbonnin
Copy link

martinbonnin commented Apr 1, 2025

graphql-inspector currently considers adding new members to an union as Dangerous.

While this could break some clients, I believe there are ways to guard against this on the client side and adding new union members is an important tool for schema evolution that we should encourage as a community.

What about introducing a new less scary ADVISORY criticality level?

export enum CriticalityLevel {
  NonBreaking = 'NON_BREAKING',
  Advisory = 'ADVISORY',
  Dangerous = 'DANGEROUS',
  Breaking = 'BREAKING',
}

This, coupled with best practices how to handle unkown types/enum values on the client, would allow teams to update their schemas much more confidently.

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant