WooCommerce Code Reference

FieldDefinition
in package

Tags
see
Executor
phpstan-import-type

FieldResolver from Executor

phpstan-import-type

ArgsMapper from Executor

phpstan-import-type

ArgumentListConfig from Argument

phpstan-type

FieldType (Type&OutputType)|callable(): (Type&OutputType)

phpstan-type

ComplexityFn callable(int, array<string, mixed>): int

phpstan-type

VisibilityFn callable(): bool

phpstan-type

FieldDefinitionConfig array{ name: string, type: FieldType, resolve?: FieldResolver|null, args?: ArgumentListConfig|null, argsMapper?: ArgsMapper|null, description?: string|null, visible?: VisibilityFn|bool, deprecationReason?: string|null, astNode?: FieldDefinitionNode|null, complexity?: ComplexityFn|null }

phpstan-type

UnnamedFieldDefinitionConfig array{ type: FieldType, resolve?: FieldResolver|null, args?: ArgumentListConfig|null, argsMapper?: ArgsMapper|null, description?: string|null, visible?: VisibilityFn|bool, deprecationReason?: string|null, astNode?: FieldDefinitionNode|null, complexity?: ComplexityFn|null }

phpstan-type

FieldsConfig iterable|callable(): iterable

Table of Contents

$args  : array<string|int, mixed>
$argsMapper  : callable|null
Callback to transform args to value object.
$astNode  : FieldDefinitionNode|null
$complexityFn  : callable|null
$config  : array<string|int, mixed>
Original field definition config.
$deprecationReason  : string|null
$description  : string|null
$name  : string
$resolveFn  : callable|null
Callback for resolving field value given parent value.
$visible  : callable|bool
$type  : Type
__construct()  : mixed
assertValid()  : void
defineFieldMap()  : array<string, self|\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\UnresolvedFieldDefinition>
getArg()  : Argument|null
getName()  : string
getType()  : Type|OutputType
isDeprecated()  : bool
isVisible()  : bool

Properties

Methods

defineFieldMap()

public static defineFieldMap(ObjectType|InterfaceType $parentType, callable|iteratable<string|int, mixed> $fields) : array<string, self|\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\UnresolvedFieldDefinition>
Parameters
$parentType : ObjectType|InterfaceType
$fields : callable|iteratable<string|int, mixed>
Tags
phpstan-param

FieldsConfig $fields

throws
InvariantViolation
Return values
array<string, self|\Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\UnresolvedFieldDefinition>