Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 461 Bytes

graphql-client.md

File metadata and controls

15 lines (11 loc) · 461 Bytes

GraphQL client

import requests

url = 'https://api.github.com/graphql'
json = { 'query' : '{ viewer { repositories(first: 30) { totalCount pageInfo { hasNextPage endCursor } edges { node { name } } } } }' }
api_token = "your api token here..."
headers = {'Authorization': 'token %s' % api_token}

r = requests.post(url=url, json=json, headers=headers)
print (r.text)

https://stackoverflow.com/a/46271487