How to get product custom options list by GraphQl query?

Magento GraphQl query to fetch product custom options list using CustomizableOptionInterface.

The Customizable Option Interface contains basic information about a product’s customizable options.

You can create different types of Custom Options for the product like text field, text area, radio button, dropdown, multi-select, image, file uploading, etc…

Each different type of field of custom option uses a different Customizable Option type in the GraphQl query.

  • CustomizableFieldOption is used for the text field.
  • CustomizableAreaOption used for the text area field.
  • CustomizableRadioOption used for the radio button.
  • CustomizableFileOption is used for the file uploading field type.
  • CustomizableMultipleOption is used for the multiple select options field type.
  • CustomizableDropDownOption is used for the dropdown field type.
  • CustomizableDateOption is used for the date field type.

Let’s create a GraphQl product query to fetch a list of custom options from the product by filtering SKU.

Product Custom options will be displayed like in the given screenshot.custom option graphql magento

Here Product with Text field and DropDown fields are available and we want to retrieve a list of available custom options by GraphQl query.

You can also fetch another field type also using the query with specific customizable options.

Output: