Fork me on GitHub
#pathom
<
2018-12-10
>
eoliphant22:12:42

what’s the best way to handle pagination with pathom?

wilkerlucio12:12:36

I like to do it similar to how graphql handles connections, usually a query for a paginated resource looks like this:

[{:my-users-paginated
  [{:pagination/items
    [:name :email :address]}
   :pagination/cursor]}]

wilkerlucio12:12:05

so the items contains the actual items, while cursor is some map that has enough information to request the next page

wilkerlucio12:12:39

so the next request can go like:

wilkerlucio12:12:40

[{(:my-users-paginated {:pagination/cursor ...})
  [{:pagination/items
    [:name :email :address]}
   :pagination/cursor]}]

eoliphant13:12:12

ok I was wondering if the relay approach made sense 🙂 But, of course, it’s way easier in pathom. I always liked the idea, but it ‘feels’ clunky to implement in graphql