chore: v14.0.0 release#3973
Conversation
When subscriptions are configured with an explicit path (for example
`subscriptions: { 'graphql-ws': { path: '/graphql' } }`) alongside `useGlobalPrefix: true`,
the apollo driver previously passed that path straight through to GqlSubscriptionService
without prefixing it. The HTTP endpoint resolved to `/api/graphql` while the websocket
bound to `/graphql`, so client upgrades targeting the prefixed URL were rejected.
Apply the application's global prefix to user-supplied `graphql-ws` and
`subscriptions-transport-ws` paths in `mergeDefaultOptions`. Boolean shorthand
(`'graphql-ws': true`) is preserved as-is because the existing fall-through already uses
the prefixed `options.path`. Mercurius is unaffected because its subscription transport
reuses the mercurius route path which is already prefixed.
Closes #2477
…tional-dts fix(@nestjs/graphql): keep resolvers required when skipping args
…lobal-prefix fix(apollo): respect useGlobalPrefix on custom subscription path
…ed-fields fix(graphql,apollo): ensures extensions are added to resolved fields
…nfo-nullable fix(graphql): change info to nullable
…port-ws Chore/remove subscriptions transport ws
chore: remove apollo playground
chore: migrate to esm
The build-time SDL emitted via autoSchemaFile in federation mode was written using graphql's default printSchema, which strips @key, @external, @extends, @requires and @provides. The runtime _service.sdl query was unaffected. GraphQLSchemaBuilder.generateSchema now accepts an optional printer; the federation factory passes printSchemaWithDirectives (subgraph v2+) or printSubgraphSchema (v1), matching the existing runtime selection. Closes #3722
# Conflicts: # packages/graphql/lib/schema-builder/factories/interface-definition.factory.ts # packages/graphql/lib/schema-builder/factories/object-type-definition.factory.ts # packages/graphql/lib/schema-builder/factories/union-definition.factory.ts # yarn.lock
have just been published under the next tag |
|
I noticed there's still a CommonJS import in graphql-types.loader.ts: const normalize = require('normalize-path'); Would it make sense to replace it with: import normalize from 'normalize-path'; This is a non-functional change, but it improves compatibility with ESM-first projects and aligns with the upcoming NestJS v12 ESM support. Since normalize-path is a CommonJS package exporting a single function, the default import remains fully compatible with both ESM and CommonJS consumers. |
|
While testing with an ESM project ( const { expressMiddleware } = await loadPackage(
'@as-integrations/express5',
'GraphQLModule',
() => require('@as-integrations/express5'),
);Since Changing the loader callback to use a dynamic import instead resolves the issue: const { expressMiddleware } = await loadPackage(
'@as-integrations/express5',
'GraphQLModule',
() => import('@as-integrations/express5'),
);I tested this locally and it fixes the ESM runtime error while preserving the existing lazy-loading behavior. It also helps improve compatibility with the upcoming NestJS v12 ESM support. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information