added basic graphql mapping
This commit is contained in:
parent
0c202e0ef6
commit
783548581c
@ -12,5 +12,10 @@
|
|||||||
<p>{todo.text}</p>
|
<p>{todo.text}</p>
|
||||||
{/each}
|
{/each}
|
||||||
{/if}
|
{/if}
|
||||||
|
<br />
|
||||||
|
dataTest:
|
||||||
|
{#if $me.x}
|
||||||
|
{JSON.stringify($me.x)}
|
||||||
|
{/if}
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
@ -59,6 +59,15 @@
|
|||||||
if (component.data?.map) {
|
if (component.data?.map) {
|
||||||
subscribeAndMapQueries(component.id, component.data.map);
|
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) => ({
|
getComposerStore(component.id).update((storeValue) => ({
|
||||||
...storeValue,
|
...storeValue,
|
||||||
|
@ -1,13 +1,17 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { PageData } from '../test/$houdini';
|
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 { queryTodos } from '$lib/data/queryTodos';
|
||||||
|
import { onMount } from 'svelte';
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
|
let composer;
|
||||||
|
|
||||||
$: ({ queryTest } = data);
|
$: ({ queryTest } = data);
|
||||||
|
|
||||||
let composer = {
|
onMount(async () => {
|
||||||
|
composer = await {
|
||||||
id: 'ComposerParent',
|
id: 'ComposerParent',
|
||||||
machine: {
|
machine: {
|
||||||
initial: 'NOTREADY',
|
initial: 'NOTREADY',
|
||||||
@ -27,6 +31,9 @@
|
|||||||
data: {
|
data: {
|
||||||
map: {
|
map: {
|
||||||
todos: queryTodos
|
todos: queryTodos
|
||||||
|
},
|
||||||
|
gql: {
|
||||||
|
test: await $queryTest.data
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
machine: {
|
machine: {
|
||||||
@ -51,8 +58,11 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{JSON.stringify($queryTest.data, null, 2)}
|
{#if $queryTest}
|
||||||
|
{JSON.stringify($queryTest.data, null, 2)}
|
||||||
|
{/if}
|
||||||
|
|
||||||
<Composer {composer} />
|
<Composer {composer} />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user