The getCatalogData
query supports powerful filtering capabilities, allowing users to narrow down the list of catalog items.
Within a Standard API, the system offers next predefined filters:
Filter Name | Filter ID | Purpose |
---|
Search | filter_search | Filters catalog items by training title using a free-text query. |
Duration | filter_duration | Filters by training duration, based on duration terms already associated with catalog items. |
Domains | filter_domain | Filters by training domains, based on domain terms already associated with catalog items. |
Status | filter_status | Filters by the user’s training attempt status, such as “Not started”, “In progress”, or “Passed”. Only applicable for authenticated users. |
Bookmarks | filter_bookmark | Filters catalog items to show only bookmarked learning paths for the current user. Only available for authenticated users. |
Within the Custom API, the list of filters is automatically extended with any client-defined custom fields. Please refer to the dedicated documentation for full implementation details.
The list of available filters can be fetched using the getCatalogFilters
query:
query getCatalogFilters {
getCatalogFilters {
id
label
options {
key
value
weight
}
formElementType
filterFormSection
}
}
UI Rendering Guidelines
To ensure a consistent and intuitive user experience, follow these guidelines when rendering filters in the client platform:
Field | Usage |
---|
id | The filter ID. This must be passed back to the API exactly as received—do not modify or parse. |
label | The recommended filter label. This can be renamed or localized on the client platform as needed. |
formElementType | Determines the UI control to render. Common values include CHECKBOXES and TEXTFIELD . |
options | A list of selectable options for the filter, if applicable. Most relevant for CHECKBOXES . |
filterFormSection | Optional field that suggests a logical grouping or placement in the UI layout. |
Applying Filters
Filtering is configured using the filters
argument in the getCatalogData
query.
Filtering can be combined with sorting and pagination arguments to further refine the results.
Filtering Arguments
Argument | Type | Description |
---|
filters | [FilterInput] | A list of filter objects specifying which fields and values to filter by. |
Each FilterInput
consists of:
Field | Type | Description |
---|
key | ID | The filter field ID (e.g. "filter_duration" ). Must match values from getCatalogFilters . |
value | [String] | One or more values to apply for the specified filter: • For CHECKBOXES , use the selected option keys. • For TEXTFIELD , pass the raw input string as a single-element array. |
Example: Applying Multiple Filters
The following example applies multiple filters to the getCatalogData
query: duration filter selecting specific predefined options, search filter using free-text input to match training by title, and bookmark filter to show only bookmarked.
query {
getCatalogData(
first: 5,
filters: [
{
key: "filter_duration",
value: ["3", "4"]
},
{
key: "filter_search",
value: ["Anonymous"]
},
{
key: "filter_bookmark",
value: ["true"]
}
]
) {
edges {
node {
training {
title
duration { id, name }
}
}
}
totalItems
}
}