File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -149,15 +149,10 @@ Reload the app on device with `R` twice (emulator) or shake (physical device).
149149
150150Queries/mutations live alongside the code they're used in (` src/**/*.graphql ` ).
151151The schema itself is ** not** committed — this is a public repo, so we don't
152- leak full introspection. Pass a path or URL as a positional arg :
152+ leak it. Drop an SDL file somewhere (gitignored) and pass its path :
153153
154154``` sh
155- # dump SDL locally (gitignored) and point codegen at it:
156- bunx get-graphql-schema http://localhost:4000/api/graphql > schema.graphql
157155bun run codegen ./schema.graphql
158-
159- # or hit the running endpoint directly:
160- bun run codegen http://localhost:4000/api/graphql
161156```
162157
163158Output: ` src/graphql/__generated__/types.ts ` — committed to the repo. CI
Original file line number Diff line number Diff line change 11import type { CodegenConfig } from '@graphql-codegen/cli' ;
22
3- // Schema is not committed (public repo — don't leak full introspection).
4- // Pass a path or URL as the last arg to `bun run codegen`:
3+ // Schema is not committed (public repo). Pass a local SDL path as the last arg:
54// bun run codegen ./schema.graphql
6- // bun run codegen http://localhost:4000/api/graphql
75const schema = process . argv . find (
86 ( a , i ) => i > 1 && ! a . startsWith ( '-' ) && process . argv [ i - 1 ] !== '--config' ,
97) ;
108if ( ! schema ) {
11- throw new Error ( 'Usage: bun run codegen <path-or-url- to-schema>' ) ;
9+ throw new Error ( 'Usage: bun run codegen <path-to-schema.graphql >' ) ;
1210}
1311
1412const config : CodegenConfig = {
You can’t perform that action at this time.
0 commit comments