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

Fixed fragment applicability to union types; no interfaces in unions #592

Merged
merged 2 commits into from
Apr 10, 2024

Conversation

milessabin
Copy link
Member

@milessabin milessabin commented Apr 9, 2024

Fixes fragmentApplies so that it now accepts union types for a fragment type condition.

There are some lurking issues in the definition/use of <:< for unions which I don't want to address right now ... I'll create a separate issue to track that and pick them up later (#593)

In the process of exploring other test scenarios I realized that the GraphQL spec explicitly excludes interface types as being members of unions. I've modified the schema validator to check for that now, and fixed a couple of tests which became invalid as a result.

Fixes #590.

@milessabin milessabin self-assigned this Apr 9, 2024
@milessabin milessabin changed the title Topic/nested union fragments Fixed fragment applicability to union types; no interfaces in unions Apr 9, 2024
@milessabin
Copy link
Member Author

@umazalakain I've sent you a collaborator invite ... please accept it if you like to review this 😄

Copy link
Collaborator

@umazalakain umazalakain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that it might be worth implementing a fragmentApplies that does not rely on the subtyping relation <:<. In particular, https://spec.graphql.org/October2021/#sec-Fragment-spread-is-possible outlines a seemingly simple solution.

@umazalakain
Copy link
Collaborator

umazalakain commented Apr 10, 2024

@milessabin milessabin merged commit 830bfc5 into main Apr 10, 2024
21 checks passed
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

Successfully merging this pull request may close these issues.

Regression introduced in 0.18.1
2 participants