Automattic\WooCommerce\Api\Infrastructure\Schema

ObjectType{}WC 1.0

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

  1. public get_metadata()
  2. ERROR: no method name found on line ``
  3. ERROR: no method name found on line ``
  4. ERROR: no method name found on line ``
  5. ERROR: no method name found on line ``
  6. ERROR: no method name found on line ``
  7. ERROR: no method name found on line ``

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();
	}
}