Skip to content

Commit 0233a2d

Browse files
Update codegen types and enforce keeping types up-to-date (#7580)
Codegen wasn't detecting our operation since it needed a "magic GraphQL comment" to be picked up. We also had no CI step to enforce that these stay current, so I added that as well.
1 parent 3d0d4b4 commit 0233a2d

File tree

5 files changed

+5874
-506
lines changed

5 files changed

+5874
-506
lines changed

.changeset/gorgeous-chairs-invent.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.circleci/config.yml

+8
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ jobs:
107107
- setup-node
108108
- run: npm run spell-check
109109

110+
Codegen check:
111+
docker:
112+
- image: cimg/base:stable
113+
steps:
114+
- setup-node
115+
- run: npm run codegen-check
116+
110117
# We make CI fail if any file contains FIX and ME right next to each other.
111118
# This means that when working on a big PR, you can throw in notes that you
112119
# are forced to come back to before merging the PR. Note that we don't block
@@ -140,6 +147,7 @@ workflows:
140147
- Prettier
141148
- ESLint
142149
- Spell check
150+
- Codegen check
143151
- Smoke test built package
144152
- Full incremental delivery tests with graphql-js 17 canary
145153
- Changesets

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"coverage": "npm test -- --coverage",
2222
"coverage:upload": "codecov",
2323
"codegen": "graphql-codegen",
24+
"codegen-check": "(npm run codegen && npm run compile) || (echo 'Current schema types are incompatible with existing usage. Update generated types with `npm run codegen` and resolve any TypeScript errors.'; exit 1)",
2425
"lint": "eslint .",
2526
"prettier-check": "prettier --check .",
2627
"prettier-fix": "prettier --write .",

0 commit comments

Comments
 (0)