Replies: 1 comment 1 reply
-
Short: IMHO, this is fine.
It works for many but not all cases, so not using it is "totally fine ™️". In fact, project can have complex relations and not using
I'd say this part and if you're using offset-based pagination, this is where you will run into performance issues from DB side at some point (dunno, 50k? 100k? 🤷♀️).
if that includes pagination logic on multiple I'm happy to give more feedback if you want, but for that I suggest you publish a public project with some sample code ready-to-run locally and some instruction what to check specifically. |
Beta Was this translation helpful? Give feedback.
-
Hi all,
I'd like to implement nested paginated fields to mitigate performance issues. I'm implementing a simple notes app driven by a GraphQL API to test this. I have come up with an approach but I'd like to understand if I'm on the right track. Let's assume we have the following query whereby a notebook is fetched along with all associated notes, there is no limit on the number of notes that can be created so this list could be empty or have an infinite number of notes. I'm naturally worried about the size of the payload and the time it takes to return the result if a large number of notes exist.
What I'd like to do is describe my Notebook type in such a way that the notes field can be paginated, for example:
I didn't find any documentation or examples on how to do this so I came up with the following approach:
Although this works, it doesn't feel right as I cannot leverage things such as SelectFields, which again triggers my performance anxiety, I also hit an error when constructing a query whereby each note returns its parent notebook and that notebook returns its notes.
I'd be interested to know if my approach is correct or if it can be tackled in another way. Happy to log the error I experience once I know if I'm on the right track or not. 😄
Beta Was this translation helpful? Give feedback.
All reactions