Skip to content

Instantly share code, notes, and snippets.

@cj
Created July 13, 2017 21:49
Show Gist options
  • Save cj/da59049ba2f48e1cdc263f64f4e85b15 to your computer and use it in GitHub Desktop.
Save cj/da59049ba2f48e1cdc263f64f4e85b15 to your computer and use it in GitHub Desktop.
fetch('https://api.graph.cool/simple/v1/cixos23120m0n0173veiiwrjr', {
method: 'post',
mode: 'cors',
headers: new Headers({'content-type': 'application/json'}),
body: JSON.stringify({
operationName: null,
query: `{
Movie(id: "cixos5gtq0ogi0126tvekxo27") {
id
title
actors {
name
}
}
}`,
variables: null
}),
}).then(function (response) {
return response.json()
}).then(function (data) {
console.log(data)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment