hasura / hasura/graphql-engine

Add totalCount to relay API

Open
#8,362 1 comment 0 reactions 0 assignees View on GitHub
k/enhancement
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Is your proposal related to a problem?

We cannot use relay API and do pagination while still showing total number of matches.

### Describe the solution you'd like

Add `totalCount` to relay implementation. From https://graphql.org/learn/pagination/

```graphql
query friendsConnection(first:2 after:"Y3Vyc29yMQ==") {
totalCount
edges {
node {
name
}
cursor
}
pageInfo {
endCursor
hasNextPage
}
}
```

### Describe alternatives you've considered

Not using hasura relay API.

### If the feature is approved, would you be willing to submit a PR?

I don't have the knowledge to do so.

Contributor guide

Open the contributing guide

Research direction

The issue names no repository files or tests; begin by locating the relay implementation and reviewing the linked GraphQL pagination example. Done means relay connections expose totalCount alongside edges and pageInfo, with coverage for the paginated query.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.