Version 4.7.6
This commit is contained in:
1 parent
8ba7d43898
commit
7b7404e741
1085 files changed
+30590
-7837
No files matched your search
@@ -31,6 +31,7 @@ use GraphQL\Utils\TypeInfo;
|
||||
use SplObjectStorage;
|
||||
use function array_merge;
|
||||
use function array_pop;
|
||||
use function assert;
|
||||
use function count;
|
||||
|
||||
/**
|
||||
@@ -180,16 +181,15 @@ class ValidationContext extends ASTValidationContext
|
||||
while (count($setsToVisit) > 0) {
|
||||
$set = array_pop($setsToVisit);
|
||||
|
||||
for ($i = 0, $selectionCount = count($set->selections); $i < $selectionCount; $i++) {
|
||||
$selection = $set->selections[$i];
|
||||
foreach ($set->selections as $selection) {
|
||||
if ($selection instanceof FragmentSpreadNode) {
|
||||
$spreads[] = $selection;
|
||||
} elseif ($selection instanceof FieldNode || $selection instanceof InlineFragmentNode) {
|
||||
if ($selection->selectionSet) {
|
||||
$setsToVisit[] = $selection->selectionSet;
|
||||
}
|
||||
} else {
|
||||
throw InvariantViolation::shouldNotHappen();
|
||||
assert($selection instanceof FieldNode || $selection instanceof InlineFragmentNode);
|
||||
$selectionSet = $selection->selectionSet;
|
||||
if ($selectionSet !== null) {
|
||||
$setsToVisit[] = $selectionSet;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user