BuildClientSchema
in package
Table of Contents
- $introspection : array<string, array<string|int, mixed>>
- $options : array<string, bool>
- $typeMap : array<string, \GraphQL\Type\Definition\NamedType&\GraphQL\Type\Definition\Type>
- __construct() : mixed
- build() : Schema
- Build a schema for use by client tools.
- buildDirective() : Directive
- buildInputValue() : array<string, mixed>
- buildSchema() : Schema
- getInterfaceType() : InterfaceType
- buildEnumDef() : EnumType
- buildFieldDefMap() : mixed
- buildImplementationsList() : array<int, InterfaceType>
- buildInputObjectDef() : InputObjectType
- buildInputValueDefMap() : array<string, array<string, mixed>>
- buildInterfaceDef() : InterfaceType
- buildObjectDef() : ObjectType
- buildScalarDef() : ScalarType
- buildType() : NamedType
- buildUnionDef() : UnionType
- getInputType() : InputType
- getNamedType() : NamedType|Type
- getObjectType() : ObjectType
- getOutputType() : OutputType
- getType() : Type
Properties
$introspection
private
array<string, array<string|int, mixed>>
$introspection
$options
private
array<string, bool>
$options
$typeMap
private
array<string, \GraphQL\Type\Definition\NamedType&\GraphQL\Type\Definition\Type>
$typeMap
Methods
__construct()
public
__construct(array<string, array<string|int, mixed>> $introspectionQuery[, array<string, bool> $options = [] ]) : mixed
Parameters
- $introspectionQuery : array<string, array<string|int, mixed>>
- $options : array<string, bool> = []
Return values
mixed —build()
Build a schema for use by client tools.
public
static build(array<string, array<string|int, mixed>> $introspectionQuery[, array<string, bool> $options = [] ]) : Schema
Given the result of a client running the introspection query, creates and returns a \GraphQL\Type\Schema instance which can be then used with all graphql-php tools, but cannot be used to execute a query, as introspection does not represent the "resolver", "parse" or "serialize" functions or any other server-internal mechanisms.
This function expects a complete introspection result. Don't forget to check the "errors" field of a server response before calling this function.
Accepts options as a third argument:
-
assumeValid: When building a schema from a GraphQL service's introspection result, it might be safe to assume the schema is valid. Set to true to assume the produced schema is valid.
Default: false
Parameters
- $introspectionQuery : array<string, array<string|int, mixed>>
- $options : array<string, bool> = []
Return values
Schema —buildDirective()
public
buildDirective(array<string, mixed> $directive) : Directive
Parameters
- $directive : array<string, mixed>
Return values
Directive —buildInputValue()
public
buildInputValue(array<string, mixed> $inputValueIntrospection) : array<string, mixed>
Parameters
- $inputValueIntrospection : array<string, mixed>
Return values
array<string, mixed> —buildSchema()
public
buildSchema() : Schema
Return values
Schema —getInterfaceType()
public
getInterfaceType(array<string, mixed> $typeRef) : InterfaceType
Parameters
- $typeRef : array<string, mixed>
Return values
InterfaceType —buildEnumDef()
private
buildEnumDef(array<string, string|array> $enum) : EnumType
Parameters
-
$enum
: array<string, string|array
>
Return values
EnumType —buildFieldDefMap()
private
buildFieldDefMap(array<string, mixed> $typeIntrospection) : mixed
Parameters
- $typeIntrospection : array<string, mixed>
Return values
mixed —buildImplementationsList()
private
buildImplementationsList(array<string, mixed> $implementingIntrospection) : array<int, InterfaceType>
Parameters
- $implementingIntrospection : array<string, mixed>
Return values
array<int, InterfaceType> —buildInputObjectDef()
private
buildInputObjectDef(array<string, mixed> $inputObject) : InputObjectType
Parameters
- $inputObject : array<string, mixed>
Return values
InputObjectType —buildInputValueDefMap()
private
buildInputValueDefMap(array<int, array<string, mixed>> $inputValueIntrospections) : array<string, array<string, mixed>>
Parameters
- $inputValueIntrospections : array<int, array<string, mixed>>
Return values
array<string, array<string, mixed>> —buildInterfaceDef()
private
buildInterfaceDef(array<string, mixed> $interface) : InterfaceType
Parameters
- $interface : array<string, mixed>
Return values
InterfaceType —buildObjectDef()
private
buildObjectDef(array<string, mixed> $object) : ObjectType
Parameters
- $object : array<string, mixed>
Return values
ObjectType —buildScalarDef()
private
buildScalarDef(array<string, string> $scalar) : ScalarType
Parameters
- $scalar : array<string, string>
Return values
ScalarType —buildType()
private
buildType(array<string, mixed> $type) : NamedType
Parameters
- $type : array<string, mixed>
Return values
NamedType —buildUnionDef()
private
buildUnionDef(array<string, string|string[]> $union) : UnionType
Parameters
- $union : array<string, string|string[]>
Return values
UnionType —getInputType()
private
getInputType(array<string, mixed> $typeRef) : InputType
Parameters
- $typeRef : array<string, mixed>
Return values
InputType —getNamedType()
private
getNamedType(string $typeName) : NamedType|Type
Parameters
- $typeName : string
Return values
NamedType|Type —getObjectType()
private
getObjectType(array<string, mixed> $typeRef) : ObjectType
Parameters
- $typeRef : array<string, mixed>
Return values
ObjectType —getOutputType()
private
getOutputType(array<string, mixed> $typeRef) : OutputType
Parameters
- $typeRef : array<string, mixed>
Return values
OutputType —getType()
private
getType(array<string, mixed> $typeRef) : Type
Parameters
- $typeRef : array<string, mixed>