Skip to content

Latest commit

 

History

History
714 lines (254 loc) · 6.43 KB

File metadata and controls

714 lines (254 loc) · 6.43 KB

Type

Registry of standard GraphQL types and a base class for all other types.

  • Full name: \GraphQL\Type\Definition\Type
  • This class implements: \JsonSerializable
  • This class is an Abstract class

Constants

Constant Visibility Type Value
STRING public 'String'
INT public 'Int'
BOOLEAN public 'Boolean'
FLOAT public 'Float'
ID public 'ID'

Properties

standardTypes

protected static array<string,\GraphQL\Type\Definition\ScalarType> $standardTypes
  • This property is static.

builtInTypes

private static \GraphQL\Type\Definition\Type[] $builtInTypes
  • This property is static.

name

public string $name

description

public string|null $description

astNode

public \GraphQL\Language\AST\TypeDefinitionNode|null $astNode

config

public array $config

extensionASTNodes

public \GraphQL\Language\AST\TypeExtensionNode[] $extensionASTNodes

Methods

id

public static id(): \GraphQL\Type\Definition\ScalarType
  • This method is static.

string

public static string(): \GraphQL\Type\Definition\ScalarType
  • This method is static.

boolean

public static boolean(): \GraphQL\Type\Definition\ScalarType
  • This method is static.

int

public static int(): \GraphQL\Type\Definition\ScalarType
  • This method is static.

float

public static float(): \GraphQL\Type\Definition\ScalarType
  • This method is static.

listOf

public static listOf(\GraphQL\Type\Definition\Type $wrappedType): \GraphQL\Type\Definition\ListOfType
  • This method is static.

Parameters:

Parameter Type Description
$wrappedType \GraphQL\Type\Definition\Type

nonNull

public static nonNull(callable|\GraphQL\Type\Definition\NullableType $wrappedType): \GraphQL\Type\Definition\NonNull
  • This method is static.

Parameters:

Parameter Type Description
$wrappedType callable|\GraphQL\Type\Definition\NullableType

isBuiltInType

Checks if the type is a builtin type

public static isBuiltInType(\GraphQL\Type\Definition\Type $type): bool
  • This method is static.

Parameters:

Parameter Type Description
$type \GraphQL\Type\Definition\Type

getAllBuiltInTypes

Returns all builtin in types including base scalar and introspection types

public static getAllBuiltInTypes(): \GraphQL\Type\Definition\Type[]
  • This method is static.

getStandardTypes

Returns all builtin scalar types

public static getStandardTypes(): \GraphQL\Type\Definition\ScalarType[]
  • This method is static.

getInternalTypes

public static getInternalTypes(): \GraphQL\Type\Definition\Type[]
  • This method is static.

  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.


overrideStandardTypes

public static overrideStandardTypes(array<string,\GraphQL\Type\Definition\ScalarType> $types): mixed
  • This method is static.

Parameters:

Parameter Type Description
$types array<string,\GraphQL\Type\Definition\ScalarType>

isInputType

public static isInputType(\GraphQL\Type\Definition\Type $type): bool
  • This method is static.

Parameters:

Parameter Type Description
$type \GraphQL\Type\Definition\Type

getNamedType

public static getNamedType(\GraphQL\Type\Definition\Type $type): ?\GraphQL\Type\Definition\Type
  • This method is static.

Parameters:

Parameter Type Description
$type \GraphQL\Type\Definition\Type

isOutputType

public static isOutputType(\GraphQL\Type\Definition\Type $type): bool
  • This method is static.

Parameters:

Parameter Type Description
$type \GraphQL\Type\Definition\Type

isLeafType

public static isLeafType(\GraphQL\Type\Definition\Type $type): bool
  • This method is static.

Parameters:

Parameter Type Description
$type \GraphQL\Type\Definition\Type

isCompositeType

public static isCompositeType(\GraphQL\Type\Definition\Type $type): bool
  • This method is static.

Parameters:

Parameter Type Description
$type \GraphQL\Type\Definition\Type

isAbstractType

public static isAbstractType(\GraphQL\Type\Definition\Type $type): bool
  • This method is static.

Parameters:

Parameter Type Description
$type \GraphQL\Type\Definition\Type

assertType

public static assertType(mixed $type): \GraphQL\Type\Definition\Type
  • This method is static.

Parameters:

Parameter Type Description
$type mixed

getNullableType

public static getNullableType(\GraphQL\Type\Definition\Type $type): \GraphQL\Type\Definition\Type
  • This method is static.

Parameters:

Parameter Type Description
$type \GraphQL\Type\Definition\Type

assertValid

public assertValid(): mixed

jsonSerialize

public jsonSerialize(): string

toString

public toString(): string

__toString

public __toString(): string

tryInferName

protected tryInferName(): string|null