You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This should be used to declare typeLoader in `GraphQL\Type\Schema` with
something similar to:
```php
$types = new Types(...);
$schema = new GraphQL\Type\Schema([
'typeLoader' => fn (string $name) => $types->loadType($name, 'Application\Model') ?? $types->loadType($name, 'OtherApplication\Model')
// ...
]);
```
While this method could technically replace of uses of dedicated `get*()
`methods, we suggest to only use `loadType` with the `typeLoader`.
Because dedicated `get*()` methods are easier to use, and provide
stronger typing.
This is a breaking change because of the new method on `TypesInterface`,
but pre-existing behavior remains unchanged.
message:"#^Method GraphQL\\\\Doctrine\\\\Types\\:\\:getOperator\\(\\) should return GraphQL\\\\Doctrine\\\\Definition\\\\Operator\\\\AbstractOperator but returns GraphQL\\\\Type\\\\Definition\\\\NamedType&GraphQL\\\\Type\\\\Definition\\\\Type\\.$#"
Copy file name to clipboardexpand all lines: tests/TypesTest.php
+36
Original file line number
Diff line number
Diff line change
@@ -156,4 +156,40 @@ public function testHas(): void
156
156
$this->types->get(stdClass::class);
157
157
self::assertTrue($this->types->has('customName'), 'should have custom registered type by its name, even if custom key was different, once type is created');
0 commit comments