Skip to content

Commit

Permalink
polish changes
Browse files Browse the repository at this point in the history
Fixes: #336
  • Loading branch information
fogrye committed Feb 11, 2024
1 parent d83549a commit ab94f9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/Mappers/RecursiveTypeMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ public function mapNameToType(string $typeName): Type&NamedType

return $this->mapClassToInterfaceOrType($className, null);
}

throw TypeNotFoundException::createError($typeName);
}
}
7 changes: 3 additions & 4 deletions tests/SchemaFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
use TheCodingMachine\GraphQLite\Mappers\Parameters\ParameterMiddlewarePipe;
use TheCodingMachine\GraphQLite\Mappers\Root\VoidRootTypeMapperFactory;
use TheCodingMachine\GraphQLite\Mappers\StaticClassListTypeMapperFactory;
use TheCodingMachine\GraphQLite\Mappers\TypeNotFoundException;
use TheCodingMachine\GraphQLite\Middlewares\FieldMiddlewarePipe;
use TheCodingMachine\GraphQLite\Middlewares\InputFieldMiddlewarePipe;
use TheCodingMachine\GraphQLite\Security\VoidAuthenticationService;
Expand Down Expand Up @@ -169,7 +168,7 @@ public function testException2(): void
$factory->createSchema();
}

private function _doTestSchema(Schema $schema): ExecutionResult
private function execTestQuery(Schema $schema): ExecutionResult
{
$schema->assertValid();

Expand All @@ -193,7 +192,7 @@ private function _doTestSchema(Schema $schema): ExecutionResult

private function doTestSchemaWithError(Schema $schema): void
{
$result = $this->_doTestSchema($schema);
$result = $this->execTestQuery($schema);
$resultArr = $result->toArray(DebugFlag::RETHROW_INTERNAL_EXCEPTIONS);
$this->assertArrayHasKey('errors', $resultArr);
$this->assertArrayNotHasKey('data', $resultArr);
Expand All @@ -203,7 +202,7 @@ private function doTestSchemaWithError(Schema $schema): void

private function doTestSchema(Schema $schema): void
{
$result = $this->_doTestSchema($schema);
$result = $this->execTestQuery($schema);
$resultArr = $result->toArray(DebugFlag::RETHROW_INTERNAL_EXCEPTIONS);
$this->assertArrayHasKey('data', $resultArr);
$this->assertSame([
Expand Down

0 comments on commit ab94f9c

Please sign in to comment.