WooCommerce Code Reference

SchemaPrinter
in package

Prints the contents of a Schema in schema definition language.

All sorting options sort alphabetically. If not given or false, the original schema definition order will be used.

Tags
phpstan-type

Options array{ sortArguments?: bool, sortEnumValues?: bool, sortFields?: bool, sortInputFields?: bool, sortTypes?: bool, }

see
SchemaPrinterTest

Table of Contents

doPrint()  : string
printIntrospectionSchema()  : string
printType()  : string
hasDefaultRootOperationTypes()  : bool
Automattic\WooCommerce\Vendor\GraphQL schema define root types for each type of operation. These types are the same as any other type and can be named in any manner, however there is a common naming convention:.
printArgs()  : string
printBlock()  : string
printDeprecated()  : string
printDescription()  : string
printDirective()  : string
printEnum()  : string
printFields()  : string
printFilteredSchema()  : string
printImplementedInterfaces()  : string
printInputObject()  : string
printInputValue()  : string
printInterface()  : string
printObject()  : string
printScalar()  : string
printSchemaDefinition()  : string|null
printUnion()  : string

Methods

hasDefaultRootOperationTypes()

Automattic\WooCommerce\Vendor\GraphQL schema define root types for each type of operation. These types are the same as any other type and can be named in any manner, however there is a common naming convention:.

protected static hasDefaultRootOperationTypes(Schema $schema) : bool
  schema {
    query: Query
    mutation: Mutation
    subscription: Subscription
  }

When using this naming convention, the schema description can be omitted. When using this naming convention, the schema description can be omitted so long as these names are only used for operation types.

Note however that if any of these default names are used elsewhere in the schema but not as a root operation type, the schema definition must still be printed to avoid ambiguity.

Parameters
$schema : Schema
Tags
throws
InvariantViolation
Return values
bool

printDescription()

protected static printDescription(array<string, bool> $options, (\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\NamedType)|Directive|EnumValueDefinition|Argument|FieldDefinition|InputObjectField|Schema $def[, string $indentation = '' ][, bool $firstInBlock = true ]) : string
Parameters
$options : array<string, bool>
$def : (\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\NamedType)|Directive|EnumValueDefinition|Argument|FieldDefinition|InputObjectField|Schema
$indentation : string = ''
$firstInBlock : bool = true
Tags
throws
JsonException
Return values
string