[Relay] Row limit not working properly when adding `first` to relay graphql query
Version Information
Server Version: hasura/graphql-engine:v2.0.10.cli-migrations-v3
Environment
- docker on ubuntu 20;
- using relay endpoint;
What is the expected behaviour?
Having a row limit on a role set to 20
Querying for data:
{
users_connection(first: 30) {
edges {
node {
id
name
avatarUrl
login
url
}
}
pageInfo {
endCursor
hasNextPage
}
}
}
I expected it to show 30 rows, has a next page, since the database has more values than the 30 asked!
Keywords
row limit, pagination with row limit, pagination override.
What is the current behaviour?
It returns only 20 rows, instead of 50, and have no next pages metadata for relay.
To be clear, this only happens with relay, if you try to grab more results past the 19th cursor, it shows as null and does not show the hasNextPage info on pageInfo

The same thing does not work for the normal api
Is this happening on version 2.2.0?
Yes, the pageInfo still sends hasNextPage as false!
Tested this, able to reproduce. It looks like the roles' row limit is being treated as the total number of rows, which is incorrect. To reproduce this:
- set a row limit on a role
- query a table using the relay api, set the
firstargument equal or greater than the row limit - the hasNextPage value will be false.
Do note: the row limit is intended to override the desired amount of rows specified using first.
However users should still be able to paginate beyond the maximum amount of rows they are allowed to query at once.
Therefore your query returning 20 rows is expected behavior. However you should be able to paginate to page 2 and 3, with 20 and 10 rows each respectively (assuming there are a total of 50 selectable rows)
Yes @BenoitRanque, setting a limit on the table breaks pagination.
I can reproduce this issue. It works fine if I leave the row limit blank for a given role (which is not ideal)