GraphQL Product Queries
Author:
Holger Lierse
Changed on:
1 July 2024
Overview
Sample Product Queries that can be used on a daily basis
Key points
- Sample Queries on the following:
- Variant Product (SKU) by Reference
- Variant Product (SKU) by Details
- Variant Products (SKU)
Variant Product (SKU) by Reference
Retrieve a variant product (SKU) based on a reference.
Example Query:
1query QueryVariantProduct ($productCatalgoueRef:String!, $ref:String!){
2 variantProduct(catalogue: {ref:$productCatalgoueRef }, ref: $ref) {
3 id
4 ref
5 name
6 gtin
7 attributes {
8 name
9 value
10 }
11 prices {
12 value
13 }
14 status
15 }
16}
Language: json
Name: variant Product (SKU) by Reference - Query
Description:
variant Product (SKU) by Reference - Query
Example Parameters:
1{
2 "productCatalgoueRef": "COMPATIBILITY:1",
3 "ref":"19092800045"
4}
Language: json
Name: variant Product (SKU) by Reference - Parameter
Description:
variant Product (SKU) by Reference - Parameter
Variant Product (SKU) by Details
Retrieve a variant product (SKU) based on details productRefs and statuses.
Example Query:
1query QueryVariantProductByDetail($productCatalgoueRef:String!, $productRefs:[String!], $statuses:[String!]) {
2 variantProducts(catalogue: {ref: $productCatalgoueRef}, ref: $productRefs, status: $statuses) {
3 edges {
4 node {
5 id
6 ref
7 name
8 product {
9 id
10 name
11 ref
12 }
13 attributes {
14 name
15 value
16 }
17 prices {
18 value
19 }
20 status
21 }
22 }
23 }
24}
Language: json
Name: variant Product (SKU) by Details - Query
Description:
variant Product (SKU) by Details - Query
Example Parameters:
1{
2 "productCatalgoueRef": "COMPATIBILITY:1",
3 "productRefs": ["19092800045"],
4 "statuses":["ACTIVE"]
5}
Language: json
Name: variant Product (SKU) by Details - Parameter
Description:
variant Product (SKU) by Details - Parameter
Variant Products (SKU)
Retrieve variant products by paginating through the records.
Example Query:
1query QueryVariantProducts($count: Int!, $productCatalogueRef: String!, $variantPrdCursor: String) {
2 variantProducts(first: $count, catalogue: {ref: $productCatalogueRef}, after: $variantPrdCursor) {
3 edges {
4 node {
5 id
6 ref
7 name
8 product {
9 id
10 ref
11 name
12 }
13 attributes {
14 name
15 value
16 }
17 prices {
18 value
19 }
20 }
21 cursor
22 }
23 pageInfo {
24 hasNextPage
25 }
26 }
27}
Language: json
Name: variant Products (SKU) - Query
Description:
variant Products (SKU) - Query
Example Parameters:
1{
2 "productCatalogueRef": "DEFAULT:1",
3 "count": 100
4}
Language: json
Name: variant Products (SKU) - Parameter
Description:
variant Product (SKU) by Reference - Parameter