Skip to Content

ProductOption

Describes a product option.

Type Definition

type ProductOption { isForCombinedListing: Boolean handle: String sortOrder: Int title: String taxonomyAttributeId: Int taxonomyAttributeHandle: String taxonomyAttribute: ProductTaxonomyAttribute values: [ProductOptionValue] selectedValue: ProductOptionValue }

Fields

FieldTypeNullableDescriptionRelated Type
isForCombinedListingBooleanYesReturns whether this option is for a combined listing.-
handleStringYesReturns the handle.-
sortOrderIntYesReturns the sort order.-
titleStringYesReturns the title.-
taxonomyAttributeIdIntYesReturns the taxonomy attribute ID.-
taxonomyAttributeHandleStringYesReturns the taxonomy attribute handle.-
taxonomyAttributeProductTaxonomyAttributeYesReturns the related taxonomy attribute for this option.ProductTaxonomyAttribute
values[ProductOptionValue]YesReturns the values available for this option.[ProductOptionValue]
selectedValueProductOptionValueYesReturns the selected value for this option.ProductOptionValue

Relationships

  • taxonomyAttribute: Links this product option to a ProductTaxonomyAttribute object, providing additional metadata about the taxonomy classification of the option.
  • values: An array of ProductOptionValue objects representing all possible values this option can take.
  • selectedValue: A single ProductOptionValue representing the currently selected value for this option.

These relationships allow traversal from a product option to its taxonomy details and possible or selected values, enabling rich querying of product configurations.

Usage Examples

Basic Query

{ productOption { isForCombinedListing handle sortOrder title taxonomyAttributeId } }

Field Selection

{ productOption { title handle values { id label } selectedValue { id label } } }

Nested Queries

{ productOption { title taxonomyAttribute { id name description } values { id label sortOrder } } }

Filtering and Sorting

Filtering and sorting can be applied when querying collections of product options or their values. For example, to fetch product options sorted by sortOrder:

{ productOptions(sortBy: SORT_ORDER_ASC) { title sortOrder values { label } } }

Note: Actual filtering and sorting arguments depend on the schema’s query definitions and are not defined directly on the ProductOption type fields.

Implements

This type does not explicitly implement any interfaces.

Connections

The ProductOption type connects to:

  • ProductTaxonomyAttribute via the taxonomyAttribute field.
  • ProductOptionValue via the values and selectedValue fields.

These connections enable querying related taxonomy metadata and option values seamlessly.

  • ProductTaxonomyAttribute: Provides taxonomy classification details for product options.
  • ProductOptionValue: Represents individual selectable values within a product option.

Best Practices

  • When querying product options, select only the fields you need to optimize response size and performance.
  • Use the values field to retrieve all possible values for an option, and selectedValue to identify the current selection.
  • Leverage the taxonomyAttribute relationship to enrich product options with taxonomy metadata when needed.
  • For sorting or filtering product options, use query-level arguments where supported rather than client-side filtering.

Notes

  • All fields in ProductOption are optional and may return null if data is unavailable.
  • The API currently requires no authentication, but this may change in future versions; design your client to handle authentication gracefully.
  • Nested queries involving related types like ProductTaxonomyAttribute and ProductOptionValue can impact performance; use them judiciously.
  • There are no computed or derived fields explicitly defined on this type.
  • No field arguments are defined on ProductOption fields.
Last updated on