Skip to content

Commit

Permalink
Update codegen types and enforce keeping types up-to-date (#7580)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
trevor-scheer committed May 25, 2023
1 parent 3d0d4b4 commit 0233a2d
Show file tree
Hide file tree
Showing 5 changed files with 5,874 additions and 506 deletions.
2 changes: 2 additions & 0 deletions .changeset/gorgeous-chairs-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
8 changes: 8 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ jobs:
- setup-node
- run: npm run spell-check

Codegen check:
docker:
- image: cimg/base:stable
steps:
- setup-node
- run: npm run codegen-check

# We make CI fail if any file contains FIX and ME right next to each other.
# This means that when working on a big PR, you can throw in notes that you
# are forced to come back to before merging the PR. Note that we don't block
Expand Down Expand Up @@ -140,6 +147,7 @@ workflows:
- Prettier
- ESLint
- Spell check
- Codegen check
- Smoke test built package
- Full incremental delivery tests with graphql-js 17 canary
- Changesets
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"coverage": "npm test -- --coverage",
"coverage:upload": "codecov",
"codegen": "graphql-codegen",
"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)",
"lint": "eslint .",
"prettier-check": "prettier --check .",
"prettier-fix": "prettier --write .",
Expand Down
Loading

0 comments on commit 0233a2d

Please sign in to comment.