This commit is contained in:
2025-02-18 09:19:28 +08:00
commit 0f576d5480
9 changed files with 359 additions and 0 deletions

33
src/index.ts Normal file
View File

@@ -0,0 +1,33 @@
import { ofetch } from 'ofetch';
const gqlText = `
query QueryAllUserProjects {
demo_users{
id
name
projects{
id
demo_projects_id{
id
name
}
}
}
}
`;
(async () => {
const result = await ofetch("http://172.16.6.246:8055/graphql", {
method: 'POST',
headers: {
'Authorization': 'Bearer WkVWFMiFcrjsXRZqsL30Cd4Sboe0DRk-',
'Content-Type': 'application/json',
},
body: {
query: gqlText,
variables: {}
},
})
console.log(JSON.stringify(result, null, 2));
})();