diff options
| author | Wes Bos <wesbos@gmail.com> | 2017-10-27 13:24:41 -0400 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2017-10-27 13:24:41 -0400 |
| commit | 0f1b9240bbd05b377e868faf78b89b509a3d7537 (patch) | |
| tree | 1974b4d5a59f1843f64789b5536c32606a097ba0 /functions/getPrice.js | |
| parent | acdfa2840f867e686471a8e9ac3f29353fab7dd1 (diff) | |
ayeee
Diffstat (limited to 'functions/getPrice.js')
| -rw-r--r-- | functions/getPrice.js | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/functions/getPrice.js b/functions/getPrice.js deleted file mode 100644 index 7808a85..0000000 --- a/functions/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) -} |
