Skip to contents

Every call of the package to the GitHub API goes through this function, so that the tests can replace it with answers of their own.

Usage

gh_api(endpoint, ..., token = NULL)

Arguments

endpoint

The endpoint, such as "/user" or "POST /graphql". Its placeholders take the values of the same names in ....

...

The values of the placeholders and the parameters of the request, passed to gh::gh().

token

GitHub token, or NULL for the one that gh finds.

Value

The answer of GitHub, as gh::gh() returns it. An answer with an error stops with the error of gh.

Examples

if (FALSE) { # \dontrun{
rghcard:::gh_api("/users/{user}", user = "octocat")$public_repos
} # }