Skip to content

Instantly share code, notes, and snippets.

@appwiz
Last active October 16, 2018 22:02
Show Gist options
  • Save appwiz/1a9ce4b6123b1c1f16dfcaf1bc766747 to your computer and use it in GitHub Desktop.
Save appwiz/1a9ce4b6123b1c1f16dfcaf1bc766747 to your computer and use it in GitHub Desktop.
GraphQL queries
# Click the orange "Play" button and select the createColorCommand
# mutation to create an object in DynamoDB.
# If you see an error that starts with "Unable to assume role",
# wait a moment and try again.
mutation createColorCommand($createcolorcommandinput: CreateColorCommandInput!) {
createColorCommand(input: $createcolorcommandinput) {
id
timestamp
color
}
}
# After running createColorCommand, try running the listColorCommands query.
query listColorCommands {
listColorCommands {
items {
id
timestamp
color
}
}
}
subscription onCreate {
onCreateColorCommand {
id
timestamp
color
}
}
// query variables
{
"createcolorcommandinput": {
"id": "RU6T90JB8HBUJL1wzNML3ZF5HijG6YbY",
"timestamp": "Hello, world!",
"color": "Hello, world!"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment