Create GithubRetryableGraphqlAPIClient
mkcode opened this issue · comments
This new service object should use the existing GithubGraphqlAPIClient
. The initializer method should take an access_token argument as well as a num_retries. On the first request, it uses the access token supplied in the initializer. If there is a 502 error, it retries with a new access token from GithubTokenService.random
until the request succeeds or max retries is reached.
We will need to supply only 1 or 2 retries for use within a request cycle.
The Retryable client should be used on here: https://github.com/raise-dev/hacktoberfest/blob/master/app/services/github_pull_request_service.rb#L59