Github api v4

From wikinotes

Documentation

api reference https://docs.github.com/en/free-pro-team@latest/graphql/reference
api docs https://docs.github.com/en/free-pro-team@latest/graphql/overview/about-the-graphql-api
public schema dl https://docs.github.com/en/free-pro-team@latest/graphql/overview/public-schema

Locations

https://api.github.com/graphql graphql endpoint (for all queries)
https://docs.github.com/public/schema.docs.graphql public schema

Example

curl \
  -H "Content-Type: application/json" \
  -H "Authorization: bearer ${token}" \
  -X POST \
  -d '{"query": "query {repository(owner: \"willjp\", name: \"multivolumecopy\"){ description }}"}' \
  https://api.github.com/graphql

# {"data":{"repository":{"description":"Backup fileserver contents onto multiple smaller hard-drives."}}}