hasura / hasura/graphql-engine

[Relay] Row limit not working properly when adding `first` to relay graphql query

Open
#8,131 6 comments 0 reactions 0 assignees View on GitHub
c/relay k/bug
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### 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.

Contributor guide

Open the contributing guide

Research direction

Reproduce the supplied users_connection(first: 30) query with a role row limit of 20 on hasura/graphql-engine:v2.0.10.cli-migrations-v3 using the Relay endpoint. Trace how the Relay query applies the role limit and builds pageInfo. Done means the behavior and pagination metadata match the documented limit and requested page size, with regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql
Domain
api, authorization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.