{"repo":"octokit/graphql.js","free":true,"listed":false,"github":"https://github.com/octokit/graphql.js","clone":"git clone https://github.com/octokit/graphql.js.git","description":"GitHub GraphQL API client for browsers and Node","language":"TypeScript","stars":501,"topics":["graphql","octokit-js","sdk","hacktoberfest"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"graphql.js GitHub GraphQL API client for browsers and Node - Usage - Send a simple query - Authentication - Variables - Pass query together with headers and variables - Use with GitHub Enterprise - Use custom @octokit/request instance - TypeScript - Additional Types - Errors - Partial responses - Writing tests - License Usage Browsers Load @octokit/graphql directly from esm.sh Node Install with npm install @octokit/graphql Send a simple query Authentication The simplest way to authenticate a request is to set the Authorization header, e.g. to a personal access token. For more complex authentication strategies such as GitHub Apps or Basic, we recommend the according authentication library exported by @octokit/auth . Variables ⚠️ Do not use template literals in the query strings as they make your code vulnerable to query injection attacks (see #2). Use variables instead: Pass query together with headers and variables Use with GitHub Enterprise Use custom @octokit/request instance TypeScript @octokit/graphql is exposing proper types for its usage with TypeScript projects. Additional Types Additionally, GraphQlQueryResponseData has been exposed to users: Errors In case of a GraphQL error, error.message is set to a combined message describing all errors returned by the endpoint. All errors can be accessed at error.errors . error.request has the request options such as query, variables and headers set for easier debugging. Partial responses A GraphQL query may respond with partial ","default_branch":null,"files":null,"tree":[],"storefront":"/r/octokit","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/octokit/graphql.js/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}