Skip to content

Commit

Permalink
chore: update relay example to latest main
Browse files Browse the repository at this point in the history
  • Loading branch information
maraisr committed Nov 22, 2021
1 parent aba7ad1 commit 3296c31
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 24 deletions.
26 changes: 15 additions & 11 deletions examples/relay-with-helix/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,29 @@ import type { App_SecondLyric$key } from './__generated__/App_SecondLyric.graphq

const SecondVerse: FC<{ fragRef: App_SecondLyric$key }> = ({ fragRef }) => {
const data = useFragment(
graphql`fragment App_SecondLyric on Song {
secondVerse
}`,
graphql`
fragment App_SecondLyric on Song {
secondVerse
}
`,
fragRef,
);

return <p>{data.secondVerse}</p>;
};
const Songs = () => {
const data = useLazyLoadQuery<App_Query>(
graphql`query App_Query {
song {
firstVerse
...App_SecondLyric @defer
}
alphabet @stream(initial_count: 3) {
char
graphql`
query App_Query {
song {
firstVerse
...App_SecondLyric @defer
}
alphabet @stream(initial_count: 3) {
char
}
}
}`,
`,
{},
);

Expand Down
24 changes: 12 additions & 12 deletions examples/relay-with-helix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"version": "0.0.1",
"scripts": {
"relay": "relay-compiler-experimental relay.json",
"relay": "relay-compiler relay.json",
"start": "tsm server.ts"
},
"engines": {
Expand All @@ -13,26 +13,26 @@
"@polka/parse": "1.0.0-next.21",
"@polka/send": "1.0.0-next.15",
"graphql": "15.4.0-experimental-stream-defer.1",
"graphql-helix": "1.8.3",
"graphql-helix": "1.10.2",
"meros": "1.1.4",
"polka": "1.0.0-next.22",
"react": "0.0.0-experimental-44cdfd6b7",
"react-dom": "0.0.0-experimental-44cdfd6b7",
"react-relay": "0.0.0-main-2219c43b",
"relay-runtime": "0.0.0-main-2219c43b"
"react": "18.0.0-beta-149b420f6-20211119",
"react-dom": "18.0.0-beta-149b420f6-20211119",
"react-relay": "0.0.0-main-2d5d60fc",
"relay-runtime": "0.0.0-main-2d5d60fc"
},
"devDependencies": {
"@marais/tsconfig": "0.0.1",
"@types/react-relay": "11.0.2",
"@types/relay-runtime": "12.0.0",
"@vitejs/plugin-react-refresh": "1.3.6",
"relay-compiler-experimental": "0.0.0-main-2219c43b",
"tsm": "2.1.2",
"typescript": "4.4.4",
"vite": "2.6.10",
"vite-plugin-relay": "1.0.6"
"relay-compiler": "0.0.0-main-2d5d60fc",
"tsm": "2.1.4",
"typescript": "4.5.2",
"vite": "2.6.14",
"vite-plugin-relay": "1.0.7"
},
"volta": {
"node": "16.11.1"
"node": "16.13.0"
}
}
1 change: 0 additions & 1 deletion examples/relay-with-helix/relay.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"schema": "schema.graphql",
"language": "typescript",
"useImportTypeSyntax": true,
"shouldGenerateParametersFile": true,
"requireCustomScalarTypes": true
}
}
Expand Down
3 changes: 3 additions & 0 deletions examples/relay-with-helix/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import relay from 'vite-plugin-relay';

const vite_app = await viteServer({
plugins: [reactRefresh(), relay.default],
define: {
global: 'globalThis',
},
server: {
middlewareMode: 'html',
},
Expand Down

0 comments on commit 3296c31

Please sign in to comment.