public function testVariableInFragmentUsedByOtherOperation()
{
$this->expectFailsRule(new NoUndefinedVariables(), '
query Foo($b: String) {
...FragA
}
query Bar($a: String) {
...FragB
}
fragment FragA on Type {
field(a: $a)
}
fragment FragB on Type {
field(b: $b)
}
', [$this->undefVar('a', 9, 18, 'Foo', 2, 7), $this->undefVar('b', 12, 18, 'Bar', 5, 7)]);
}