Skip to content

Commit

Permalink
Fix react handle references (HoudiniGraphql#1291)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecAivazis authored and ewen-lbh committed Dec 21, 2024
1 parent 11a3538 commit 9c2e224
Show file tree
Hide file tree
Showing 58 changed files with 3,316 additions and 128 deletions.
5 changes: 5 additions & 0 deletions .changeset/modern-students-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'houdini-react': patch
---

Fix $handle reference
7 changes: 5 additions & 2 deletions e2e/_api/graphql.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ let monkeys = [
]

// example data
const dataUsers = [
export const dataUsers = [
{
id: '1',
name: 'Bruce Willis',
Expand Down Expand Up @@ -135,7 +135,7 @@ const listA = []
const listB = []

const userSnapshots = {}
function getUserSnapshot(snapshot) {
export function getUserSnapshot(snapshot) {
if (!userSnapshots[snapshot]) {
userSnapshots[snapshot] = dataUsers.map((user) => ({
...user,
Expand Down Expand Up @@ -325,6 +325,9 @@ export const resolvers = {

return null
},
avatarURL: (user, { size }) => {
return !size ? user.avatarURL : user.avatarURL + `?size=${size}`
},
},

Mutation: {
Expand Down
9 changes: 9 additions & 0 deletions e2e/_api/graphql.mjs.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export type User = {
id: string
name: string
birthDate: Date
avatarURL: string
}

export const dataUsers: User[] = []
export function getUserSnapshot(snapshot: string): User {}
2 changes: 2 additions & 0 deletions e2e/react/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ dist-ssr
*.sln
*.sw?
vite.config.ts.*

test-results/
3 changes: 2 additions & 1 deletion e2e/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
"web": "vite dev",
"dev": "concurrently \"pnpm run web\" \"pnpm run api\" -n \"web,api\" -c \"green,magenta\"",
"build": "vite build",
"tests": "playwright test ",
"tests": "playwright test",
"test": "npm run tests",
"tw": "npx tailwindcss -i ./src/styles.css -o ./public/assets/output.css --watch",
"preview": "vite dev"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion e2e/react/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default defineConfig({
testIgnore: '**/$houdini/**',

webServer: {
command: 'npm run dev -- --port 3008',
command: 'PORT=3008 npm run dev',
port: 3008,
timeout: 120 * 1000,
},
Expand Down
Loading

0 comments on commit 9c2e224

Please sign in to comment.