moltin / gatsby-source-moltin

🚀 Gatsby source plugin for building Elastic Path Commerce Cloud powered eCommerce websites
https://www.gatsbyjs.org/packages/@moltin/gatsby-source-moltin
MIT License
21 stars 4 forks source link

Add product variations #24

Closed notrab closed 5 years ago

notrab commented 5 years ago

Product variations are a popular request for the source plugin. Below is an example of how we could query the product variations.

query($id: String!) {
  product: moltinProduct(id: { eq: $id }) {
    variants {
      id
      name
      options {
        id
        name
        description
      }
    }
  }
}

The above query would be a wrapper around the meta.variations. Not sure if this is overkill?