R/graphql.R

Defines functions gh_graphql

Documented in gh_graphql

#' GitHub graphql client
#' @param token github token
gh_graphql <- function(token = NULL) {
  if (is.null(token)) {
    token <-
      gh::gh_token()
  }
  list(
    qry = ghql::Query$new(),
    cli = ghql::GraphqlClient$new(
      url = "https://api.github.com/graphql",
      headers = list(Authorization = paste0("Bearer ", token)))
  )
}
uribo/buckyR documentation built on Dec. 23, 2021, 2:02 p.m.