Hi,
I’ve posted a couple of times already and I’m really struggling to achieve what I want - more that I ever have with any other framework. I’ve read the documentation over and over, spent ages on the forum and stackoverflow and spent quite a lot of time playing. I’ve got the browser tooling setup, I can see what’s in my cache, but I cannot figure out sorting, counts or filtering.
I thought I’d post what I’m trying to do and just ask whether I’m trying to push apollo client too far?
The concept
I want to build a small dashboard against the GitHub API to help with triaging and maintaining across 100s of repositories.
What I’m trying to achieve:
- list repos ordered by number of open PRs
- show how many PRs are from renovate (and ideally have the option to sort by that number too)
- show how many PRs are from non-org members (again with sort option)
- show how many issues are from non-org members (again, sort would be great)
- filter to show certain groups of repositories, e.g. by a topic, or just a fixed list
- show other complex data about repositories like the node version set in package.json, or if certain workflows are configured or if renovate is not configured
All of this data is available via the GraphQL API, but the API is nested with “Connections”.
I’ve got basic pagination working by writing my own merge function, but I can’t sort or filter because once I get to a connection, I cannot access that data inside a read or merge function.
Can Apollo Client do this?
I don’t have control over the server or the schema. I want a client to show and use data that comes from different connections e.g. repositories → pullRequests and repositories → repositoryTopics.
I want to manipulate the data slightly to achieve extra counts and sorting. I also want to be able to filter, but the filters I want to use are not available as queries on the GraphQL API.
Thanks for any help or advice.
My code so far is here: GitHub - TryGhost/slimer-dashboard: GitHub Dashboard built in Apollo