question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Validate inline fragments on GraphQL objects

See original GitHub issue

Using 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
Zaid-Ajajcommented, Jul 27, 2020

I feel like I’m bugging more than debugging lol

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 😄

0reactions
mattsonlyattackcommented, Jul 27, 2020

I feel like I’m bugging more than debugging lol

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found