-
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 🚧 FIX: api & vscode plugin settings * 🐛 FIX: query with custom first args * ✨ NEW: add @allList directive * ✏️ DOC: allList in changeset * Update packages/houdini/src/codegen/generators/artifacts/artifacts.test.ts Co-authored-by: Alec Aivazis <[email protected]> * ✏️ UPDATE: allList => AllLists * 👌 UPDATE: append && prepend * ✏️ FIX: naming * ✨ IMPROVE: feat + start e2e * 👌 UPDATE: artefacts => typecheck * 👌 UPDATE: tests * ✅ UPDATE: e2e tests * ⬆️ UPDATE: dep sveltekit * 🐛 FIX: type * @parentID is ignored when there's one list that doesn't match * remove ineffective parentID in operations * strengthen test * config Co-authored-by: Alec Aivazis <[email protected]>
- Loading branch information
1 parent
fe6f5ba
commit 6e36775
Showing
33 changed files
with
1,132 additions
and
428 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'houdini': patch | ||
--- | ||
|
||
Adding a new directive @allLists to update all lists after a mutation |
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,9 +1,9 @@ | ||
projects: | ||
default: | ||
sveltekit: | ||
# 👇 For vscode-graphql and intellisense | ||
schema: | ||
- e2e/api/*.graphql | ||
- e2e/$houdini/graphql/schema.graphql | ||
- e2e/_api/*.graphql | ||
- e2e/sveltekit/$houdini/graphql/schema.graphql | ||
documents: | ||
- e2e/src/**/*.gql | ||
- e2e/$houdini/graphql/documents.gql | ||
- e2e/sveltekit/src/**/*.gql | ||
- e2e/sveltekit/$houdini/graphql/documents.gql |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
query ListAll($limit: Int!) { | ||
userNodes(limit: $limit, snapshot: "lists-all") { | ||
totalCount | ||
nodes @list(name: "List_All") { | ||
id | ||
name | ||
} | ||
} | ||
} |
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,37 @@ | ||
<script lang="ts"> | ||
import { browser } from '$app/environment'; | ||
import { goto, invalidate } from '$app/navigation'; | ||
import { page } from '$app/stores'; | ||
import { GQL_ListAll_AddUser } from '$houdini'; | ||
import type { PageData } from './$houdini'; | ||
export let data: PageData; | ||
$: ({ ListAll } = data); | ||
let limit = parseInt($page.url.searchParams.get('limit') ?? '1', 10); | ||
$: browser && limit && updateQS(); | ||
async function updateQS() { | ||
$page.url.searchParams.set('limit', limit.toString()); | ||
const newUrl = $page.url.href; | ||
await invalidate(newUrl); | ||
await goto(newUrl, { replaceState: true, keepFocus: true }); | ||
} | ||
const add = async () => { | ||
await GQL_ListAll_AddUser.mutate(null); | ||
}; | ||
</script> | ||
|
||
<input type="number" bind:value={limit} /> | ||
<br /> | ||
<br /> | ||
<button on:click={add}>Add User</button> | ||
|
||
<h2>List</h2> | ||
<div id="result"> | ||
{#each $ListAll.data?.userNodes.nodes ?? [] as user} | ||
<div>{user?.name}</div> | ||
{/each} | ||
</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,10 @@ | ||
import type { PageLoad } from './$types'; | ||
import { load_ListAll } from '$houdini'; | ||
|
||
export const load: PageLoad = async (event) => { | ||
const limit = parseInt(event.url.searchParams.get('limit') ?? '1', 10); | ||
|
||
return { | ||
...(await load_ListAll({ event, variables: { limit } })) | ||
}; | ||
}; |
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 @@ | ||
mutation ListAll_AddUser { | ||
addUser(name: "Omar Sy", birthDate: 254143016000, snapshot: "List_All") { | ||
...List_All_insert @allLists @prepend | ||
} | ||
} |
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,44 @@ | ||
import { test } from '@playwright/test'; | ||
import { routes } from '../../lib/utils/routes.js'; | ||
import { expectToBe, expect_n_gql, goto } from '../../lib/utils/testsHelper.js'; | ||
|
||
test.describe('lists-all', () => { | ||
test('With 3 lists to append', async ({ page }) => { | ||
await goto(page, routes.lists_all); | ||
|
||
// select the input | ||
await page.locator('input[type="number"]').click(); | ||
// add 1 to the input to load a second list | ||
await expect_n_gql(page, 'input[type="number"]', 1, 'press_ArrowUp'); | ||
// add 1 to the input to load a third list | ||
await expect_n_gql(page, 'input[type="number"]', 1, 'press_ArrowUp'); | ||
|
||
// expect to have the righ data | ||
await expectToBe( | ||
page, | ||
'Bruce WillisSamuel JacksonMorgan FreemanTom HanksWill SmithHarrison FordEddie MurphyClint Eastwood' | ||
); | ||
|
||
// mutation to add a new actor (Expect to have 1 mutation) | ||
await expect_n_gql(page, 'text=Add User', 1); | ||
|
||
// expect to have the data added | ||
await expectToBe( | ||
page, | ||
'Omar SyBruce WillisSamuel JacksonMorgan FreemanTom HanksWill SmithHarrison FordEddie MurphyClint Eastwood' | ||
); | ||
|
||
// select the input | ||
await page.locator('input[type="number"]').click(); | ||
// go back 1 list, expect no graphql request (from cache!) | ||
await expect_n_gql(page, 'input[type="number"]', 0, 'press_ArrowDown'); | ||
// go back 1 list, expect no graphql request (from cache!) | ||
await expect_n_gql(page, 'input[type="number"]', 0, 'press_ArrowDown'); | ||
|
||
// expect the data to still contain the new actor | ||
await expectToBe( | ||
page, | ||
'Omar SyBruce WillisSamuel JacksonMorgan FreemanTom HanksWill SmithHarrison FordEddie MurphyClint Eastwood' | ||
); | ||
}); | ||
}); |
Oops, something went wrong.
6e36775
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
docs – ./site
docs-git-main-houdinigraphql.vercel.app
docs-phi-fawn.vercel.app
www.houdinigraphql.com
docs-houdinigraphql.vercel.app
houdinigraphql.com
6e36775
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
docs-next – ./site
docs-next-kohl.vercel.app
docs-next-git-main-houdinigraphql.vercel.app
docs-next-houdinigraphql.vercel.app