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
Constant | Visibility | Type | Value |
---|---|---|---|
STRING |
public | 'String' | |
INT |
public | 'Int' | |
BOOLEAN |
public | 'Boolean' | |
FLOAT |
public | 'Float' | |
ID |
public | 'ID' |
protected static array<string,\GraphQL\Type\Definition\ScalarType> $standardTypes
- This property is static.
private static \GraphQL\Type\Definition\Type[] $builtInTypes
- This property is static.
public string $name
public string|null $description
public \GraphQL\Language\AST\TypeDefinitionNode|null $astNode
public array $config
public \GraphQL\Language\AST\TypeExtensionNode[] $extensionASTNodes
public static id(): \GraphQL\Type\Definition\ScalarType
- This method is static.
public static string(): \GraphQL\Type\Definition\ScalarType
- This method is static.
public static boolean(): \GraphQL\Type\Definition\ScalarType
- This method is static.
public static int(): \GraphQL\Type\Definition\ScalarType
- This method is static.
public static float(): \GraphQL\Type\Definition\ScalarType
- This method is static.
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 |
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 |
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 |
Returns all builtin in types including base scalar and introspection types
public static getAllBuiltInTypes(): \GraphQL\Type\Definition\Type[]
- This method is static.
Returns all builtin scalar types
public static getStandardTypes(): \GraphQL\Type\Definition\ScalarType[]
- This method is static.
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.
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> |
public static isInputType(\GraphQL\Type\Definition\Type $type): bool
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$type |
\GraphQL\Type\Definition\Type |
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 |
public static isOutputType(\GraphQL\Type\Definition\Type $type): bool
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$type |
\GraphQL\Type\Definition\Type |
public static isLeafType(\GraphQL\Type\Definition\Type $type): bool
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$type |
\GraphQL\Type\Definition\Type |
public static isCompositeType(\GraphQL\Type\Definition\Type $type): bool
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$type |
\GraphQL\Type\Definition\Type |
public static isAbstractType(\GraphQL\Type\Definition\Type $type): bool
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$type |
\GraphQL\Type\Definition\Type |
public static assertType(mixed $type): \GraphQL\Type\Definition\Type
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$type |
mixed |
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 |
public assertValid(): mixed
public jsonSerialize(): string
public toString(): string
public __toString(): string
protected tryInferName(): string|null