Skip to content

Instantly share code, notes, and snippets.

@tlimpanont
Last active January 6, 2021 05:33
Show Gist options
  • Save tlimpanont/f30a085515e1b6706587398e87ff1b5d to your computer and use it in GitHub Desktop.
Save tlimpanont/f30a085515e1b6706587398e87ff1b5d to your computer and use it in GitHub Desktop.
create workout app
{
"name": "Workout name",
"difficulty": 1,
"duration": 1,
"asset": {
"url": "www.assets.com",
"type": "video/mp4"
},
"rounds": [
{
"order": 1,
"round_exercises": {
"data": [
{
"order": 1,
"type": "DURATION",
"value": 60,
"exercise": {
"on_conflict": {
"constraint": "exercises_name_key",
"update_columns": ["name"]
},
"data": {
"name": "Exercise name",
"assets": {
"data": [
{
"order": 1,
"url": "www.assets.com",
"type": "video/mp4"
}
]
}
}
}
}
]
}
}
]
}
mutation insert_workouts_one(
$name: String!
$difficulty: Int!
$duration: Int!
$asset: assets_insert_input!
$rounds: [rounds_insert_input!]!
) {
insert_workouts_one(
on_conflict: { constraint: workouts_name_key, update_columns: [name] }
object: {
asset: { data: $asset }
name: $name
difficulty: $difficulty
duration: $duration
rounds: { data: $rounds }
}
) {
name
id
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment