Last active
September 11, 2018 23:59
-
-
Save formigone/22babc532544894e739ae033dffafb14 to your computer and use it in GitHub Desktop.
Fetching data from AWS AppSync
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
query = ''' | |
{ | |
users { | |
id | |
created | |
firstName | |
lastName | |
} | |
} | |
''' | |
json = {'query': query} | |
headers = {'x-api-key': API_KEY} | |
req = requests.post(url=ENDPOINT, headers=headers, json=json) | |
data = req.json() | |
df = pd.DataFrame(data['data']['users']) | |
df = df.set_index('id') | |
df.head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment