LoyaltyDiscountLevel
Represents a single level in the loyalty discount progress.
Type Definition
type LoyaltyDiscountLevel {
threshold: Float!
discount: Float!
validUntil: String
}Fields
| Field | Type | Description | Nullable | Related Types |
|---|---|---|---|---|
| threshold | Float! | The threshold required for this level. | No | Float |
| discount | Float! | The discount for this level. | No | Float |
| validUntil | String | The valid until date for this level (optional). | Yes | String |
Relationships
- threshold and discount are scalar fields of type
Floatrepresenting numeric values related to the loyalty discount level. - validUntil is an optional string field representing a date until which this discount level remains valid.
Usage Examples
Basic Query
{
loyaltyDiscountLevel {
threshold
discount
validUntil
}
}Field Selection
{
loyaltyDiscountLevel {
threshold
discount
}
}Nested Queries
Since LoyaltyDiscountLevel contains only scalar fields, nested queries are not applicable.
Filtering and Sorting
Filtering and sorting can be applied in queries that return lists of LoyaltyDiscountLevel objects. For example:
{
loyaltyDiscountLevels(filter: { threshold_gte: 100 }, sort: DISCOUNT_DESC) {
threshold
discount
validUntil
}
}Note: The above filtering and sorting arguments depend on the parent query implementation and are shown here as an example pattern.
Implements
This type does not implement any interfaces.
Connections
No connection fields are defined on LoyaltyDiscountLevel.
Related Types
Float— Used for numeric fieldsthresholdanddiscount.String— Used for the optionalvalidUntildate field.
Best Practices
- Always query for
thresholdanddiscounttogether to understand the discount level context. - Use the optional
validUntilfield to determine if a discount level is currently active. - When querying multiple levels, apply filtering and sorting on
thresholdordiscountto optimize data retrieval. - Handle cases where
validUntilmay benullto avoid errors in date processing.
Notes
- The API currently requires no authentication, but this may change in future versions.
thresholdanddiscountare required fields and guaranteed to be present.validUntilis optional and may be omitted if the discount level does not have an expiration date.- Since all fields are scalar, querying this type is performant and straightforward.
- Consider caching loyalty discount levels on the client side if they do not change frequently to reduce API calls.
Last updated on