Several validator fixes

This commit is contained in:
vladar 2016-04-30 23:25:09 +06:00
parent e82f887918
commit a6a4f7862b
4 changed files with 9 additions and 6 deletions

View File

@ -6,9 +6,9 @@ use GraphQL\Error;
use GraphQL\Language\AST\Node; use GraphQL\Language\AST\Node;
use GraphQL\Language\AST\VariableDefinition; use GraphQL\Language\AST\VariableDefinition;
use GraphQL\Language\Printer; use GraphQL\Language\Printer;
use GraphQL\Language\Visitor;
use GraphQL\Type\Definition\NonNull; use GraphQL\Type\Definition\NonNull;
use GraphQL\Validator\DocumentValidator; use GraphQL\Validator\DocumentValidator;
use GraphQL\Validator\Messages;
use GraphQL\Validator\ValidationContext; use GraphQL\Validator\ValidationContext;
class DefaultValuesOfCorrectType class DefaultValuesOfCorrectType
@ -49,8 +49,10 @@ class DefaultValuesOfCorrectType
)); ));
} }
} }
return null; return Visitor::skipNode();
} },
Node::SELECTION_SET => function() {return Visitor::skipNode();},
Node::FRAGMENT_DEFINITION => function() {return Visitor::skipNode();}
]; ];
} }
} }

View File

@ -4,6 +4,7 @@ namespace GraphQL\Validator\Rules;
use GraphQL\Error; use GraphQL\Error;
use GraphQL\Language\AST\Argument; use GraphQL\Language\AST\Argument;
use GraphQL\Language\AST\Node; use GraphQL\Language\AST\Node;
use GraphQL\Language\Visitor;
use GraphQL\Validator\ValidationContext; use GraphQL\Validator\ValidationContext;
class UniqueArgumentNames class UniqueArgumentNames
@ -36,7 +37,7 @@ class UniqueArgumentNames
} else { } else {
$this->knownArgNames[$argName] = $node->name; $this->knownArgNames[$argName] = $node->name;
} }
return false; return Visitor::skipNode();
} }
]; ];
} }

View File

@ -35,7 +35,7 @@ class UniqueFragmentNames
} else { } else {
$this->knownFragmentNames[$fragmentName] = $node->name; $this->knownFragmentNames[$fragmentName] = $node->name;
} }
return false; return Visitor::skipNode();
} }
]; ];
} }

View File

@ -34,7 +34,7 @@ class UniqueOperationNames
$this->knownOperationNames[$operationName->value] = $operationName; $this->knownOperationNames[$operationName->value] = $operationName;
} }
} }
return false; return Visitor::skipNode();
}, },
Node::FRAGMENT_DEFINITION => function() { Node::FRAGMENT_DEFINITION => function() {
return Visitor::skipNode(); return Visitor::skipNode();