Skip to content

Commit 0dd689e

Browse files
dfallingclaude
andcommitted
Drop URL/introspection codegen path from docs
Codegen takes a local SDL file now; remove the get-graphql-schema example and URL variant from the README and codegen.ts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b3511db commit 0dd689e

2 files changed

Lines changed: 3 additions & 10 deletions

File tree

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,10 @@ Reload the app on device with `R` twice (emulator) or shake (physical device).
149149

150150
Queries/mutations live alongside the code they're used in (`src/**/*.graphql`).
151151
The 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
157155
bun run codegen ./schema.graphql
158-
159-
# or hit the running endpoint directly:
160-
bun run codegen http://localhost:4000/api/graphql
161156
```
162157

163158
Output: `src/graphql/__generated__/types.ts` — committed to the repo. CI

codegen.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import 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
75
const schema = process.argv.find(
86
(a, i) => i > 1 && !a.startsWith('-') && process.argv[i - 1] !== '--config',
97
);
108
if (!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

1412
const config: CodegenConfig = {

0 commit comments

Comments
 (0)