Skip to content
Esc
↑↓navigate↵open⌘Jpreview

v1Facets

Query facets for products with optional filtering

QUERYv1Facets
Arguments
facets[FacetArguments!]!required

Facet dimensions to compute (e.g. ATTRIBUTES, PRICE_RANGE, IN_STOCK)

searchString

Full-text search over products; facet counts reflect only products matching this query

Product filter applied before facet aggregation; uses the same filter tree as v1Products

marketSlugString!required

Market slug for price facets and market-scoped counts. Required

storeGroupSlugString!required

Store group slug for price facets and store-scoped counts. Required

warehouseSlugString

Warehouse slug for IN_STOCK facets. Required when facets includes IN_STOCK

channelSlugString

When set, facet counts use products assigned to this sales channel

localeString!required

Locale for translated facet labels (e.g. en, sv). Required

customFields[String!]

Custom field keys to facet on. Required when facets includes CUSTOM_FIELDS

Returns

Facets result

Try it
Server
Bodyapplication/json
Request
curl -X POST 'https://graphql.enad.io/{app_id}/graphql' \
  -H 'Content-Type: application/json' \
  -d '{
  "query": "query V1Facets($facets: [FacetArguments!]!, $search: String, $filter: ProductFilter, $marketSlug: String!, $storeGroupSlug: String!, $warehouseSlug: String, $channelSlug: String, $locale: String!, $customFields: [String!]) {\n  v1Facets(facets: $facets, search: $search, filter: $filter, marketSlug: $marketSlug, storeGroupSlug: $storeGroupSlug, warehouseSlug: $warehouseSlug, channelSlug: $channelSlug, locale: $locale, customFields: $customFields) {\n    categories {\n      id\n      slug\n      name\n      status\n      fullName\n      fullUri\n      count\n    }\n    collections {\n      id\n      uri\n      title\n      status\n      count\n    }\n    tags {\n      id\n      key\n      name\n      status\n      count\n    }\n    attributes {\n      id\n      key\n      name\n      description\n      templateKey\n      filterKey\n      count\n    }\n    brands {\n      id\n      name\n      slug\n      count\n    }\n    series {\n      id\n      brandId\n      name\n      slug\n      count\n    }\n    priceRange {\n      min\n      max\n    }\n    stock {\n      inStock\n      outOfStock\n    }\n    customFields {\n      key\n    }\n  }\n}",
  "variables": {
    "facets": [
      "ATTRIBUTES"
    ],
    "search": "string",
    "filter": {
      "all": [
        {
          "all": [
            {
              "all": [
                {}
              ],
              "any": [
                {}
              ],
              "none": [
                {}
              ],
              "conditions": null
            }
          ],
          "any": [
            {
              "all": [
                {}
              ],
              "any": [
                {}
              ],
              "none": [
                {}
              ],
              "conditions": null
            }
          ],
          "none": [
            {
              "all": [
                {}
              ],
              "any": [
                {}
              ],
              "none": [
                {}
              ],
              "conditions": null
            }
          ],
          "conditions": {
            "status": [
              "ACTIVE"
            ],
            "brandsSlug": [
              "string"
            ],
            "seriesSlug": [
              "string"
            ],
            "inStock": true,
            "priceGte": 0,
            "priceLte": 0,
            "categoryUrls": [
              "string"
            ],
            "collectionUris": [
              "string"
            ],
            "tagKeys": [
              "string"
            ],
            "attributeKeys": [
              "string"
            ],
            "customField": null,
            "collections": null,
            "categories": null,
            "tags": null,
            "skus": [
              "string"
            ],
            "slugs": [
              "string"
            ],
            "ids": [
              "string"
            ],
            "hasActiveVariants": true
          }
        }
      ],
      "any": [
        {
          "all": [
            {
              "all": [
                {}
              ],
              "any": [
                {}
              ],
              "none": [
                {}
              ],
              "conditions": null
            }
          ],
          "any": [
            {
              "all": [
                {}
              ],
              "any": [
                {}
              ],
              "none": [
                {}
              ],
              "conditions": null
            }
          ],
          "none": [
            {
              "all": [
                {}
              ],
              "any": [
                {}
              ],
              "none": [
                {}
              ],
              "conditions": null
            }
          ],
          "conditions": {
            "status": [
              "ACTIVE"
            ],
            "brandsSlug": [
              "string"
            ],
            "seriesSlug": [
              "string"
            ],
            "inStock": true,
            "priceGte": 0,
            "priceLte": 0,
            "categoryUrls": [
              "string"
            ],
            "collectionUris": [
              "string"
            ],
            "tagKeys": [
              "string"
            ],
            "attributeKeys": [
              "string"
            ],
            "customField": null,
            "collections": null,
            "categories": null,
            "tags": null,
            "skus": [
              "string"
            ],
            "slugs": [
              "string"
            ],
            "ids": [
              "string"
            ],
            "hasActiveVariants": true
          }
        }
      ],
      "none": [
        {
          "all": [
            {
              "all": [
                {}
              ],
              "any": [
                {}
              ],
              "none": [
                {}
              ],
              "conditions": null
            }
          ],
          "any": [
            {
              "all": [
                {}
              ],
              "any": [
                {}
              ],
              "none": [
                {}
              ],
              "conditions": null
            }
          ],
          "none": [
            {
              "all": [
                {}
              ],
              "any": [
                {}
              ],
              "none": [
                {}
              ],
              "conditions": null
            }
          ],
          "conditions": {
            "status": [
              "ACTIVE"
            ],
            "brandsSlug": [
              "string"
            ],
            "seriesSlug": [
              "string"
            ],
            "inStock": true,
            "priceGte": 0,
            "priceLte": 0,
            "categoryUrls": [
              "string"
            ],
            "collectionUris": [
              "string"
            ],
            "tagKeys": [
              "string"
            ],
            "attributeKeys": [
              "string"
            ],
            "customField": null,
            "collections": null,
            "categories": null,
            "tags": null,
            "skus": [
              "string"
            ],
            "slugs": [
              "string"
            ],
            "ids": [
              "string"
            ],
            "hasActiveVariants": true
          }
        }
      ],
      "conditions": {
        "status": [
          "ACTIVE"
        ],
        "brandsSlug": [
          "string"
        ],
        "seriesSlug": [
          "string"
        ],
        "inStock": true,
        "priceGte": 0,
        "priceLte": 0,
        "categoryUrls": [
          "string"
        ],
        "collectionUris": [
          "string"
        ],
        "tagKeys": [
          "string"
        ],
        "attributeKeys": [
          "string"
        ],
        "customField": {
          "key": "string",
          "values": [
            "string"
          ],
          "operator": "EQUALS"
        },
        "collections": {
          "uris": [
            "string"
          ],
          "statuses": [
            "string"
          ],
          "titles": [
            "string"
          ]
        },
        "categories": {
          "urls": [
            "string"
          ],
          "statuses": [
            "string"
          ],
          "names": [
            "string"
          ]
        },
        "tags": {
          "keys": [
            "string"
          ],
          "statuses": [
            "string"
          ],
          "filterable": [
            true
          ]
        },
        "skus": [
          "string"
        ],
        "slugs": [
          "string"
        ],
        "ids": [
          "string"
        ],
        "hasActiveVariants": true
      }
    },
    "marketSlug": "string",
    "storeGroupSlug": "string",
    "warehouseSlug": "string",
    "channelSlug": "string",
    "locale": "string",
    "customFields": [
      "string"
    ]
  }
}'
Response
{
  "data": {
    "v1Facets": {
      "categories": [
        {
          "id": "string",
          "slug": "string",
          "name": "string",
          "status": "string",
          "fullName": [
            "string"
          ],
          "fullUri": "string",
          "count": 0
        }
      ],
      "collections": [
        {
          "id": "string",
          "uri": "string",
          "title": "string",
          "status": "string",
          "count": 0
        }
      ],
      "tags": [
        {
          "id": "string",
          "key": "string",
          "name": "string",
          "status": "string",
          "count": 0
        }
      ],
      "attributes": [
        {
          "id": "string",
          "key": "string",
          "name": "string",
          "description": "string",
          "templateKey": "string",
          "filterKey": "string",
          "count": 0
        }
      ],
      "brands": [
        {
          "id": "string",
          "name": "string",
          "slug": "string",
          "count": 0
        }
      ],
      "series": [
        {
          "id": "string",
          "brandId": "string",
          "name": "string",
          "slug": "string",
          "count": 0
        }
      ],
      "priceRange": {
        "min": 0,
        "max": 0
      },
      "stock": {
        "inStock": 0,
        "outOfStock": 0
      },
      "customFields": [
        {
          "key": "string"
        }
      ]
    }
  }
}