From 8d4b217c999dfda3ab5f1a77f838bb713e7401ef Mon Sep 17 00:00:00 2001 From: Samuel Andert Date: Fri, 25 Aug 2023 11:50:36 +0200 Subject: [PATCH] added the Todos query --- .wundergraph/operations/Todos.graphql | 6 +++++- .wundergraph/schemas/fetch-schemas.js | 1 - .wundergraph/wundergraph.config.ts | 3 ++- src/routes/GraphQL.svelte | 12 ++++++------ 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.wundergraph/operations/Todos.graphql b/.wundergraph/operations/Todos.graphql index 4f28289..3468f89 100644 --- a/.wundergraph/operations/Todos.graphql +++ b/.wundergraph/operations/Todos.graphql @@ -1,6 +1,10 @@ -query Projects { +query Todos { directus_todos { id task + user_created { + first_name + last_name + } } } diff --git a/.wundergraph/schemas/fetch-schemas.js b/.wundergraph/schemas/fetch-schemas.js index 86c5a78..ccdc3b5 100644 --- a/.wundergraph/schemas/fetch-schemas.js +++ b/.wundergraph/schemas/fetch-schemas.js @@ -1,7 +1,6 @@ import axios from 'axios'; import fs from 'fs'; import dotenv from 'dotenv'; - dotenv.config(); export async function fetchSchemas() { diff --git a/.wundergraph/wundergraph.config.ts b/.wundergraph/wundergraph.config.ts index 346c80c..6c02478 100644 --- a/.wundergraph/wundergraph.config.ts +++ b/.wundergraph/wundergraph.config.ts @@ -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 diff --git a/src/routes/GraphQL.svelte b/src/routes/GraphQL.svelte index 0336b88..5cdd44b 100644 --- a/src/routes/GraphQL.svelte +++ b/src/routes/GraphQL.svelte @@ -1,9 +1,9 @@ -Dragons + Projects
@@ -34,7 +34,7 @@ Projects {/if}
-Tasks +Todos
{#if $todosQuery.isLoading}

Loading...