Blog

GraphQL Code Generator: TypeScript fetch clients, CORS credentials mode, and custom fetcher plugins

Generated clients inherit fetch defaults—pass `credentials: 'include'` when your schema requires cookies across origins.

1 min read
graphqlcodegencors

Subscriptions

WebSocket clients generated alongside HTTP may need separate origin allowlists—document both in the same README.

Defer directives for persisted queries can change GET versus POST patterns—retest CORS after enabling APQ.

Monorepos

Shared codegen config across packages should avoid duplicate `fetch` wrappers that diverge on CORS.

Changes to fragment masking can alter request payloads—update preflight tests in the same PR.

Back to blog