Automattic\WooCommerce\Api\Infrastructure\Schema
ObjectType{}
Stable subclass of the underlying GraphQL engine's ObjectType, used by autogenerated output types, pagination types and root Query/Mutation types.
The constructor accepts the same associative-array config the current engine (webonyx) documents (keys: name, description, fields, interfaces). The fields entry is either an array or a callable returning an array of field definitions.
The wrapper also recognises a metadata key — an associative array mapping metadata name => scalar value — that ApiBuilder emits for types carrying Metadata{} attributes. The engine ignores unknown config keys, so this rides through untouched and is surfaced by {@see self::get_metadata()}.
No Hooks.
Usage
$ObjectType = new ObjectType(); // use class methods
Methods
- public get_metadata()
- ERROR: no method name found on line ``
- ERROR: no method name found on line ``
- ERROR: no method name found on line ``
- ERROR: no method name found on line ``
- ERROR: no method name found on line ``
- ERROR: no method name found on line ``
ObjectType{} ObjectType{} code WC 10.9.1
class ObjectType extends \Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\ObjectType {
/**
* Type-level metadata entries declared in the config, keyed by name.
*
* @return array<string, bool|int|float|string|null>
*/
public function get_metadata(): array {
return $this->config['metadata'] ?? array();
}
}