added basic houdini graphql client incl. test query

This commit is contained in:
Samuel Andert
2023-07-29 15:09:21 +02:00
parent 414705e0b4
commit fa5764c303
12 changed files with 8849 additions and 111 deletions

15
src/client.ts Normal file
View File

@ -0,0 +1,15 @@
import { HoudiniClient } from '$houdini';
export default new HoudiniClient({
url: 'https://graphql.andert.me/api/graphql'
// uncomment this to configure the network call (for things like authentication)
// for more information, please visit here: https://www.houdinigraphql.com/guides/authentication
// fetchParams({ session }) {
// return {
// headers: {
// Authentication: `Bearer ${session.token}`,
// }
// }
// }
})

View File

@ -0,0 +1,6 @@
query queryTest {
repoGet(owner: "samuelandert.eth", repo: "learn") {
id
name
}
}

View File

@ -1,5 +1,9 @@
<script>
<script lang="ts">
import Composite from '$lib/core/Composite.svelte';
import type { PageData } from './$houdini';
export let data: PageData;
$: ({ queryTest } = data);
let composite = {
id: 'test',
@ -26,4 +30,6 @@
};
</script>
<!-- {JSON.stringify($queryTest.data, null, 2)} -->
<Composite {composite} />