badges / badges/shields

future of the "Open Collective members by tier" badge

Open
#9,361 0 comments 0 reactions 0 assignees View on GitHub
service-badge
Dominant language
JavaScript
Stars
27.2k
Forks
5.6k
Avg merge
1d 8h
Merged PRs (30d)
46

Description

:clipboard: **Description**

In #9346 we migrated the OpenCollective sponsors and backers badges to use the new GraphQL API. The "Open Collective members by tier" badge is still using the old Rest API.

The "by tier" badge can't use a `totalCount` query. We have to request every record and count matching ones. The reason why we left the "by tier" badge using the old API is that the Rest API has a max page size of 1,000 and the GraphQL API has a max page size of 100. Although this implementation is still buggy because we aren't taking into account anything beyond the first page. In general, pagination is a problem for us because we need to be able to get a result and return it quickly. Ideally we need to get out result from the upstream service in a single API call.

From https://docs.opencollective.com/help/contributing/development/api

> The future of the Open Collective API is our public GraphQL API.

> Our REST API is still supported but we're not working on it any more.

Additionally, this badge relies on `legacyId` which is not super-intuitive to obtain.
TODO: is there a new more intuitive tier ID? If we switched to a different identifier, could we provide something comparable that can provide an accurate count based on a `totalCount` query?

This badge is not very widely used. Based on a GitHub search, there are fewer than 30 public READMEs on GitHub that include one.
Another option is we could consider deprecating this badge.

Contributor guide

Open the contributing guide

Research direction

Start by reading the GraphQL migration in #9346 and the Open Collective API documentation linked in this issue, then inspect the current “Open Collective members by tier” badge entry point. Determine whether a GraphQL tier identifier can support an accurate count in one request or whether the badge should be deprecated; done means documenting and implementing one decided path, including pagination or deprecation behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, javascript
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.