GraphQL API Pagination #24414
-
I have a GraphQL query to search repositories and I want to paginate my result.
The query works fine when provided with a cursor. When I want to get only the first page and provide the query with a null cursor to get the first page, I get " Variable cursor of type String! was provided invalid value" error. How can I retrieve the first page without having to write another query with no cursor parameter? Any help would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Hi @tartarjr, Thanks for being here! If I’m not mistaken you’d have to send the initial request again because no variables are specified 😦 Let me do a little digging on my end and see if there are any alternatives. |
Beta Was this translation helpful? Give feedback.
-
Hi Andrea Thank you for your help. Please let me know if you can find any alternatives. |
Beta Was this translation helpful? Give feedback.
-
Hey @tartarjr, Thanks for your patience, looks like the query works fine on our end take a look: Would you please attempt you query again making sure to define the |
Beta Was this translation helpful? Give feedback.
-
Just remove the |
Beta Was this translation helpful? Give feedback.
-
I was working on the search option to list all the available repositories using github api. The search option has an first field and has a limit of 100, iam trying to fetch 500 repositories, is there an alternative to do that ? Code: query { } “message”: “Requesting 500 records on the Thank you |
Beta Was this translation helpful? Give feedback.
Just remove the
!
from String to make the variable accept either a String or a null value.