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
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
doPrint()
public
static doPrint(Schema $schema[, array<string, bool> $options = [] ]) : string
Parameters
- $schema : Schema
- $options : array<string, bool> = []
Tags
Return values
string —printIntrospectionSchema()
public
static printIntrospectionSchema(Schema $schema[, array<string, bool> $options = [] ]) : string
Parameters
- $schema : Schema
- $options : array<string, bool> = []
Tags
Return values
string —printType()
public
static printType(Type $type[, array<string, bool> $options = [] ]) : string
Parameters
- $type : Type
- $options : array<string, bool> = []
Tags
Return values
string —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
Return values
bool —printArgs()
protected
static printArgs(array<string, bool> $options, array<int, Argument> $args[, string $indentation = '' ]) : string
Parameters
- $options : array<string, bool>
- $args : array<int, Argument>
- $indentation : string = ''
Tags
Return values
string —printBlock()
protected
static printBlock(array<string|int, string> $items) : string
Parameters
- $items : array<string|int, string>
Return values
string —printDeprecated()
protected
static printDeprecated(FieldDefinition|EnumValueDefinition|InputObjectField|Argument $deprecation) : string
Parameters
- $deprecation : FieldDefinition|EnumValueDefinition|InputObjectField|Argument
Tags
Return values
string —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
Return values
string —printDirective()
protected
static printDirective(Directive $directive, array<string, bool> $options) : string
Parameters
- $directive : Directive
- $options : array<string, bool>
Tags
Return values
string —printEnum()
protected
static printEnum(EnumType $type, array<string, bool> $options) : string
Parameters
- $type : EnumType
- $options : array<string, bool>
Tags
Return values
string —printFields()
protected
static printFields(array<string, bool> $options, ObjectType|InterfaceType $type) : string
Parameters
- $options : array<string, bool>
- $type : ObjectType|InterfaceType
Tags
Return values
string —printFilteredSchema()
protected
static printFilteredSchema(Schema $schema, callable $directiveFilter, callable $typeFilter, array<string, bool> $options) : string
Parameters
- $schema : Schema
- $directiveFilter : callable
- $typeFilter : callable
- $options : array<string, bool>
Tags
Return values
string —printImplementedInterfaces()
protected
static printImplementedInterfaces(ImplementingType $type) : string
Parameters
- $type : ImplementingType
Return values
string —printInputObject()
protected
static printInputObject(InputObjectType $type, array<string, bool> $options) : string
Parameters
- $type : InputObjectType
- $options : array<string, bool>
Tags
Return values
string —printInputValue()
protected
static printInputValue(InputObjectField|Argument $arg) : string
Parameters
- $arg : InputObjectField|Argument
Tags
Return values
string —printInterface()
protected
static printInterface(InterfaceType $type, array<string, bool> $options) : string
Parameters
- $type : InterfaceType
- $options : array<string, bool>
Tags
Return values
string —printObject()
protected
static printObject(ObjectType $type, array<string, bool> $options) : string
Parameters
- $type : ObjectType
- $options : array<string, bool>
Tags
Return values
string —printScalar()
protected
static printScalar(ScalarType $type, array<string, bool> $options) : string
Parameters
- $type : ScalarType
- $options : array<string, bool>
Tags
Return values
string —printSchemaDefinition()
protected
static printSchemaDefinition(Schema $schema) : string|null
Parameters
- $schema : Schema
Tags
Return values
string|null —printUnion()
protected
static printUnion(UnionType $type, array<string, bool> $options) : string
Parameters
- $type : UnionType
- $options : array<string, bool>
