GraphQL\Validator\Messages::nonInputTypeOnVarMessage PHP Method

nonInputTypeOnVarMessage() static public method

static public nonInputTypeOnVarMessage ( $variableName, $typeName )
    static function nonInputTypeOnVarMessage($variableName, $typeName)
    {
        return "Variable \${$variableName} cannot be non input type {$typeName}.";
    }

Usage Example

 public function testOutputTypesAreInvalid()
 {
     $this->expectFailsRule(new VariablesAreInputTypes(), '
   query Foo($a: Dog, $b: [[DogOrCat!]]!, $c: Pet) {
     field(a: $a, b: $b, c: $c)
   }
     ', [new FormattedError(Messages::nonInputTypeOnVarMessage('a', 'Dog'), [new SourceLocation(2, 21)]), new FormattedError(Messages::nonInputTypeOnVarMessage('b', '[[DogOrCat!]]!'), [new SourceLocation(2, 30)]), new FormattedError(Messages::nonInputTypeOnVarMessage('c', 'Pet'), [new SourceLocation(2, 50)])]);
 }
All Usage Examples Of GraphQL\Validator\Messages::nonInputTypeOnVarMessage