added basic houdini graphql client incl. test query
This commit is contained in:
15
src/client.ts
Normal file
15
src/client.ts
Normal 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}`,
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
})
|
6
src/routes/test/+page.gql
Normal file
6
src/routes/test/+page.gql
Normal file
@ -0,0 +1,6 @@
|
||||
query queryTest {
|
||||
repoGet(owner: "samuelandert.eth", repo: "learn") {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
@ -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} />
|
||||
|
Reference in New Issue
Block a user