BuildSchema
in package
Build instance of @see \Automattic\WooCommerce\Vendor\GraphQL\Type\Schema out of schema language definition (string or parsed AST).
See schema definition language docs for details.
Tags
Table of Contents
- $ast : DocumentNode
- $fieldConfigDecorator : callable|null
- $options : array<string|int, mixed>
- $typeConfigDecorator : callable|null
- __construct() : mixed
- build() : Schema
- A helper function to build a GraphQLSchema directly from a source document.
- buildAST() : Schema
- This takes the AST of a schema from @see \Automattic\WooCommerce\Vendor\GraphQL\Language\Parser::parse().
- buildSchema() : Schema
- unknownType() : Error
- getOperationTypes() : array<string, string>
Properties
$ast
private
DocumentNode
$ast
$fieldConfigDecorator
private
callable|null
$fieldConfigDecorator
Tags
$options
private
array<string|int, mixed>
$options
Tags
$typeConfigDecorator
private
callable|null
$typeConfigDecorator
Tags
Methods
__construct()
public
__construct(DocumentNode $ast[, callable|null $typeConfigDecorator = null ][, array<string, bool> $options = [] ][, callable|null $fieldConfigDecorator = null ]) : mixed
Parameters
- $ast : DocumentNode
- $typeConfigDecorator : callable|null = null
- $options : array<string, bool> = []
- $fieldConfigDecorator : callable|null = null
Tags
Return values
mixed —build()
A helper function to build a GraphQLSchema directly from a source document.
public
static build(DocumentNode|Source|string $source[, callable|null $typeConfigDecorator = null ][, array<string, bool> $options = [] ][, callable|null $fieldConfigDecorator = null ]) : Schema
Parameters
- $source : DocumentNode|Source|string
- $typeConfigDecorator : callable|null = null
- $options : array<string, bool> = []
- $fieldConfigDecorator : callable|null = null
Tags
Return values
Schema —buildAST()
This takes the AST of a schema from @see \Automattic\WooCommerce\Vendor\GraphQL\Language\Parser::parse().
public
static buildAST(DocumentNode $ast[, callable|null $typeConfigDecorator = null ][, array<string, bool> $options = [] ][, callable|null $fieldConfigDecorator = null ]) : Schema
If no schema definition is provided, then it will look for types named Query and Mutation.
Given that AST it constructs a @see \Automattic\WooCommerce\Vendor\GraphQL\Type\Schema. The resulting schema has no resolve methods, so execution will use default resolvers.
Parameters
- $ast : DocumentNode
- $typeConfigDecorator : callable|null = null
- $options : array<string, bool> = []
- $fieldConfigDecorator : callable|null = null
Tags
Return values
Schema —buildSchema()
public
buildSchema() : Schema
Tags
Return values
Schema —unknownType()
public
static unknownType(string $typeName) : Error
Parameters
- $typeName : string
Return values
Error —getOperationTypes()
private
getOperationTypes(SchemaDefinitionNode $schemaDef) : array<string, string>
Parameters
- $schemaDef : SchemaDefinitionNode
