Closed intellix closed 4 years ago
Another solution might be to add index
to the edge here: https://github.com/mickhansen/graphql-sequelize/blob/master/src/relay.js#L210
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I'm currently creating a leaderboard of users based on a field that I order by: points. I can get a user's rank by exposing an index field for the rank:
Now, I can create a leaderboard or top 10 of points by creating a query like so:
Query:
Result:
Right now I'm duplicating the work of fromCursor to get ahold of the index. It'd be cool to expose those 2 methods: https://github.com/mickhansen/graphql-sequelize/blob/master/src/relay.js#L168 https://github.com/mickhansen/graphql-sequelize/blob/master/src/relay.js#L178