I've been playing a lot with GraphQL and Apollo lately, but I am usually unsure about best practices when it comes to querying the server and getting results back.
Now, say I have a list of locations which I want to display in a paginated list:
Let's say I decide to use Apollo's pagination capabilities and get 10 locations at a time:
- If I want to filter by city using a dropdown with all cities in the DB, the paginated results will return me only the cities within those 10 locations. Should I then make a separate query for that (eg.
- Then if I select a city as a filter, I should make yet another new query filtered by the city, right?
Or should I just ditch Apollo's pagination and query all locations, and do all the pagination and filtering in the client? In that case, how much is too much data for an initial load?
Or am I missing something?
Greetings from Berlin...