Skip to content

Instantly share code, notes, and snippets.

@vincenzo
Last active July 1, 2018 22:44
Show Gist options
  • Save vincenzo/bb9296180b7da656b3c0b0389942c95e to your computer and use it in GitHub Desktop.
Save vincenzo/bb9296180b7da656b3c0b0389942c95e to your computer and use it in GitHub Desktop.
Nested test mutation
# One Subpage.
mutation {
createPage(data: {title:"Vincenzo", subpages: {create:{title:"Russo"}}}) {
id
title
subpages {
id
title
}
}
}
# One Subpage which also has another subpage.
mutation {
createPage(data: {title:"Page X", subpages: {create:{title:"Page Y", subpages: {create:{title: "Page Z"}}}}}) {
id
title
subpages {
id
title
subpages {
id
title
}
}
}
}
# Two Subpages.
mutation {
createPage(data: {title:"Yet", subpages: {create:[{title:"One more"}, {title:"And another"}]}}) {
id
title
subpages {
id
title
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment