init
This commit is contained in:
33
src/index.ts
Normal file
33
src/index.ts
Normal 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));
|
||||
})();
|
||||
Reference in New Issue
Block a user