added the Todos query

This commit is contained in:
Samuel Andert 2023-08-25 11:50:36 +02:00
parent 842cd376cc
commit 8d4b217c99
4 changed files with 13 additions and 9 deletions

View File

@ -1,6 +1,10 @@
query Projects {
query Todos {
directus_todos {
id
task
user_created {
first_name
last_name
}
}
}

View File

@ -1,7 +1,6 @@
import axios from 'axios';
import fs from 'fs';
import dotenv from 'dotenv';
dotenv.config();
export async function fetchSchemas() {

View File

@ -20,7 +20,8 @@ const directus = introspect.graphql({
apiNamespace: 'directus',
loadSchemaFromString: directusSchema,
url: 'https://directus.andert.me/graphql',
headers: (builder) => builder.addStaticHeader('Authorization', 'Bearer Bv5RknRvv5AZouxcYdBJgVOe3ZC493Y3')
headers: (builder) => builder
.addStaticHeader('Authorization', 'Bearer Bv5RknRvv5AZouxcYdBJgVOe3ZC493Y3')
});
// configureWunderGraph emits the configuration

View File

@ -1,9 +1,9 @@
<script lang="ts">
import { createQuery } from "../lib/wundergraph";
const dragonsQuery = createQuery({
operationName: "Dragons",
});
// const dragonsQuery = createQuery({
// operationName: "Dragons",
// });
const projectsQuery = createQuery({
operationName: "Projects",
});
@ -12,7 +12,7 @@
});
</script>
Dragons
<!-- Dragons
<div class="results">
{#if $dragonsQuery.isLoading}
<p>Loading...</p>
@ -21,7 +21,7 @@ Dragons
{:else}
<pre>{JSON.stringify($dragonsQuery.data, null, 2)}</pre>
{/if}
</div>
</div> -->
Projects
<div class="results">
@ -34,7 +34,7 @@ Projects
{/if}
</div>
Tasks
Todos
<div class="results">
{#if $todosQuery.isLoading}
<p>Loading...</p>