8.SET Custom

Fetch a custom set for a given product identifier or a specific custom set by id.

What we want to build

We want to show the set images and a slider with the set products. We only want to show up to 2 similar products for each product.

GraphQL query and response

You can request custom set content for a given product identifier or you can request a specific set by it's id.

Custom Set for product - id only

To ensure that you show the most recent data in you shop you should only query the product ids and fetch the rest of the data you need for your UI from your own database.

In case you can not make the extra roundtrip you can actually query all the data that is required to render a basic UI. Just consult the GraphQL schema.

query {
  product(id: "8S-DEMO-Polohemd-1") {
    customSets {
      edges {
        node {
          id
          title
          description
          images {
            edges {
              node {
                url
              }
            }
          }
          products {
            id
            similarProducts(first: 2) {
              edges {
                node {
                  id
                }
              }
            }
          }
        }
      }
    }
  }
}

Custom Set by id - id only

To ensure that you show the most recent data in you shop you should only query the product ids and fetch the rest of the data you need for your UI from your own database.

In case you can not make the extra roundtrip you can actually query all the data that is required to render a basic UI. Just consult the GraphQL schema.

query {
  customSet(id: "e3bcaf66-5037-4d7b-be4a-8c571a6fb299") {
    id
    title
    description
    images {
      edges {
        node {
          url
        }
      }
    }
    products {
      id
      similarProducts(first: 2) {
        edges {
          node {
            id
          }
        }
      }
    }
  }
}

Last updated