-
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix typings of
loadAll()
function (#1209)
- Loading branch information
1 parent
ef77ca1
commit 392bd24
Showing
6 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'houdini-svelte': patch | ||
--- | ||
|
||
Fix typings of loadAll() function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
e2e/kit/src/routes/stores/ssr-loadall-store-without-variables/+page.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script lang="ts"> | ||
import { HelloStore } from '$houdini'; | ||
import type { PageData } from './$houdini'; | ||
export let data: PageData; | ||
$: ({ Hello } = data); | ||
const checkTypes = () => { | ||
return `${data.Hello instanceof HelloStore}`; | ||
}; | ||
</script> | ||
|
||
<h1>ssr-loadall-store-without-variables</h1> | ||
|
||
<div id="result"> | ||
{$Hello.data?.hello} | ||
</div> | ||
|
||
<div id="result-types"> | ||
{checkTypes()} | ||
</div> |
6 changes: 6 additions & 0 deletions
6
e2e/kit/src/routes/stores/ssr-loadall-store-without-variables/+page.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { load_Hello, loadAll } from '$houdini'; | ||
import type { LoadEvent } from '@sveltejs/kit'; | ||
|
||
export async function load(event: LoadEvent) { | ||
return await loadAll(load_Hello({ event })); | ||
} |
11 changes: 11 additions & 0 deletions
11
e2e/kit/src/routes/stores/ssr-loadall-store-without-variables/spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { test } from '@playwright/test'; | ||
import { routes } from '../../../lib/utils/routes.js'; | ||
import { expect_to_be, goto } from '../../../lib/utils/testsHelper.js'; | ||
|
||
test.describe('ssr-loadall-store-without-variables Page', () => { | ||
test('loadAll should brings correct types', async ({ page }) => { | ||
await goto(page, routes.Stores_SSR_LoadAll_Store_Without_Variables); | ||
|
||
await expect_to_be(page, 'true', 'div[id=result-types]'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters