mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-18 13:02:11 +03:00
33 lines
632 B
JavaScript
33 lines
632 B
JavaScript
const fetch = require('node-fetch');
|
|
|
|
const db = async () => {
|
|
const response = await fetch(
|
|
'https://bazookaand.herokuapp.com/v1alpha1/graphql',
|
|
{
|
|
method: 'POST',
|
|
headers: {
|
|
'x-hasura-access-key': 'advancedbitch'
|
|
},
|
|
body: JSON.stringify({
|
|
query: `
|
|
query {
|
|
items {
|
|
id
|
|
item
|
|
order_id
|
|
}
|
|
users {
|
|
id
|
|
name
|
|
balance
|
|
}
|
|
}
|
|
`,
|
|
})
|
|
}
|
|
);
|
|
const respObj = await response.json();
|
|
return respObj.data;
|
|
}
|
|
|
|
module.exports = db; |