Common query patterns for filtering, sorting, and pagination in the ADP API
Field References
Learn how to use common query patterns across all ADP API operations.
Overview
The ADP API uses consistent patterns for filtering, sorting, and paginating results across all GraphQL queries. Understanding these patterns is essential for effective API usage.
Available References
- Filtering - Use operator-based filters to query specific data
- Sorting - Sort results with lowercase directions (CRITICAL requirement)
- Pagination - Navigate large result sets with offset-based pagination
Common Patterns
All query operations in the ADP API support these parameters:
| Parameter | Type | Description |
|---|---|---|
filter | JSON | Operator-based filtering ({"field": {"=": value}}) |
sort | JSON | Sort by field(s) with lowercase directions ({"field": "asc"}) |
limit | Int | Maximum items to return (default: 25) |
offset | Int | Number of items to skip (default: 0) |
Quick Example
query GetLineitems($filter: JSON, $sort: JSON) {
dream_adserver {
lineitems(
filter: $filter
sort: $sort
limit: 10
offset: 0
) {
edges {
lineitem_id
lineitem_name
}
total_count
}
}
}Variables:
{
"filter": {
"lineitem_is_archived": {"=": false}
},
"sort": {
"lineitem_id": "desc"
}
}Next Steps
- Learn about Filtering operators
- Understand Sorting requirements
- Master Pagination techniques
