new Deps
This commit is contained in:
1 parent
e7a49138bb
commit
aae17f10a6
818 files changed
+70693
-16406
No files matched your search
@@ -9,6 +9,7 @@ use GraphQL\Language\AST\FragmentDefinitionNode;
|
||||
use GraphQL\Language\AST\NameNode;
|
||||
use GraphQL\Language\AST\NodeKind;
|
||||
use GraphQL\Language\Visitor;
|
||||
use GraphQL\Language\VisitorOperation;
|
||||
use GraphQL\Validator\ValidationContext;
|
||||
use function sprintf;
|
||||
|
||||
@@ -22,12 +23,12 @@ class UniqueFragmentNames extends ValidationRule
|
||||
$this->knownFragmentNames = [];
|
||||
|
||||
return [
|
||||
NodeKind::OPERATION_DEFINITION => static function () {
|
||||
NodeKind::OPERATION_DEFINITION => static function () : VisitorOperation {
|
||||
return Visitor::skipNode();
|
||||
},
|
||||
NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $node) use ($context) {
|
||||
NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $node) use ($context) : VisitorOperation {
|
||||
$fragmentName = $node->name->value;
|
||||
if (empty($this->knownFragmentNames[$fragmentName])) {
|
||||
if (! isset($this->knownFragmentNames[$fragmentName])) {
|
||||
$this->knownFragmentNames[$fragmentName] = $node->name;
|
||||
} else {
|
||||
$context->reportError(new Error(
|
||||
|
||||
Reference in new issue
Block a user