-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[cli] Handle partial generation success #10376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: federation-fixes
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: e7b390c The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
c000be1
to
9c57b83
Compare
🚀 Snapshot Release (
|
Package | Version | Info |
---|---|---|
@graphql-codegen/cli |
6.0.0-alpha-20250702094259-330e4c0c023358d9861caa216bc6e850fd799b01 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/core |
4.0.3-alpha-20250702094259-330e4c0c023358d9861caa216bc6e850fd799b01 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/add |
5.0.4-alpha-20250702094259-330e4c0c023358d9861caa216bc6e850fd799b01 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/fragment-matcher |
5.1.1-alpha-20250702094259-330e4c0c023358d9861caa216bc6e850fd799b01 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/introspection |
4.0.4-alpha-20250702094259-330e4c0c023358d9861caa216bc6e850fd799b01 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/schema-ast |
4.1.1-alpha-20250702094259-330e4c0c023358d9861caa216bc6e850fd799b01 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/time |
5.0.2-alpha-20250702094259-330e4c0c023358d9861caa216bc6e850fd799b01 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/visitor-plugin-common |
6.0.0-alpha-20250702094259-330e4c0c023358d9861caa216bc6e850fd799b01 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-document-nodes |
4.0.17-alpha-20250702094259-330e4c0c023358d9861caa216bc6e850fd799b01 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/gql-tag-operations |
4.0.18-alpha-20250702094259-330e4c0c023358d9861caa216bc6e850fd799b01 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-operations |
4.6.2-alpha-20250702094259-330e4c0c023358d9861caa216bc6e850fd799b01 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-resolvers |
5.0.0-alpha-20250702094259-330e4c0c023358d9861caa216bc6e850fd799b01 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typed-document-node |
5.1.3-alpha-20250702094259-330e4c0c023358d9861caa216bc6e850fd799b01 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript |
4.1.7-alpha-20250702094259-330e4c0c023358d9861caa216bc6e850fd799b01 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/client-preset |
4.8.4-alpha-20250702094259-330e4c0c023358d9861caa216bc6e850fd799b01 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/graphql-modules-preset |
4.0.18-alpha-20250702094259-330e4c0c023358d9861caa216bc6e850fd799b01 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/testing |
3.0.5-alpha-20250702094259-330e4c0c023358d9861caa216bc6e850fd799b01 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/plugin-helpers |
6.0.0-alpha-20250702094259-330e4c0c023358d9861caa216bc6e850fd799b01 |
npm ↗︎ unpkg ↗︎ |
💻 Website PreviewThe latest changes are available as preview in: https://pr-10376.graphql-code-generator.pages.dev |
c0ce057
to
330e4c0
Compare
@@ -78,7 +78,10 @@ export const createWatcher = ( | |||
const debouncedExec = debounce(() => { | |||
if (!isShutdown) { | |||
executeCodegen(initialContext) | |||
.then(onNext, () => Promise.resolve()) | |||
.then( | |||
({ result }) => onNext(result), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: apply the same allowPartialOutputs
treatment for watcher
Description
Introduce
allowPartialOutputs
to allow users to write partial success to files.This is a breaking change because we change how
executeCodegen
function works (exposed and can be imported): previously if anygenerates
fails, it'd throw. Now, it will return the error and output files as result and let the caller decide what to do with them.The main caller of
executeCodegen
is the CLI and it (1.) throws if there is complete failure or (2) useallowPartialOutputs
to write on partial success or notRelated #9701
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration