diff options
Diffstat (limited to 'graphcool-old/src/getPrice.js')
| -rw-r--r-- | graphcool-old/src/getPrice.js | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/graphcool-old/src/getPrice.js b/graphcool-old/src/getPrice.js deleted file mode 100644 index 7808a85..0000000 --- a/graphcool-old/src/getPrice.js +++ /dev/null @@ -1,26 +0,0 @@ -require('isomorphic-fetch') - -const query = ` -query SingleItem { - Item(id: "cj64bs7vuuqgu0116ul5cm223") { - price - } -} -`; - -function getItem(id) { - return fetch('https://api.graph.cool/simple/v1/cj5xz8szs28930145gct82bdj', { - method: 'post', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify({ query }), - }) -} - - -module.exports = function(event) { - getItem().then(x => x.json()).then(res => { - console.log(res.data.Item.price); - }).catch(console.log) -} |
