Documentation

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

$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

buildInputValue()

public buildInputValue(array<string, mixed> $inputValueIntrospection) : array<string, mixed>
Parameters
$inputValueIntrospection : array<string, mixed>
Return values
array<string, mixed>

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>

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>>

buildUnionDef()

private buildUnionDef(array<string, string|string[]> $union) : UnionType
Parameters
$union : array<string, string|string[]>
Return values
UnionType

getType()

private getType(array<string, mixed> $typeRef) : Type
Parameters
$typeRef : array<string, mixed>
Return values
Type

Search results