-
-
Notifications
You must be signed in to change notification settings - Fork 468
can we get response in chunks in grahpql API? #2626
I have a registration api with data in the thousands. I want to retrieve it in chunks to avoid memory limit errors. I am using not a resolver; I am using the @pagiate directive. Can I get this data in chunks? i am calling this API in my backend laravel project.
query registrations($first: Int, $page: Int, $where: QueryRegistrationsWhereWhereConditions) { registrations(first: $first, page: $page, where: $where) { data { registration_id } paginatorInfo { count currentPage firstItem hasMorePages lastItem lastPage perPage total } } }
All reactions
Replies: 1 comment
Don't set $first too high and make more requests should solve that for you already... it is properly paginated. Don't request them by the thousands but pick a reasonable page size like 100 and show the user pagination so the can browse the full list loading 100 at a time.