Skip to main content
Version: 2.0.0

CustomerGroupsQuery

Description

Retrieves all customer groups configured in the system. This query allows you to fetch information about customer groups that can be used for filtering, categorizing, or displaying customer group information.

Endpoint

query allCustomerGroups {
allCustomerGroups {
name
value
}
}

Arguments

This query does not accept any arguments.

Return Values

The query returns an array of CustomerGroup objects with the following fields:

FieldTypeDescription
nameStringThe display name of the customer group.
valueStringThe identifier or code for the customer group. This value is typically used when assigning a customer to a group.

Usage Example

query {
allCustomerGroups {
name
value
}
}

Example Response

{
"data": {
"allCustomerGroups": [
{
"name": "General",
"value": "general"
},
{
"name": "VIP",
"value": "vip"
},
{
"name": "Wholesale",
"value": "wholesale"
}
]
}
}

Notes

  • This query returns all customer groups configured in the system, regardless of their status.
  • Customer groups are typically used for segmenting customers, applying different pricing rules, or providing different access levels.
  • The value field is the identifier used when assigning a customer to a group or when filtering customers by group.
  • If no customer groups are configured in the system, an empty array will be returned.
  • If an error occurs during the retrieval of customer groups, an empty array will be returned and the error will be logged.