See more about the GraphQL API here: https://developer.github.com/v4/
gh_gql(
query,
...,
.token = NULL,
.destfile = NULL,
.overwrite = FALSE,
.api_url = NULL,
.send_headers = NULL
)The GraphQL query, as a string.
Name-value pairs giving API parameters. Will be matched
into endpoint placeholders, sent as query parameters in GET
requests, and as a JSON body of POST requests. If there is only one
unnamed parameter, and it is a raw vector, then it will not be JSON
encoded, but sent as raw data, as is. This can be used for example to
add assets to releases. Named NULL values are silently dropped,
and named NA values trigger an error.
Authentication token. Defaults to GITHUB_PAT or
GITHUB_TOKEN environment variables, in this order if any is set.
See gh_token() if you need more flexibility, e.g. different tokens
for different GitHub Enterprise deployments.
path to write response to disk. If NULL (default), response will be processed and returned as an object. If path is given, response will be written to disk in the form sent.
if .destfile is provided, whether to overwrite an
existing file. Defaults to FALSE.
Github API url (default: https://api.github.com). Used
if endpoint just contains a path. Defaults to GITHUB_API_URL
environment variable if set.
Named character vector of header field values
(except Authorization, which is handled via .token). This can be
used to override or augment the default User-Agent header:
"https://github.com/r-lib/gh".
Note: pagination and the .limit argument does not work currently,
as pagination in the GraphQL API is different from the v3 API.
If you need pagination with GraphQL, you'll need to do that manually.
gh() for the GitHub v3 API.
# NOT RUN {
gh_gql("query { viewer { login }}")
# }
Run the code above in your browser using DataLab