Skip to content

Conversation

leebyron
Copy link
Contributor

This adds a new method to the validation context which when given an Operation definition, returns a list of all Fragment definitions recursively referenced via fragment spreads.

This new method is then used to ensure no fragments are unused.

The implementation of this method is the same in principle as the one which used to be inline in the validation rule, but has been unfolded from recursion to use a while loop.

This adds a new method to the validation context which when given an Operation definition, returns a list of all Fragment definitions recursively referenced via fragment spreads.

This new method is then used to ensure no fragments are unused.

The implementation of this method is the same in principle as the one which used to be inline in the validation rule, but has been unfolded from recursion to use a while loop.
leebyron added a commit that referenced this pull request Nov 17, 2015
[Validation] Factor out and memoize recursively referenced fragments.
@leebyron leebyron merged commit 88acc01 into master Nov 17, 2015
@leebyron leebyron deleted the better-no-unused-fragments branch November 17, 2015 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants