Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLQueries

ListProducts::get_field_definitionpublic staticWC 1.0

Method of the class: ListProducts{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = ListProducts::get_field_definition(): array;

ListProducts::get_field_definition() code WC 10.9.1

public static function get_field_definition(): array {
	return array(
		'type'          => Type::nonNull( ProductConnectionType::get() ),
		'description'   => __( 'List products with cursor-based pagination and optional filtering.', 'woocommerce' ),
		'authorization' => array(
			array(
				'attribute' => 'RequiredCapability',
				'args'      => array(
					0 => 'manage_woocommerce',
				),
			),
			array(
				'attribute' => 'RequiredCapability',
				'args'      => array(
					0 => 'edit_products',
				),
			),
		),
		'args'          => array(
			'first'        => array(
				'type'         => Type::int(),
				'description'  => __( 'Return the first N results. Must be between 0 and 100.', 'woocommerce' ),
				'defaultValue' => null,
			),
			'last'         => array(
				'type'         => Type::int(),
				'description'  => __( 'Return the last N results. Must be between 0 and 100.', 'woocommerce' ),
				'defaultValue' => null,
			),
			'after'        => array(
				'type'         => Type::string(),
				'description'  => __( 'Return results after this cursor.', 'woocommerce' ),
				'defaultValue' => null,
			),
			'before'       => array(
				'type'         => Type::string(),
				'description'  => __( 'Return results before this cursor.', 'woocommerce' ),
				'defaultValue' => null,
			),
			'status'       => array(
				'type'         => ProductStatusType::get(),
				'description'  => __( 'Filter by product status.', 'woocommerce' ),
				'defaultValue' => null,
			),
			'stock_status' => array(
				'type'         => StockStatusType::get(),
				'description'  => __( 'Filter by stock status.', 'woocommerce' ),
				'defaultValue' => null,
			),
			'search'       => array(
				'type'         => Type::string(),
				'description'  => __( 'Search products by keyword.', 'woocommerce' ),
				'defaultValue' => null,
			),
			'product_type' => array(
				'type'         => ProductTypeType::get(),
				'description'  => __( 'Filter by product type.', 'woocommerce' ),
				'defaultValue' => null,
			),
		),
		'complexity'    => ResolverHelpers::complexity_from_pagination( ... ),
		'resolve'       => array( self::class, 'resolve' ),
	);
}