Skip to content

feature: Support inline fragments without a type condition #123

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

Merged
merged 1 commit into from
Mar 29, 2016

Conversation

dylanahsmith
Copy link
Contributor

Problem

A graphql query with an inline fragment that doesn't have a type condition would be considered an invalid query.

See the Inline Fragments section of the graphql spec which shows that the type condition is optional and includes examples of queries with inline fragments without a type condition.

Solution

There were several places where it was assumed that a fragment always had a type, so I had to update the parser, transformer, static validator and the selection resolution. Basically if the type condition isn't specified, then we can skip the type check and continue using the parent type.

@rmosolgo
Copy link
Owner

Ohh I see it was added a while back: graphql/graphql-spec#100 I guess I missed it!

Thanks!

@rmosolgo rmosolgo merged commit 45914db into rmosolgo:master Mar 29, 2016
@dylanahsmith dylanahsmith deleted the inline-frag-no-type-cond branch March 29, 2016 19:49
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.

2 participants