WooCommerce Code Reference

ReturnType
in package

Declares the GraphQL return type of execute() when it returns an interface.

Since PHP cannot type-hint a trait, the execute() method uses object as its return type and this attribute tells the builder which interface type to use in the schema. The GraphQL engine then uses the interface's resolveType callback to determine the concrete type at runtime.

Table of Contents

__construct()  : mixed
Constructor.

Methods

__construct()

Constructor.

public __construct(string $type) : mixed
Parameters
$type : string

The fully-qualified class name of the interface trait (e.g. ApiObject::class).

Return values
mixed