unknownArgMessage() 정적인 공개 메소드

static public unknownArgMessage ( $argName, $fieldName, $typeName )
예제 #1
0
 public function __invoke(ValidationContext $context)
 {
     return [Node::ARGUMENT => function (Argument $node) use($context) {
         $fieldDef = $context->getFieldDef();
         if ($fieldDef) {
             $argDef = null;
             foreach ($fieldDef->args as $arg) {
                 if ($arg->name === $node->name->value) {
                     $argDef = $arg;
                     break;
                 }
             }
             if (!$argDef) {
                 $parentType = $context->getParentType();
                 Utils::invariant($parentType);
                 return new Error(Messages::unknownArgMessage($node->name->value, $fieldDef->name, $parentType->name), [$node]);
             }
         }
     }];
 }
예제 #2
0
 private function unknownArg($argName, $fieldName, $typeName, $line, $column)
 {
     return new FormattedError(Messages::unknownArgMessage($argName, $fieldName, $typeName), [new SourceLocation($line, $column)]);
 }