Skip to content

Instantly share code, notes, and snippets.

@obahareth
Created November 16, 2018 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save obahareth/27dee97371f72dc1c63d886580b24af2 to your computer and use it in GitHub Desktop.
Save obahareth/27dee97371f72dc1c63d886580b24af2 to your computer and use it in GitHub Desktop.
{
# The first 2 films, after a given cursor value
allFilms(first: 2, after: "YXJyYXljb25uZWN0aW9uOjA=") {
# An edge is an entry in a "list"
edges {
# Get a cursor value for each "edge"
# Used for pagination, in combination with filters like
# before and after.
cursor
# Each edge has a node, where the node has
# the data we're interested in
node {
# Film title, release date, and director
title
releaseDate
director
# The first 2 species that appeared in this film
speciesConnection(first: 2) {
edges {
node {
# The name of the species
name
}
}
}
}
}
}
}
{
"data": {
"allFilms": {
"edges": [
{
"cursor": "YXJyYXljb25uZWN0aW9uOjE=",
"node": {
"title": "The Empire Strikes Back",
"releaseDate": "1980-05-17",
"director": "Irvin Kershner",
"speciesConnection": {
"edges": [
{
"node": {
"name": "Human"
}
},
{
"node": {
"name": "Droid"
}
}
]
}
}
},
{
"cursor": "YXJyYXljb25uZWN0aW9uOjI=",
"node": {
"title": "Return of the Jedi",
"releaseDate": "1983-05-25",
"director": "Richard Marquand",
"speciesConnection": {
"edges": [
{
"node": {
"name": "Human"
}
},
{
"node": {
"name": "Droid"
}
}
]
}
}
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment