How to use the @octokit/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 actions / github-script / node_modules / @actions / github / lib / github.js View on Github external
constructor(token, opts = {}) {
        super(Object.assign(Object.assign({}, opts), { auth: `token ${token}` }));
        this.graphql = graphql_1.defaults({
            headers: { authorization: `token ${token}` }
        });
    }
}
github actions / typescript-action / node_modules / @actions / github / lib / github.js View on Github external
constructor(token) {
        super({ auth: `token ${token}` });
        this.graphql = graphql_1.defaults({
            headers: { authorization: `token ${token}` }
        });
    }
}
github dtinth / todo-actions / src / TaskManagementSystem.ts View on Github external
export async function createTask(
  information: TaskInformation,
): Promise {
  const graphql = require('@octokit/graphql').defaults({
    headers: {
      authorization: `token ${process.env.GITHUB_TOKEN ||
        invariant(false, 'Required GITHUB_TOKEN variable.')}`,
    },
  })
  const result = await graphql(
    `
      mutation CreateIssue($input: CreateIssueInput!) {
        createIssue(input: $input) {
          issue {
            number
          }
        }
      }
    `,
    {
github maierj / fastlane-action / .github / actions / statistics-chart-action / node_modules / @actions / github / lib / github.js View on Github external
constructor(token, opts = {}) {
        super(Object.assign(Object.assign({}, opts), { auth: `token ${token}` }));
        this.graphql = graphql_1.defaults({
            headers: { authorization: `token ${token}` }
        });
    }
}
github actions / hello-world-javascript-action / node_modules / @actions / github / lib / github.js View on Github external
constructor(token, opts = {}) {
        super(Object.assign(Object.assign({}, opts), { auth: `token ${token}` }));
        this.graphql = graphql_1.defaults({
            headers: { authorization: `token ${token}` }
        });
    }
}

@octokit/graphql

GitHub GraphQL API client for browsers and Node

MIT
Latest version published 8 days ago

Package Health Score

89 / 100
Full package analysis