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

Fix variable rules - variables are not detected when used in lists and object fields #215

Closed
michaelstaib opened this issue Aug 21, 2018 · 0 comments · Fixed by #746
Closed
Labels
⚖️ spec Implement or fix a GraphQL specification item.
Milestone

Comments

@michaelstaib
Copy link
Member

Add more tests

it('variable not used by unreferenced fragment', () => {
expectFailsRule(
NoUnusedVariables,
query Foo($b: String) { ...FragA } fragment FragA on Type { field(a: $a) } fragment FragB on Type { field(b: $b) },
[unusedVar('b', 'Foo', 2, 17)],
);
});

it('variable not used by fragment used by other operation', () => {
expectFailsRule(
NoUnusedVariables,
query Foo($b: String) { ...FragA } query Bar($a: String) { ...FragB } fragment FragA on Type { field(a: $a) } fragment FragB on Type { field(b: $b) },
[unusedVar('b', 'Foo', 2, 17), unusedVar('a', 'Bar', 5, 17)],
);
});

@michaelstaib michaelstaib added bug ⚖️ spec Implement or fix a GraphQL specification item. labels Aug 21, 2018
@michaelstaib michaelstaib added this to the 0.4.5 milestone Aug 25, 2018
@michaelstaib michaelstaib modified the milestones: 0.4.5, 0.5.0 Sep 2, 2018
@michaelstaib michaelstaib removed this from the 0.5.0 milestone Oct 4, 2018
@michaelstaib michaelstaib added this to the Backlog milestone Jan 16, 2019
@michaelstaib michaelstaib modified the milestones: Backlog, 0.8.1, 9.0.0 Mar 24, 2019
@michaelstaib michaelstaib modified the milestones: 9.0.0, 9.1.0 Apr 28, 2019
@michaelstaib michaelstaib modified the milestones: 9.1.0, 9.0.0 May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚖️ spec Implement or fix a GraphQL specification item.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant