{"repo":"shurcooL/githubv4","free":true,"listed":false,"github":"https://github.com/shurcooL/githubv4","clone":"git clone https://github.com/shurcooL/githubv4.git","description":"Package githubv4 is a client library for accessing GitHub GraphQL API v4 (https://docs.github.com/en/graphql).","language":"Go","stars":1198,"topics":["go","github","graphql","client"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"githubv4 ======== Package githubv4 is a client library for accessing GitHub GraphQL API v4 (https://docs.github.com/en/graphql). If you're looking for a client library for GitHub REST API v3, the recommended package is github (also known as go-github ). Focus ----- - Friendly, simple and powerful API. - Correctness, high performance and efficiency. - Support all of GitHub GraphQL API v4 via code generation from schema. Installation ------------ Usage ----- Authentication GitHub GraphQL API v4 requires authentication. The githubv4 package does not directly handle authentication. Instead, when creating a new client, you're expected to pass an http.Client that performs authentication. The easiest and recommended way to do this is to use the golang.org/x/oauth2 package. You'll need an OAuth token from GitHub (for example, a personal API token) with the right scopes. Then: If you are using GitHub Enterprise, use githubv4.NewEnterpriseClient : Simple Query To make a query, you need to define a Go type that corresponds to the GitHub GraphQL schema, and contains the fields you're interested in querying. You can look up the GitHub GraphQL schema at https://docs.github.com/en/graphql/reference/queries. For example, to make the following GraphQL query: You can define this variable: Then call client.Query , passing a pointer to it: Scalar Types For each scalar in the GitHub GraphQL schema listed at https://docs.github.com/en/graphql/reference/scalars, there is a corresponding Go type in ","default_branch":null,"files":null,"tree":[],"storefront":"/r/shurcooL","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/shurcooL/githubv4/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."}