productGroups
Search for product groups in the catalog
Authentication
Public Access: Accessible with the public API key
Query Structure
{
productGroups(
query: String
parentId: Int
first: Int
after: String
last: Int
before: String
sortKey: ProductGroupSortKey
reverse: Boolean
) {
edges {
node {
id
}
cursor
}
nodes {
id
}
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
totalCount
}
}Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
| query | String | No | Search query string |
| parentId | Int | No | Filter by parent category ID |
| first | Int | No | Returns the first n elements |
| after | String | No | Returns elements after cursor |
| last | Int | No | Returns the last n elements |
| before | String | No | Returns elements before cursor |
| sortKey | ProductGroupSortKey | No | The key to sort product groups by |
| reverse | Boolean | No | Reverse the order of the underlying list |
Return Type
ProductGroupConnection - A connection to a list of ProductGroup items. Contains edges with ProductGroupEdge items, nodes with ProductGroup items, pagination information via PageInfo, and a totalCount of items.
Example
{
productGroups(query: "electronics", first: 10, sortKey: NAME) {
edges {
node {
id
name
description
}
cursor
}
pageInfo {
hasNextPage
endCursor
}
totalCount
}
}