Skip to content

4.2.0

Compare
Choose a tag to compare
@dulnan dulnan released this 19 Oct 13:57
· 10 commits to main since this release

What's Changed

Nuxt 4 Compatibility

The module is now compatible with the new folder structure when compatibilityVersion: 4 is enabled.

  • The location for the server options file now defaults to <serverDir>/graphqlMiddleware.serverOptions. When using default configuration this would be ./server/graphqlMiddleware.serverOptions. The existing location inside the app folder continues to work, but is deprecated and support for it will be removed in the next major release
  • Alias resolving has been refactored: Options like schemaPath or autoImportPatterns now resolve the same as everywhere in Nuxt. For example a schemaPath value of ~~/schema.graphql will resolve to the rootDir set by Nuxt (<rootDir>/schema.graphql in this example).
  • Same applies for manual fragment imports: #import '~/components/User/fragment.graphql' will try to import the file from <srcDir>/components/User/fragment.graphql (in classic Nuxt 3 folder structure this would be ./components, when using Nuxt 4 ./app/components)

Support for Layers

With the changes mentioned above support for layers was also improved. Fragment imports from layers should now work, e.g. #import '~~/layers/my-layer/graphql/fragment.graphql.

Various

  • Empty GraphQL files will be skipped during codegen to prevent an obvious error from being logged

Full Changelog: release/4.1.1...release/4.2.0