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

5.4.1.4 - Fragments must be used #109

Open
jlouis opened this issue Oct 30, 2017 · 1 comment
Open

5.4.1.4 - Fragments must be used #109

jlouis opened this issue Oct 30, 2017 · 1 comment

Comments

@jlouis
Copy link
Owner

jlouis commented Oct 30, 2017

The system must reject the following query, which has a fragment which is never used in the system.

fragment nameFragment on Dog { # unused
  name
}

{
  dog {
    name
  }
}
@jlouis jlouis mentioned this issue Oct 30, 2017
35 tasks
@jlouis
Copy link
Owner Author

jlouis commented Oct 31, 2017

To solve this, we can use #107. We can simply compute this by folding over mutations/queries and tracking the fragments they refer to. Once this is known, we can build the transitive closure of fragments the fragments refer to. Finally, every fragment not in this set is unused.

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

No branches or pull requests

1 participant