Skip to content

Navigation Menu

Sign in
Sign up

can we get response in chunks in grahpql API? #2626

Unanswered
hassan-index asked this question in Q&A
Discussion options

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 } } }

You must be logged in to vote

Replies: 1 comment

Comment options

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.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /