Automattic\WooCommerce\Vendor\GraphQL\Utils
BuildSchema::buildAST
This takes the AST of a schema from @see \Automattic\WooCommerce\Vendor\GraphQL\Language[Parser::parse()](/plugin/woocommerce/function/Parser::parse).
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.
Method of the class: BuildSchema{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = BuildSchema::buildAST( $ast, ?callable $typeConfigDecorator, $options, ?callable $fieldConfigDecorator ): Schema;
- $ast(DocumentNode) (required)
- .
- ?callable $typeConfigDecorator
- .
Default:null - $options(array)
- .
Default:[] - ?callable $fieldConfigDecorator
- .
Default:null
BuildSchema::buildAST() BuildSchema::buildAST code WC 10.9.1
public static function buildAST(
DocumentNode $ast,
?callable $typeConfigDecorator = null,
array $options = [],
?callable $fieldConfigDecorator = null
): Schema {
return (new self($ast, $typeConfigDecorator, $options, $fieldConfigDecorator))->buildSchema();
}