Skip to content

Commit 75d647a

Browse files
committed
Fully revert NodeList changes
1 parent e20673b commit 75d647a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Language/Visitor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public static function visit(object $root, array $visitor, ?array $keyMap = null
224224
throw new \Exception("Can only add Node to NodeList, got: {$notNode}.");
225225
}
226226

227-
$node->set($editKey, $editValue);
227+
$node[$editKey] = $editValue;
228228
} else {
229229
$node->{$editKey} = $editValue;
230230
}
@@ -246,7 +246,7 @@ public static function visit(object $root, array $visitor, ?array $keyMap = null
246246
? $index
247247
: $keys[$index];
248248
$node = $parent instanceof NodeList
249-
? $parent->get($key)
249+
? $parent[$key]
250250
: $parent->{$key};
251251
}
252252
if ($node === null) {

tests/Error/ErrorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ public function testSerializesToIncludeMessageAndLocations(): void
114114
{
115115
$ast = Parser::parse('{ field }');
116116
/** @var OperationDefinitionNode $operationDefinition */
117-
$operationDefinition = $ast->definitions->get(0);
118-
$node = $operationDefinition->selectionSet->selections->get(0);
117+
$operationDefinition = $ast->definitions[0];
118+
$node = $operationDefinition->selectionSet->selections[0];
119119
$e = new Error('msg', [$node]);
120120

121121
self::assertEquals(

0 commit comments

Comments
 (0)