[Python] How to consume the Github GraphQL API using Python?

Discussão em 'Python' iniciado por Stack, Julho 21, 2025.

  1. Stack

    Stack Membro Participativo

    I want to access details from Github using Github GraphQl v4 API. I found Graphene library, but I'm not sure how to authenticate with a personal access token in Python.
    I tried to search on Google but couldn't found any example. It's Python library that can create graphical schema's and are not for consuming them, I tried with `requests' but failed. How can i authenticate and can find list of repositories?

    I have used Github GraphQl explorer to find list of repositories via this code:

    viewer {
    repositories(first: 30) {
    totalCount
    pageInfo {
    hasNextPage
    endCursor
    }
    edges {
    node {
    name
    }
    }
    }

    Continue reading...

Compartilhe esta Página