Automattic\WooCommerce\Vendor\GraphQL\Utils

SchemaExtender::extendObjectTypeprotectedWC 1.0

Method of the class: SchemaExtender{}

No Hooks.

Returns

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->extendObjectType( $type ): ObjectType;
$type(ObjectType) (required)
.

SchemaExtender::extendObjectType() code WC 10.9.1

protected function extendObjectType(ObjectType $type): ObjectType
{
    /** @var array<ObjectTypeExtensionNode> $extensionASTNodes */
    $extensionASTNodes = $this->extensionASTNodes($type);

    return new ObjectType([
        'name' => $type->name,
        'description' => $type->description,
        'interfaces' => fn (): array => $this->extendImplementedInterfaces($type),
        'fields' => fn (): array => $this->extendFieldMap($type),
        'isTypeOf' => [$type, 'isTypeOf'],
        'resolveField' => $type->resolveFieldFn,
        'argsMapper' => $type->argsMapper,
        'astNode' => $type->astNode,
        'extensionASTNodes' => $extensionASTNodes,
    ]);
}