GraphQL\Type\Definition\Type::isCompositeType PHP Метод

isCompositeType() публичный статический Метод

public static isCompositeType ( $type ) : boolean
$type
Результат boolean
    public static function isCompositeType($type)
    {
        return $type instanceof CompositeType;
    }

Usage Example

Пример #1
0
 public function __invoke(ValidationContext $context)
 {
     return [Node::INLINE_FRAGMENT => function (InlineFragment $node) use($context) {
         $type = $context->getType();
         if ($node->typeCondition && $type && !Type::isCompositeType($type)) {
             $context->reportError(new Error(static::inlineFragmentOnNonCompositeErrorMessage($type), [$node->typeCondition]));
         }
     }, Node::FRAGMENT_DEFINITION => function (FragmentDefinition $node) use($context) {
         $type = $context->getType();
         if ($type && !Type::isCompositeType($type)) {
             $context->reportError(new Error(static::fragmentOnNonCompositeErrorMessage($node->name->value, Printer::doPrint($node->typeCondition)), [$node->typeCondition]));
         }
     }];
 }
All Usage Examples Of GraphQL\Type\Definition\Type::isCompositeType