Validate inline fragments on GraphQL objects
See original GitHub issueUsing an inline fragment with type condition should be validated when used as part of the selection set of a GraphQL object. Sample incorrect query (see this comment)
query GetPullRequests($org: String!) {
organization(login: $org) {
name
url
repositories(first: 100) {
nodes {
name
pullRequests(first: 100, states: OPEN) {
nodes {
number
title
url
body
author {
login
}
reviews(last: 10, states: APPROVED) {
nodes {
author {
login
}
... on User {
__typename
bio
id
}
}
}
}
}
}
}
}
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Query fragments - GraphQL Tutorials
Named fragments can stand alone and are great for reuse across multiple queries. Inline fragments can be written and read easily within the...
Read more >Fragments - Apollo GraphQL Docs
A GraphQL fragment is a piece of logic that can be shared between multiple queries and mutations. Every fragment includes a subset of...
Read more >GraphQL Inline fragments check if exist and then output in ...
I have a react component in gatsbyJS that is mapping through a graphQL query, so far it works however I have introduced a...
Read more >Inline fragments
GraphQL's permits polymorphism through inline fragments, through objects being available as GraphQL Unions and Interfaces. Eduflow uses inline fragments ...
Read more >[Validation] Nested inline fragments may be unreachable
It is about an unexpected behavior of the inline Type fragments in the current GraphQL spec. Consider the GraphQL schema defined in the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

No, feedback from real use cases are really valuable and I couldn’t otherwise fix all of these problems without your input 😉 In any case, I just released another fix for the naming collisions as of v1.7.3 and this time I’ve added integration tests for the Github schema that generate and compile a project based on your GraphQL queries so now we know for sure it works without accidentally breaking it 😄
I feel like I’m bugging more than debugging lol