25 lines
710 B
JavaScript
25 lines
710 B
JavaScript
const { getAuth } = require('./auth_manager');
|
|
|
|
async function main() {
|
|
const td = await getAuth();
|
|
const res = await fetch('https://graphql.ghaymah.systems/v1/graphql', {
|
|
method: 'POST',
|
|
headers: { 'Authorization': 'Bearer ' + td.token, 'Content-Type': 'application/json' },
|
|
body: JSON.stringify({
|
|
query: `query {
|
|
ghaymah_cloud_row_event(
|
|
where: { app_id: { _eq: "07131052-d08b-4053-8942-1b36a4d89818" } },
|
|
order_by: { event_date: desc },
|
|
limit: 5
|
|
) {
|
|
id app_id event_date running values
|
|
}
|
|
}`
|
|
})
|
|
});
|
|
const data = await res.json();
|
|
console.log(JSON.stringify(data, null, 2));
|
|
}
|
|
|
|
main().catch(console.error);
|