Open deep-c opened 7 years ago
Also one other thing i noticed when attempting to use relay style pagination was that when i used after
and first
the next page included the after cursor result. After reading this https://facebook.github.io/relay/graphql/connections.htm#sec-Pagination-algorithm it seems that the next page shouldnt include that cursor specified as after. That is unless im doing something wrong.
Sorry for the trouble :)
@deep-c Hi deep-c thanks for opening this issue, going trough the source-code I saw that pagination is done with the following parameters:
offset
: 10 - skip
: 2
not sure why limit is not used instead of offset, I will look at that. I'll keep you up to date
Also one other thing i noticed when attempting to use relay style pagination was that when i used after and first the next page included the after cursor result. After reading this https://facebook.github.io/relay/graphql/connections.htm#sec-Pagination-algorithm it seems that the next page shouldnt include that cursor specified as after. That is unless im doing something wrong.
Thanks for the gotcha will look at the too
@fenos Thanks!. I just have a question in terms of the use of limit, offset and skip. Correct me if I am wrong but shouldn't offset be used to determine the position from which you would like to retrieve records from, and limit used to define the number of records you would like from that position? I.e assuming you have 50000 records and have specific an offset of 20000
and limit of 50
you would get back records 20000 to 20049.
Also i see there is a maxLimit option which defaults to 50. How do I change this so that i am able to paginate through all results (past the first 50). When I turn opts.maxLimit = false
in the before method of resolve i still get 0 results returned past 50 .
@deep-c Hi your point is correct, I can't remember why I used the offset
param instead of limit
which I will definitely fix.
Regarding the maxLimit
option can be set in the GraphQLThinky
instance like that:
new GraphQLThinky(thinky, {
maxLimit: 100000
});
Hey,
I am attempting to get pagination working using limit, offset, and order to no avail. I keep getting back the first 50 results and I am unsure if I am doing anything wrong.
I am attempting to do offset based pagination like so. Here is the message query.
The model is as follows:
The query is as such:
I can see that the appropriate variables are being sent along with the query however the offset and limit args dont seem to be picked up and used when resolving the query.
I am using v0.4.0-rc-3 without relay. (Using apollo client and its offset based pagination http://dev.apollodata.com/react/pagination.html)
Thanks!