TypeDef
class TypeDef extends AbstractObject implements IdAble
A definition of a parameter or return type in a Module.
Properties
$lastQuery | from AbstractObject |
Methods
No description
If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
A unique identifier for this TypeDef.
The kind of type this is (e.g. primitive, list, object).
Whether this type can be set to null. Defaults to false.
Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
Returns a TypeDef of kind Enum with the provided name.
Adds a static value for an Enum TypeDef, failing if the type is not an enum.
Adds a static field for an Object TypeDef, failing if the type is not an object.
Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
Returns a TypeDef of kind Interface with the provided name.
Returns a TypeDef of kind List with the provided type for its elements.
Returns a TypeDef of kind Object with the provided name.
Sets whether this type can be set to null.
Returns a TypeDef of kind Scalar with the provided name.
Details
in
AbstractObject at line 13
__construct(AbstractClient $client, QueryBuilderChain $queryBuilderChain)
No description
in
AbstractObject at line 19
protected null|array|string|int|float|bool
queryLeaf(QueryBuilder $leafQueryBuilder, string $leafKey)
No description
at line 19
EnumTypeDef
asEnum()
If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
at line 28
InputTypeDef
asInput()
If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
at line 37
InterfaceTypeDef
asInterface()
If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
at line 46
ListTypeDef
asList()
If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
at line 55
ObjectTypeDef
asObject()
If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
at line 64
ScalarTypeDef
asScalar()
If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
at line 73
AbstractId
id()
A unique identifier for this TypeDef.
at line 82
TypeDefKind
kind()
The kind of type this is (e.g. primitive, list, object).
at line 91
bool
optional()
Whether this type can be set to null. Defaults to false.
at line 100
TypeDef
withConstructor(Function_ $function)
Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
at line 112
TypeDef
withEnum(string $name, string|null $description = '', SourceMap|null $sourceMap = null)
Returns a TypeDef of kind Enum with the provided name.
Note that an enum's values may be omitted if the intent is only to refer to an enum. This is how functions are able to return their own, or any other circular reference.
at line 131
TypeDef
withEnumValue(string $value, string|null $description = '', SourceMap|null $sourceMap = null)
Adds a static value for an Enum TypeDef, failing if the type is not an enum.
at line 150
TypeDef
withField(string $name, TypeDef $typeDef, string|null $description = '', SourceMap|null $sourceMap = null)
Adds a static field for an Object TypeDef, failing if the type is not an object.
at line 171
TypeDef
withFunction(Function_ $function)
Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
at line 181
TypeDef
withInterface(string $name, string|null $description = '', SourceMap|null $sourceMap = null)
Returns a TypeDef of kind Interface with the provided name.
at line 200
TypeDef
withKind(TypeDefKind $kind)
Sets the kind of the type.
at line 210
TypeDef
withListOf(TypeDef $elementType)
Returns a TypeDef of kind List with the provided type for its elements.
at line 222
TypeDef
withObject(string $name, string|null $description = '', SourceMap|null $sourceMap = null)
Returns a TypeDef of kind Object with the provided name.
Note that an object's fields and functions may be omitted if the intent is only to refer to an object. This is how functions are able to return their own object, or any other circular reference.
at line 241
TypeDef
withOptional(bool $optional)
Sets whether this type can be set to null.
at line 251
TypeDef
withScalar(string $name, string|null $description = '')
Returns a TypeDef of kind Scalar with the provided name.