Skip to main content
You're reading the V1 docs. They cover the first generation of Intuition: the intuition-ts packages and the intuition-rs services. New development happens in V2. Open the V2 docs
Version: V1

Pagination Best Practices

Always use limit and offset for efficient pagination with consistent ordering.

Best Practice​

query GetAtomsPage($limit: Int!, $offset: Int!) {
total: atoms_aggregate {
aggregate {
count
}
}
atoms(
limit: $limit
offset: $offset
order_by: { created_at: desc }
) {
term_id
label
}
}

Key Points​

  1. Always include order_by for consistent results
  2. Fetch total count using aggregates
  3. Use reasonable limits (10-100 items per page)
  4. Calculate offset as (page - 1) * limit