Youshido\GraphQL\Type\TypeService::isGraphQLType PHP Method

isGraphQLType() public static method

public static isGraphQLType ( $type )
    public static function isGraphQLType($type)
    {
        return $type instanceof AbstractType || TypeService::isScalarType($type);
    }

Usage Example

示例#1
0
 /**
  * NonNullType constructor.
  *
  * @param AbstractType|string $fieldType
  *
  * @throws ConfigurationException
  */
 public function __construct($fieldType)
 {
     if (!TypeService::isGraphQLType($fieldType)) {
         throw new ConfigurationException('NonNullType accepts only GraphpQL Types as argument');
     }
     if (TypeService::isScalarType($fieldType)) {
         $fieldType = TypeFactory::getScalarType($fieldType);
     }
     $this->_typeOf = $fieldType;
 }
All Usage Examples Of Youshido\GraphQL\Type\TypeService::isGraphQLType