When working in a monorepo and using the following standard configuration:
schema: api/src/resolvers/**/*.ts
generates:
api/src/api-types.ts:
plugins:
- typescript
- typescript-resolvers
web/src/web-types.ts:
config:
documents: web/src/**/*.tsx
plugins:
- typescript
- typescript-operations
If a valid but breaking change is made to an api resolver, the entire compilation process will error when trying to generate the web-types, and the new api-types will never get created.
This is a confusing workflow for a backend developer, since the output shows:
✔ Parse configuration
❯ Generate outputs
✔ Generate api/src/api-types.ts <-- This is a lie
❯ Generate web/src/web-types.ts
✔ Load GraphQL schemas
✔ Load GraphQL documents
✖ Generate
→ at web/src/pages/Home.tsx:3:5
I believe the tool should output whatever it can, regardless of other errors it encounters (that is, do what the output says it does). Is this expected behavior?
I'm not completely sure, but might this have something to do with using Promise.all on this line? Instead, Promise.allSettled would ensure to not throw on the first error
When working in a monorepo and using the following standard configuration:
If a valid but breaking change is made to an api resolver, the entire compilation process will error when trying to generate the
web-types, and the newapi-typeswill never get created.This is a confusing workflow for a backend developer, since the output shows:
I believe the tool should output whatever it can, regardless of other errors it encounters (that is, do what the output says it does). Is this expected behavior?
I'm not completely sure, but might this have something to do with using
Promise.allon this line? Instead,Promise.allSettledwould ensure to not throw on the first error