Skip to content

Commit

Permalink
Merge 36959d0 into 81b5c6b
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia committed Apr 13, 2022
2 parents 81b5c6b + 36959d0 commit e9e99ad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci-build.yml
Expand Up @@ -24,11 +24,12 @@ jobs:
- uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@2.9.0
uses: shivammathur/setup-php@2.18.1
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: json, mbstring

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,11 @@

#### Unreleased

#### 14.11.6

Fixed:
- Fix validation of modified sparse ASTs

#### 14.11.5

Fixed:
Expand Down
13 changes: 6 additions & 7 deletions src/Validator/ValidationContext.php
Expand Up @@ -180,16 +180,15 @@ public function getFragmentSpreads(HasSelectionSet $node) : array
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;
}
}
}
}
Expand Down

0 comments on commit e9e99ad

Please sign in to comment.