GraphQL query to get Particular Varient Products

Topic summary

Main issue: How to retrieve products whose variants match specific option values (e.g., color = Yellow and size = L) via Shopify’s API.

Proposed approach:

  • Use Admin GraphQL objects ProductVariant and ProductOption (2022-04).
  • With ProductVariant, query the selectedOptions field and filter by option name/value pairs (e.g., name=“color”, value=“yellow”).
  • Alternatively, use ProductOption by defining the option name and value to identify matching variants.

Key concept: Options are separate entities from products and variants, with a many-to-one relationship (multiple variants share the same option definitions).

Status: Guidance and documentation links provided; no concrete query example or confirmation of results. The thread remains open without a confirmed solution.

Summarized with AI on January 31. AI used: gpt-5.

Hi,

I want to get particular variants products like “color” : “Yellow” and “size” : “L” . How can i get all products with multiple variants conditions using API?

You can use two things, one would be ProductVariant, and the other ProductOption.

With productVariant it would be important to target ProductVariant.selectedOptions and add parameters like name=“color” and value=“yellow”

With productOption it would be a matter of defining name=“color” and value=“yellow”

Options are entities separated from products and variants, their relationship is many to one.