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
Float
representing 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 fieldsthreshold
anddiscount
.String
— Used for the optionalvalidUntil
date field.
Best Practices
- Always query for
threshold
anddiscount
together to understand the discount level context. - Use the optional
validUntil
field to determine if a discount level is currently active. - When querying multiple levels, apply filtering and sorting on
threshold
ordiscount
to optimize data retrieval. - Handle cases where
validUntil
may benull
to avoid errors in date processing.
Notes
- The API currently requires no authentication, but this may change in future versions.
threshold
anddiscount
are required fields and guaranteed to be present.validUntil
is 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