Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@octokit/graphql

Package Overview
Dependencies
Maintainers
4
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/graphql

GitHub GraphQL API client for browsers and Node

  • 8.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10M
decreased by-2.48%
Maintainers
4
Weekly downloads
 
Created

What is @octokit/graphql?

The @octokit/graphql npm package is designed to simplify making GraphQL queries to the GitHub API. It provides a straightforward way to execute queries and mutations, handle authentication, and manage GraphQL variables. This package is part of the Octokit suite, which is officially maintained by GitHub, ensuring high compatibility and reliability for developers interacting with GitHub's data.

What are @octokit/graphql's main functionalities?

Executing a GraphQL query

This feature allows you to execute a basic GraphQL query to fetch the login name of the authenticated GitHub user. You need to replace 'YOUR_GITHUB_TOKEN' with your actual GitHub token.

{
  "query": "query { viewer { login }}",
  "headers": {
    "authorization": "token YOUR_GITHUB_TOKEN"
  }
}

Executing a GraphQL mutation

This feature demonstrates how to execute a mutation to create a new issue in a repository. You need to replace 'REPOSITORY_ID' and 'YOUR_GITHUB_TOKEN' with your repository's ID and your GitHub token, respectively.

{
  "mutation": "mutation ($repositoryId: ID!, $issueTitle: String!) { createIssue(input: {repositoryId: $repositoryId, title: $issueTitle}) { issue { id } } }",
  "variables": {
    "repositoryId": "REPOSITORY_ID",
    "issueTitle": "New Issue Title"
  },
  "headers": {
    "authorization": "token YOUR_GITHUB_TOKEN"
  }
}

Other packages similar to @octokit/graphql

Keywords

FAQs

Package last updated on 15 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc