Skip to content

Instantly share code, notes, and snippets.

@jdivock
Last active October 2, 2015 20:57
Show Gist options
  • Save jdivock/47a576b0cf4c6fe464a1 to your computer and use it in GitHub Desktop.
Save jdivock/47a576b0cf4c6fe464a1 to your computer and use it in GitHub Desktop.
graphql snippets
fragment JayFragment on Account {
email,
id
}
query UseFragment {
jay: account(id: 1) {
...JayFragment
}
}
{
__schema {
queryType {
name,
fields {
name,
description
}
}
}
}
{
account: account(id:1) {
id,
name,
workouts {
id,
name,
date
}
},
workout: workout(id:1) {
id,
name
},
lift: lift(id:1) {
id,
name
},
accounts: accounts {
id,
email
}
}
mutation M {
addLift(workoutid: 1, name: "test 5 lift", reps: 2, sets: 5, weight: 100) {
id,
name,
reps,
workoutid,
workout {
name,
id
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment