server: fix pagination with small counts and no first/last set

This commit is contained in:
Bill Thiede 2023-11-26 21:27:57 -08:00
parent e8c58bdbd0
commit d45f223d52

View File

@ -142,11 +142,10 @@ impl QueryRoot {
first, first,
last, last,
|after, before, first, last| async move { |after, before, first, last| async move {
info!("{after:?} {before:?} {first:?} {last:?} {query}");
let total = nm.count(&query)?; let total = nm.count(&query)?;
let (first, last) = if let (None, None) = (first, last) { let (first, last) = if let (None, None) = (first, last) {
info!("neither first nor last set, defaulting to 20"); info!("neither first nor last set, defaulting first to 20");
(Some(20), Some(20)) (Some(20), None)
} else { } else {
(first, last) (first, last)
}; };