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

isScalarType() public static method

public static isScalarType ( $type )
    public static function isScalarType($type)
    {
        if (is_object($type)) {
            return $type instanceof AbstractScalarType || $type instanceof AbstractEnumType;
        }
        return in_array(strtolower($type), TypeFactory::getScalarTypesNames());
    }

Usage Example

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::isScalarType