How to use the @octokit/graphql.graphql.defaults function in @octokit/graphql

To help you get started, we’ve selected a few @octokit/graphql examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kidonng / scoop-docs / scripts / index-apps.js View on Github external
const { graphql } = require('@octokit/graphql')
const algoliasearch = require('algoliasearch')

const graphqlWithAuth = graphql.defaults({
  headers: { authorization: `token ${process.env.GITHUB_TOKEN}` }
})
const client = algoliasearch('F8ONSWSRN9', process.env.ALGOLIA_APIKEY)
const index = client.initIndex('scoop_apps')
const tmpIndex = client.initIndex('scoop_apps_tmp')

;(async () => {
  try {
    // Get known buckets
    const { repository } = await graphqlWithAuth(`
      {
        repository(owner: "lukesampson", name: "scoop") {
          object(expression: "master:buckets.json") {
            ... on Blob {
              text
            }
github Azure / dev-spaces / actions / add-review-url / AddReviewUrl.js View on Github external
function getGraphqlWithAuth(token) {
    return graphql.defaults({
        headers: {
            authorization: `token ${token}`
        }
    });
}
github Azure / dev-spaces / actions / add-review-url / AddReviewUrl.js View on Github external
function getGraphqlWithAuth(token) {
    return graphql.defaults({
        headers: {
            authorization: `token ${token}`
        }
    });
}
github Azure / dev-spaces / actions / add-review-url / src / AddReviewUrl.js View on Github external
getGraphqlWithAuth() {
    const token = core.getInput('repo-token');
    return graphql.defaults({
      headers: {
        authorization: `token ${token}`,
      },
    });
  }

@octokit/graphql

GitHub GraphQL API client for browsers and Node

MIT
Latest version published 8 months ago

Package Health Score

85 / 100
Full package analysis