WooCommerce Code Reference

Introspection
in package

Tags
phpstan-type

IntrospectionOptions array{ descriptions?: bool, directiveIsRepeatable?: bool, schemaDescription?: bool, typeIsOneOf?: bool, }

Available options:

  • descriptions Include descriptions in the introspection result? Default: true
  • directiveIsRepeatable Include field isRepeatable for directives? Default: false
  • typeIsOneOf Include field isOneOf for types? Default: false
see
IntrospectionTest

Table of Contents

DIRECTIVE_LOCATION_ENUM_NAME  = '__DirectiveLocation'
DIRECTIVE_OBJECT_NAME  = '__Directive'
ENUM_VALUE_OBJECT_NAME  = '__EnumValue'
FIELD_OBJECT_NAME  = '__Field'
INPUT_VALUE_OBJECT_NAME  = '__InputValue'
SCHEMA_FIELD_NAME  = '__schema'
SCHEMA_OBJECT_NAME  = '__Schema'
TYPE_FIELD_NAME  = '__type'
TYPE_KIND_ENUM_NAME  = '__TypeKind'
TYPE_NAME_FIELD_NAME  = '__typename'
TYPE_NAMES  = [self::SCHEMA_OBJECT_NAME, self::TYPE_OBJECT_NAME, self::DIRECTIVE_OBJECT_NAME, self::FIELD_OBJECT_NAME, self::INPUT_VALUE_OBJECT_NAME, self::ENUM_VALUE_OBJECT_NAME, self::TYPE_KIND_ENUM_NAME, self::DIRECTIVE_LOCATION_ENUM_NAME]
TYPE_OBJECT_NAME  = '__Type'
$cachedInstances  : array<string|int, mixed>|null
_directive()  : ObjectType
_directiveLocation()  : EnumType
_enumValue()  : ObjectType
_field()  : ObjectType
_inputValue()  : ObjectType
_schema()  : ObjectType
_type()  : ObjectType
_typeKind()  : EnumType
fromSchema()  : array<string, array<string|int, mixed>>
Build an introspection query from a Schema.
getIntrospectionQuery()  : string
getTypes()  : array<string, \Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\NamedType>
isIntrospectionType()  : bool
resetCachedInstances()  : void
schemaMetaFieldDef()  : FieldDefinition
typeMetaFieldDef()  : FieldDefinition
typeNameMetaFieldDef()  : FieldDefinition

Constants

TYPE_NAMES

public mixed TYPE_NAMES = [self::SCHEMA_OBJECT_NAME, self::TYPE_OBJECT_NAME, self::DIRECTIVE_OBJECT_NAME, self::FIELD_OBJECT_NAME, self::INPUT_VALUE_OBJECT_NAME, self::ENUM_VALUE_OBJECT_NAME, self::TYPE_KIND_ENUM_NAME, self::DIRECTIVE_LOCATION_ENUM_NAME]

Properties

Methods

fromSchema()

Build an introspection query from a Schema.

public static fromSchema(Schema $schema[, IntrospectionOptions $options = [] ]) : array<string, array<string|int, mixed>>

Introspection is useful for utilities that care about type and field relationships, but do not need to traverse through those relationships.

This is the inverse of BuildClientSchema::build(). The primary use case is outside the server context, for instance when doing schema comparisons.

Parameters
$schema : Schema
$options : IntrospectionOptions = []
Tags
throws
Exception
throws
JsonException
throws
InvariantViolation
Return values
array<string, array<string|int, mixed>>

getIntrospectionQuery()

public static getIntrospectionQuery([IntrospectionOptions $options = [] ]) : string
Parameters
$options : IntrospectionOptions = []
Return values
string

getTypes()

public static getTypes() : array<string, \Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\NamedType>
Return values
array<string, \Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\Type&\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\NamedType>