Skip to Content

CustomizationGroup

Represents a group of product customization options.

Type Definition

type CustomizationGroup { id: String title: String name: String mustBeSelected: Boolean options: [CustomizationGroupOption] }

Fields

FieldTypeNullableDescriptionRelationship
idStringYesThe unique identifier for this customization group.
titleStringYesThe name of this customization group.
nameStringYesThe input type for this customization group (e.g., select, radio, checkbox, textarea).
mustBeSelectedBooleanYesIndicates if an option from this group must be selected to add the product to the cart.
options[CustomizationGroupOption]YesThe list of options available in this customization group, formatted for GraphQL.Related to CustomizationGroupOption

Relationships

  • options: This field links to a list of CustomizationGroupOption objects that represent the individual customization choices within the group.
  • CustomizationGroupOption objects reference back to their parent group via the group field and may also reference nested groups via the childGroup field.

Usage Examples

Basic Query

{ customizationGroup(id: "12345") { id title name mustBeSelected options { id title } } }

Field Selection

{ customizationGroup(id: "12345") { title mustBeSelected } }

Nested Queries

{ customizationGroup(id: "12345") { title options { id title childGroup { id title } } } }

Filtering and Sorting

Filtering and sorting are typically applied at the query level for collections of customization groups or options. Since this type does not define arguments for filtering or sorting directly, you would apply these in the parent query or resolver context.

Example filtering options by title (assuming the parent query supports arguments):

{ customizationGroups(filter: { title_contains: "Color" }, sortBy: TITLE_ASC) { id title options { id title } } }

Implements

This type does not explicitly implement any interfaces.

Connections

  • options connects CustomizationGroup to multiple CustomizationGroupOption objects.
  • CustomizationGroupOption.group connects back to this CustomizationGroup.
  • CustomizationGroupOption.childGroup allows nested customization groups, enabling hierarchical customization structures.
  • CustomizationGroupOption: Represents individual options within a customization group. Each option may reference its parent group and optionally a child group for nested customization.

Best Practices

  • Always check the mustBeSelected field to enforce required customizations before adding products to the cart.
  • Use the options field to retrieve all available customization choices for a group.
  • When dealing with nested customization groups via childGroup, ensure your queries handle potential recursion carefully to avoid performance issues.
  • Apply filtering and sorting at the query level when retrieving multiple customization groups or options to optimize data transfer.

Notes

  • The id field is optional; some customization groups may not have a unique identifier depending on the data source.
  • The name field indicates the input type and can be used to dynamically render UI components (e.g., radio buttons, checkboxes).
  • The API currently requires no authentication, but this may change in future versions.
  • When querying nested options and childGroup fields, consider the potential impact on query complexity and response size.
  • There are no computed or derived fields defined on this type.
  • No field arguments are defined on CustomizationGroup fields themselves; filtering and pagination should be handled at the query or connection level where supported.

Endpoint: https://www.mystoreurl.com/graphql/0.8.0/

Last updated on