34 lines
952 B
JavaScript
34 lines
952 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 {
|
|
__type(name: "mutation_root") {
|
|
fields {
|
|
name
|
|
description
|
|
args {
|
|
name
|
|
type { name kind }
|
|
}
|
|
}
|
|
}
|
|
}`
|
|
})
|
|
});
|
|
const data = await res.json();
|
|
const fields = data.data?.__type?.fields || [];
|
|
console.log(`Total mutations: ${fields.length}`);
|
|
for (const f of fields) {
|
|
if (!f.name.startsWith('delete_') && !f.name.startsWith('insert_') && !f.name.startsWith('update_')) {
|
|
console.log(`- ${f.name} (${f.args.map(a => a.name).join(', ')})`);
|
|
}
|
|
}
|
|
}
|
|
|
|
main().catch(console.error);
|