hasura / hasura/graphql-engine

[relay] Limit number of rows in select permission does not work with Relay

Open
#9,122 0 comments 0 reactions 0 assignees View on GitHub
k/bug t/product-platform
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version:

v2.13.0-cloud.1

### Environment

Cloud

### What is the current behaviour?

If you set row limit for a given role, the relay pagination will stop at that specific limit (not per request, but in total)

![print-1](https://user-images.githubusercontent.com/39778068/196288039-cd6254d4-652c-4d4c-a99b-2535cd5cf5a4.png)

### What is the expected behaviour?

If you set row limit, I expect to limit the number of rows per fetched request, not per entire pagination/connection.

### How to reproduce the issue?

1. Create a table, fill in with many records
- Example: 100 records
2. Create a role
3. Set row limit for the given role and table, with a number less than the total number of records from step 1
- Example: 50
4. Fetch the relay connection with the relay API using the role from step 2, and providing the `first` argument
- Example: first 20 (you will be able to make 3 requests: 20 + 20 + 10, if you have row limit set to 50)

### Keywords

Relay, connections, pagination, row limit

Contributor guide

Open the contributing guide

Research direction

Reproduce the Relay API connection using a role with a row limit and a smaller first argument, following the numbered steps in the issue. Trace how Relay pagination combines the role limit with successive requests, then add regression coverage showing the limit applies per fetched request and verify the documented 20 + 20 + 10 sequence can continue as expected.

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.