From cbf059accad64c48ac4b24cab171b457e802f392 Mon Sep 17 00:00:00 2001 From: Samuel Andert Date: Mon, 7 Aug 2023 15:29:02 +0200 Subject: [PATCH] remapping gql from placeholder to $me.store --- src/lib/components/refactor/ComposerGraph.svelte | 4 ++-- src/lib/core/refactor/Composer.svelte | 16 +++++++++------- src/routes/graphql/+page.gql | 1 + src/routes/graphql/+page.svelte | 12 ++---------- 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/lib/components/refactor/ComposerGraph.svelte b/src/lib/components/refactor/ComposerGraph.svelte index e517d7b..bc3cfa0 100644 --- a/src/lib/components/refactor/ComposerGraph.svelte +++ b/src/lib/components/refactor/ComposerGraph.svelte @@ -14,8 +14,8 @@ {/if}
dataTest: - {#if $me.x} - {JSON.stringify($me.x)} + {#if $me.store} + {JSON.stringify($me.store.test)} {/if} diff --git a/src/lib/core/refactor/Composer.svelte b/src/lib/core/refactor/Composer.svelte index baba950..5d63e3c 100644 --- a/src/lib/core/refactor/Composer.svelte +++ b/src/lib/core/refactor/Composer.svelte @@ -60,13 +60,15 @@ subscribeAndMapQueries(component.id, component.data.map); } if (component.data?.gql) { - getComposerStore(component.id).update((storeValue) => ({ - ...storeValue, - x: { - ...storeValue.x, - ...component.data.gql - } - })); + getComposerStore(component.id).update((storeValue) => { + return { + ...storeValue, + store: { + ...storeValue.store, + ...component.data.gql + } + }; + }); } } getComposerStore(component.id).update((storeValue) => ({ diff --git a/src/routes/graphql/+page.gql b/src/routes/graphql/+page.gql index bddea90..55cccf6 100644 --- a/src/routes/graphql/+page.gql +++ b/src/routes/graphql/+page.gql @@ -2,5 +2,6 @@ query queryTest { repoGet(owner: "samuelandert.eth", repo: "learn") { id name + link } } diff --git a/src/routes/graphql/+page.svelte b/src/routes/graphql/+page.svelte index bc5416c..6a9e433 100644 --- a/src/routes/graphql/+page.svelte +++ b/src/routes/graphql/+page.svelte @@ -1,8 +1,7 @@ -{#if $queryTest} - {JSON.stringify($queryTest.data, null, 2)} -{/if} -