Automattic\WooCommerce\Internal\Api

QueryComplexityRule::fieldDefinition │ protected │ WC 1.0

Look up the schema definition recorded for a field node.

Method of the class: QueryComplexityRule{}

No Hooks.

Returns

?FieldDefinition. The definition, or null when the field doesn't exist on its parent type.

Usage

// protected - for code of main (parent) or child class
$result = $this->fieldDefinition( $field ): ?FieldDefinition;
$field(FieldNode) (required)
The field node.

QueryComplexityRule::fieldDefinition() code WC 11.1.2

protected function fieldDefinition( FieldNode $field ): ?FieldDefinition {
	return $this->field_definitions[ spl_object_id( $field ) ] ?? null;
}