mirror of
https://github.com/retailcrm/graphql-php.git
synced 2025-03-11 15:26:12 +03:00
Added link to docs for generic error about unique type instance (#149)
This commit is contained in:
parent
7f346d5658
commit
90602b31ba
@ -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)."
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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()
|
||||
);
|
||||
}
|
||||
|
@ -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(
|
||||
|
@ -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([
|
||||
|
Loading…
x
Reference in New Issue
Block a user