GraphQL\Validator\Rules\FragmentsOnCompositeTypes::inlineFragmentOnNonCompositeErrorMessage PHP Method

inlineFragmentOnNonCompositeErrorMessage() static public method

    static function inlineFragmentOnNonCompositeErrorMessage($type)
    {
        return "Fragment cannot condition on non composite type \"{$type}\".";
    }

Usage Example

 public function testScalarIsInvalidInlineFragmentType()
 {
     $this->expectFailsRule(new FragmentsOnCompositeTypes(), '
   fragment invalidFragment on Pet {
     ... on String {
       barks
     }
   }
     ', [FormattedError::create(FragmentsOnCompositeTypes::inlineFragmentOnNonCompositeErrorMessage('String'), [new SourceLocation(3, 16)])]);
 }