-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add toggle to docs between typescript and jsdocs (#791)
* Tweak docs for endpoints (#785) * ✏️ DOC: tweaks * ✏️ FIX: \t to ' ' * Fix error when prerendering application (#786) * don't add session infrastructure when static is set to true * use existing static config value * changeset * unused import * 📦 v0.19.2 (#788) * 📦 v{VERSION} * update changelogs * oops Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Alec Aivazis <[email protected]> * add js/ts toggle * fix search input sizing * duplicate code examples and implement toggle * convert all blocks to typescript * transform handles variable declaration type signatures * transform function parameters * transform svelte documents * add type definitions to rest of getting started guide * update guides * add types to authentication docs * remove semicolon * update snapshots * move typescript test to js Co-authored-by: JYC <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
14ceac0
commit bf3e525
Showing
57 changed files
with
1,540 additions
and
1,135 deletions.
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 |
---|---|---|
|
@@ -19,3 +19,5 @@ $houdini | |
build/** | ||
dist/** | ||
.next/** | ||
|
||
vite.config.js.timestamp-* |
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
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
26 changes: 26 additions & 0 deletions
26
e2e/sveltekit/src/routes/stores/action-mutation/+page.server.js
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,26 @@ | ||
import { graphql } from '$houdini'; | ||
import { fail } from '@sveltejs/kit'; | ||
|
||
/** @type {import('./$types').Actions} */ | ||
export const actions = { | ||
add: async (event) => { | ||
const data = await event.request.formData(); | ||
|
||
const name = data.get('name')?.toString(); | ||
|
||
if (!name) { | ||
return fail(403, { name: '*' }); | ||
} | ||
|
||
const actionMutation = graphql(` | ||
mutation ActionMutation($name: String!) { | ||
addUser(name: $name, birthDate: 254143016000, snapshot: "ActionMutation") { | ||
id | ||
name | ||
} | ||
} | ||
`); | ||
|
||
return await actionMutation.mutate({ name }); | ||
} | ||
}; |
21 changes: 21 additions & 0 deletions
21
e2e/sveltekit/src/routes/stores/action-mutation/+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,21 @@ | ||
<script> | ||
import { enhance } from '$app/forms'; | ||
/** @type {import('./$types').ActionData} */ | ||
export let form; | ||
</script> | ||
|
||
<form method="POST" action="?/add" use:enhance> | ||
<label> | ||
Name | ||
<input name="name" type="name" /> | ||
</label> | ||
<span id="name-error" | ||
>{#if form?.name}{form?.name}{/if}</span | ||
> | ||
<button type="submit">Add</button> | ||
</form> | ||
|
||
<div id="result"> | ||
{form?.addUser?.name || 'No user added'} | ||
</div> |
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,36 @@ | ||
import { sleep } from '@kitql/helper'; | ||
import { test } from '@playwright/test'; | ||
import { routes } from '../../../lib/utils/routes.js'; | ||
import { expectToBe, goto } from '../../../lib/utils/testsHelper.js'; | ||
|
||
test.describe('action-mutation', () => { | ||
test('happy path action-mutation ', async ({ page }) => { | ||
await goto(page, routes.Stores_action_mutation); | ||
|
||
await expectToBe(page, 'No user added'); | ||
|
||
// click the button | ||
await Promise.all([ | ||
page.waitForResponse((res) => res.url().endsWith('action-mutation?/add'), { timeout: 1000 }), | ||
page.getByRole('button', { name: 'Add' }).click() | ||
]); | ||
|
||
// a start should be displayed | ||
await expectToBe(page, '*', 'span[id=name-error]'); | ||
|
||
// fill the input | ||
await page.getByLabel('Name').fill('My New Name'); | ||
|
||
// add | ||
await Promise.all([ | ||
page.waitForResponse((res) => res.url().endsWith('action-mutation?/add'), { timeout: 1000 }), | ||
page.getByRole('button', { name: 'Add' }).click() | ||
]); | ||
|
||
// wait for the message to appear | ||
await sleep(500); | ||
|
||
// check that we have the right data | ||
await expectToBe(page, 'My New Name'); | ||
}); | ||
}); |
6 changes: 3 additions & 3 deletions
6
...tes/stores/endpoint-query/+page.server.ts → ...tes/stores/endpoint-query/+page.server.js
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { GQL_Hello } from '$houdini'; | ||
import type { RequestEvent } from '@sveltejs/kit'; | ||
|
||
export async function load(event: RequestEvent) { | ||
/** @type {import('./$types').PageServerLoad} */ | ||
export const load = async (event) => { | ||
const { data } = await GQL_Hello.fetch({ event }); | ||
|
||
return { hello: data?.hello }; | ||
} | ||
}; |
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# houdini-plugin-svelte-global-stores | ||
|
||
## 0.19.2 | ||
|
||
## 0.19.1 | ||
|
||
## 0.19.0 |
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
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
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
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# houdini-react | ||
|
||
## 0.19.2 | ||
|
||
## 0.19.1 | ||
|
||
## 0.19.0 | ||
|
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
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
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
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
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
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# houdini | ||
|
||
## 0.19.2 | ||
|
||
## 0.19.1 | ||
|
||
### 🐛 Fixes | ||
|
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
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
Oops, something went wrong.