If you're using PyGithub, use github.Github.requester.graphql_query()
github.Github.requester.graphql_query()