-
-
Save bschulz87/113cfc6caf62be12530b6de731e9a767 to your computer and use it in GitHub Desktop.
GraphQL requests using CURL
This file contains hidden or 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 | |
| curl \ | |
| -X POST \ | |
| -H "x-api-key: xxx-xxxx" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ "query": "query { listUsers { name } }" }' \ | |
| https://app-id.appsync-api.us-east-1.amazonaws.com/graphql | |
| # mutation with variables | |
| curl \ | |
| -X POST \ | |
| -H "x-api-key: xxx-xxxx" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ "query": "mutation($user: UserInput!) { createUser(user: $user) { name location id } }" , | |
| "variables": { | |
| "user": { | |
| "name": "Nader Dabit", | |
| "location": "United States", | |
| "id": "001" | |
| } | |
| } | |
| }' \ | |
| https://app-id.appsync-api.us-east-1.amazonaws.com/graphql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment