remapping gql from placeholder to $me.store
This commit is contained in:
parent
783548581c
commit
cbf059acca
@ -14,8 +14,8 @@
|
|||||||
{/if}
|
{/if}
|
||||||
<br />
|
<br />
|
||||||
dataTest:
|
dataTest:
|
||||||
{#if $me.x}
|
{#if $me.store}
|
||||||
{JSON.stringify($me.x)}
|
{JSON.stringify($me.store.test)}
|
||||||
{/if}
|
{/if}
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
@ -60,13 +60,15 @@
|
|||||||
subscribeAndMapQueries(component.id, component.data.map);
|
subscribeAndMapQueries(component.id, component.data.map);
|
||||||
}
|
}
|
||||||
if (component.data?.gql) {
|
if (component.data?.gql) {
|
||||||
getComposerStore(component.id).update((storeValue) => ({
|
getComposerStore(component.id).update((storeValue) => {
|
||||||
...storeValue,
|
return {
|
||||||
x: {
|
...storeValue,
|
||||||
...storeValue.x,
|
store: {
|
||||||
...component.data.gql
|
...storeValue.store,
|
||||||
}
|
...component.data.gql
|
||||||
}));
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getComposerStore(component.id).update((storeValue) => ({
|
getComposerStore(component.id).update((storeValue) => ({
|
||||||
|
@ -2,5 +2,6 @@ query queryTest {
|
|||||||
repoGet(owner: "samuelandert.eth", repo: "learn") {
|
repoGet(owner: "samuelandert.eth", repo: "learn") {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
|
link
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { PageData } from '../test/$houdini';
|
|
||||||
import Composer from '$lib/core/refactor/Composer.svelte';
|
import Composer from '$lib/core/refactor/Composer.svelte';
|
||||||
import { queryTodos } from '$lib/data/queryTodos';
|
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
|
import type { PageData } from '../test/$houdini';
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
@ -29,11 +28,8 @@
|
|||||||
id: 'ComposerGraph',
|
id: 'ComposerGraph',
|
||||||
component: 'ComposerGraph',
|
component: 'ComposerGraph',
|
||||||
data: {
|
data: {
|
||||||
map: {
|
|
||||||
todos: queryTodos
|
|
||||||
},
|
|
||||||
gql: {
|
gql: {
|
||||||
test: await $queryTest.data
|
test: $queryTest.data
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
machine: {
|
machine: {
|
||||||
@ -61,8 +57,4 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if $queryTest}
|
|
||||||
{JSON.stringify($queryTest.data, null, 2)}
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<Composer {composer} />
|
<Composer {composer} />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user