BuildClientSchema
in package
Tags
Table of Contents
- $introspection : array<string|int, mixed>
- $options : array<string|int, mixed>
- $typeMap : array<string|int, mixed>
- __construct() : mixed
- build() : Schema
- Build a schema for use by client tools.
- buildDirective() : Directive
- buildInputValue() : UnnamedInputObjectFieldConfig
- buildSchema() : Schema
- getInterfaceType() : InterfaceType
- invalidOrIncompleteIntrospectionResult() : InvariantViolation
- buildEnumDef() : EnumType
- buildFieldDefMap() : array<string, UnnamedFieldDefinitionConfig>
- buildImplementationsList() : array<int, InterfaceType>
- buildInputObjectDef() : InputObjectType
- buildInputValueDefMap() : array<string, UnnamedInputObjectFieldConfig>
- buildInterfaceDef() : InterfaceType
- buildObjectDef() : ObjectType
- buildScalarDef() : ScalarType
- buildType() : Type|NamedType
- buildUnionDef() : UnionType
- getInputType() : Type|InputType
- getNamedType() : NamedType|Type
- getObjectType() : ObjectType
- getOutputType() : OutputType
- getType() : Type
Properties
$introspection
private
array<string|int, mixed>
$introspection
$options
private
array<string|int, mixed>
$options
Tags
$typeMap
private
array<string|int, mixed>
$typeMap
= []
Methods
__construct()
public
__construct(array<string, mixed> $introspectionQuery[, array<string, bool> $options = [] ]) : mixed
Parameters
- $introspectionQuery : array<string, mixed>
- $options : array<string, bool> = []
Tags
Return values
mixed —build()
Build a schema for use by client tools.
public
static build(array<string, mixed> $introspectionQuery[, array<string, bool> $options = [] ]) : Schema
Given the result of a client running the introspection query, creates and returns a \Automattic\WooCommerce\Vendor\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.
Parameters
- $introspectionQuery : array<string, mixed>
- $options : array<string, bool> = []
Tags
Return values
Schema —buildDirective()
public
buildDirective(array<string, mixed> $directive) : Directive
Parameters
- $directive : array<string, mixed>
Tags
Return values
Directive —buildInputValue()
public
buildInputValue(array<string, mixed> $inputValueIntrospection) : UnnamedInputObjectFieldConfig
Parameters
- $inputValueIntrospection : array<string, mixed>
Tags
Return values
UnnamedInputObjectFieldConfig —buildSchema()
public
buildSchema() : Schema
Tags
Return values
Schema —getInterfaceType()
public
getInterfaceType(array<string, mixed> $typeRef) : InterfaceType
Parameters
- $typeRef : array<string, mixed>
Tags
Return values
InterfaceType —invalidOrIncompleteIntrospectionResult()
public
static invalidOrIncompleteIntrospectionResult(array<string|int, mixed> $type) : InvariantViolation
Parameters
- $type : array<string|int, mixed>
Return values
InvariantViolation —buildEnumDef()
private
buildEnumDef(array<string, mixed> $enum) : EnumType
Parameters
- $enum : array<string, mixed>
Tags
Return values
EnumType —buildFieldDefMap()
private
buildFieldDefMap(array<string, mixed> $typeIntrospection) : array<string, UnnamedFieldDefinitionConfig>
Parameters
- $typeIntrospection : array<string, mixed>
Tags
Return values
array<string, UnnamedFieldDefinitionConfig> —buildImplementationsList()
private
buildImplementationsList(array<string, mixed> $implementingIntrospection) : array<int, InterfaceType>
Parameters
- $implementingIntrospection : array<string, mixed>
Tags
Return values
array<int, InterfaceType> —buildInputObjectDef()
private
buildInputObjectDef(array<string, mixed> $inputObject) : InputObjectType
Parameters
- $inputObject : array<string, mixed>
Tags
Return values
InputObjectType —buildInputValueDefMap()
private
buildInputValueDefMap(array<int, array<string, mixed>> $inputValueIntrospections) : array<string, UnnamedInputObjectFieldConfig>
Parameters
- $inputValueIntrospections : array<int, array<string, mixed>>
Tags
Return values
array<string, UnnamedInputObjectFieldConfig> —buildInterfaceDef()
private
buildInterfaceDef(array<string, mixed> $interface) : InterfaceType
Parameters
- $interface : array<string, mixed>
Tags
Return values
InterfaceType —buildObjectDef()
private
buildObjectDef(array<string, mixed> $object) : ObjectType
Parameters
- $object : array<string, mixed>
Tags
Return values
ObjectType —buildScalarDef()
private
buildScalarDef(array<string, string> $scalar) : ScalarType
Parameters
- $scalar : array<string, string>
Tags
Return values
ScalarType —buildType()
private
buildType(array<string, mixed> $type) : Type|NamedType
Parameters
- $type : array<string, mixed>
Tags
Return values
Type|NamedType —buildUnionDef()
private
buildUnionDef(array<string, mixed> $union) : UnionType
Parameters
- $union : array<string, mixed>
Tags
Return values
UnionType —getInputType()
private
getInputType(array<string, mixed> $typeRef) : Type|InputType
Parameters
- $typeRef : array<string, mixed>
Tags
Return values
Type|InputType —getNamedType()
private
getNamedType(string $typeName) : NamedType|Type
Parameters
- $typeName : string
Tags
Return values
NamedType|Type —getObjectType()
private
getObjectType(array<string, mixed> $typeRef) : ObjectType
Parameters
- $typeRef : array<string, mixed>
Tags
Return values
ObjectType —getOutputType()
private
getOutputType(array<string, mixed> $typeRef) : OutputType
Parameters
- $typeRef : array<string, mixed>
Tags
Return values
OutputType —getType()
private
getType(array<string, mixed> $typeRef) : Type
Parameters
- $typeRef : array<string, mixed>
