diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index f06aa73..998038d 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -945,7 +945,9 @@ class Executor $hint = "Make sure that type loader returns the same instance as defined in {$info->parentType}.{$info->fieldName}"; } throw new InvariantViolation( - "Schema must contain unique named types but contains multiple types named \"$returnType\". $hint" + "Schema must contain unique named types but contains multiple types named \"$returnType\". ". + "$hint ". + "(see http://webonyx.github.io/graphql-php/type-system/#type-registry)." ); } @@ -1136,7 +1138,8 @@ class Executor throw new InvariantViolation( "Schema must contain unique named types but contains multiple types named \"$runtimeType\". ". "Make sure that `resolveType` function of abstract type \"{$returnType}\" returns the same ". - "type instance as referenced anywhere else within the schema." + "type instance as referenced anywhere else within the schema " . + "(see http://webonyx.github.io/graphql-php/type-system/#type-registry)." ); } diff --git a/src/Utils/TypeInfo.php b/src/Utils/TypeInfo.php index a03ecf7..fa97d1b 100644 --- a/src/Utils/TypeInfo.php +++ b/src/Utils/TypeInfo.php @@ -106,7 +106,8 @@ class TypeInfo if (!empty($typeMap[$type->name])) { Utils::invariant( $typeMap[$type->name] === $type, - "Schema must contain unique named types but contains multiple types named \"$type\"." + "Schema must contain unique named types but contains multiple types named \"$type\" ". + "(see http://webonyx.github.io/graphql-php/type-system/#type-registry)." ); return $typeMap; } diff --git a/tests/Executor/AbstractTest.php b/tests/Executor/AbstractTest.php index 7ae295f..bca67d3 100644 --- a/tests/Executor/AbstractTest.php +++ b/tests/Executor/AbstractTest.php @@ -483,7 +483,8 @@ class AbstractTest extends \PHPUnit_Framework_TestCase $this->assertEquals( 'Schema must contain unique named types but contains multiple types named "Test". '. 'Make sure that `resolveType` function of abstract type "Node" returns the same type instance '. - 'as referenced anywhere else within the schema.', + 'as referenced anywhere else within the schema '. + '(see http://webonyx.github.io/graphql-php/type-system/#type-registry).', $result->errors[0]->getMessage() ); } diff --git a/tests/Executor/ExecutorLazySchemaTest.php b/tests/Executor/ExecutorLazySchemaTest.php index b7d2181..8fd7772 100644 --- a/tests/Executor/ExecutorLazySchemaTest.php +++ b/tests/Executor/ExecutorLazySchemaTest.php @@ -185,7 +185,8 @@ class ExecutorLazySchemaTest extends \PHPUnit_Framework_TestCase $this->assertEquals( 'Schema must contain unique named types but contains multiple types named "Test". '. - 'Make sure that type loader returns the same instance as defined in Query.test', + 'Make sure that type loader returns the same instance as defined in Query.test '. + '(see http://webonyx.github.io/graphql-php/type-system/#type-registry).', $result->errors[0]->getMessage() ); $this->assertInstanceOf( diff --git a/tests/Type/ValidationTest.php b/tests/Type/ValidationTest.php index 6c062f3..097f5dc 100644 --- a/tests/Type/ValidationTest.php +++ b/tests/Type/ValidationTest.php @@ -359,7 +359,8 @@ class ValidationTest extends \PHPUnit_Framework_TestCase $this->setExpectedException( InvariantViolation::class, - 'Schema must contain unique named types but contains multiple types named "String".' + 'Schema must contain unique named types but contains multiple types named "String" '. + '(see http://webonyx.github.io/graphql-php/type-system/#type-registry).' ); new Schema(['query' => $QueryType]); } @@ -389,7 +390,8 @@ class ValidationTest extends \PHPUnit_Framework_TestCase $this->setExpectedException( InvariantViolation::class, - 'Schema must contain unique named types but contains multiple types named "SameName".' + 'Schema must contain unique named types but contains multiple types named "SameName" '. + '(see http://webonyx.github.io/graphql-php/type-system/#type-registry).' ); new Schema([ 'query' => $QueryType ]); @@ -427,7 +429,8 @@ class ValidationTest extends \PHPUnit_Framework_TestCase $this->setExpectedException( InvariantViolation::class, - 'Schema must contain unique named types but contains multiple types named "BadObject".' + 'Schema must contain unique named types but contains multiple types named "BadObject" '. + '(see http://webonyx.github.io/graphql-php/type-system/#type-registry).' ); new Schema([