Files
ghaymah-dns-net-sec-tests/scripts/check_app_logs.js
T

21 lines
695 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: `mutation AppLogs($appId: String!, $max: Int!) {
appLogs(arg1: { appId: $appId, max: $max }) {
timestamp message source severity
}
}`,
variables: { appId: '3d5666fe-95db-4e73-b6b2-dd0e41fca7f6', max: 50 }
})
});
console.log('AppLogs result:\n', JSON.stringify(await res.json(), null, 2));
}
main().catch(console.error);