GraphQL\Validator\Rules\ProvidedNonNullArguments::missingFieldArgMessage PHP Method

missingFieldArgMessage() static public method

static public missingFieldArgMessage ( $fieldName, $argName, $type )
    static function missingFieldArgMessage($fieldName, $argName, $type)
    {
        return "Field \"{$fieldName}\" argument \"{$argName}\" of type \"{$type}\" is required but not provided.";
    }

Usage Example

Example #1
0
 /**
  * @it fails as expected on the __type root field without an arg
  */
 public function testFailsAsExpectedOnThe__typeRootFieldWithoutAnArg()
 {
     $TestType = new ObjectType(['name' => 'TestType', 'fields' => ['testField' => ['type' => Type::string()]]]);
     $schema = new Schema(['query' => $TestType]);
     $request = '
   {
     __type {
       name
     }
   }
 ';
     $expected = ['errors' => [FormattedError::create(ProvidedNonNullArguments::missingFieldArgMessage('__type', 'name', 'String!'), [new SourceLocation(3, 9)])]];
     $this->assertEquals($expected, GraphQL::execute($schema, $request));
 }
All Usage Examples Of GraphQL\Validator\Rules\ProvidedNonNullArguments::missingFieldArgMessage