Closed heaths closed 2 years ago
A specific use case is a work around for https://github.com/github/feedback/discussions/16168. A ProjectNext
object can exist in either an Organization
or a User
if not already linked to a Repository
. But to minimize the number of requests I would ideally query both the root organization
and user
to figure out a ProjectNext.id
. In fact, given both an owner and repo name, I could query all three root objects and use whichever ProjectNext
I can, but I need to ignore the other 2 errors.
Technically, the current implementation still populates the response interface{}
despite returning an error
, but this may not always be the case since its atypical. Relying solely on the error message is also fragile and again relies on implementation details. Instead, just like RESTClent
, export the GQLError
so they can be used by the caller.
I did rename it in another commit but realized I forgot to push it. 😣
Similar to
HTTPError
andHTTPErrorItem
already (which was actuallyHttpErrorItem
), exportGQLError
(wasGQLErrorREsponse
) andGQLErrorItem
(wasGQLError
). This makes it possible for callers to check the errors and react accordingly, as in cli/cli#5588 where certain GraphQL errors could be filtered out.