Last active
February 7, 2023 02:50
-
-
Save cmdoret/0c0d134704129f7bf195f57294c680df to your computer and use it in GitHub Desktop.
Github GraphQL query for Gimie
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import requests | |
TOKEN = os.getenv('ACCESS_TOKEN') | |
body = """ | |
{ | |
viewer { | |
login | |
} | |
repository(name: "renku", owner: "SwissDataScienceCenter") { | |
owner { | |
login | |
avatarUrl | |
... on User { | |
company | |
name | |
organizations(first: 100) { | |
edges { | |
node { | |
avatarUrl | |
description | |
login | |
name | |
} | |
} | |
} | |
login | |
} | |
} | |
createdAt | |
name | |
updatedAt | |
url | |
latestRelease { | |
name | |
releaseAssets(first: 10) { | |
nodes { | |
downloadUrl | |
} | |
} | |
} | |
primaryLanguage { | |
name | |
} | |
mentionableUsers(first: 100) { | |
nodes { | |
login | |
name | |
avatarUrl | |
company | |
organizations(first: 100) { | |
nodes { | |
avatarUrl | |
description | |
name | |
login | |
} | |
} | |
} | |
} | |
} | |
} | |
""" | |
url = "https://api.github.com/graphql" | |
resp = requests.post(url=url, json={'query': body}, headers={"Authorization": "bearer " + TOKEN}) | |
if resp.status_code == 200: | |
print(resp.content) | |
else: | |
print(resp) | |
print(resp.__dict__) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment