Releases: Gomah/nuxt-graphql-request
v8.0.0
v7.0.0
What's Changed
⚠ BREAKING CHANGES
- Drop for Nuxt 2 support, to continue using
nuxt-graphql-request
with Nuxt 2, stick to v6:yarn add nuxt-graphql-request@v6
. - Remove file uploads feature
Features:
- Nuxt 3 support, thanks to @nicktrn #53
- Bump graphql-request to v6
- Bump cross-fetch to v4 (support for Node 18 and 20)
- gql file imports are now vite and webpack compatible
- automatic type generation
- responses can be fully typed with TypedDocumentNode (used by two of the test pages as examples)
Fixes:
- defining a client at runtime only now works as expected
v6.0.0
BREAKING CHANGES:
graphql-request
now invokes responseMiddleware
in error cases as well.
Features:
graffle-js/graffle@6246ffe Allow async requestMiddleware (graffle-js/graffle#379)
graffle-js/graffle@2f221a4 (breaking) Invoke responseMiddleware in error cases as well (graffle-js/graffle#372)
graffle-js/graffle@a7ac904 TypedDocumentNode support & strict variable typings (graffle-js/graffle#350)
graffle-js/graffle@dec0319 added middleware support (graffle-js/graffle#170)
Fixes
graffle-js/graffle@55b1bf5 resolve headers when cross fetch is not available in environment (graffle-js/graffle#296)
graffle-js/graffle@988b437 use GraphQLError from graphql module (graffle-js/graffle#365)
v4.0.0
BREAKING CHANGES
#13 Supports multiple clients, thanks @samturrell
Change to nuxt.config as v4 now supports multiple clients:
Before:
module.exports = {
buildModules: ['nuxt-graphql-request'],
graphql: {
/**
* The client endpoint url
*/
endpoint: 'https://swapi-graphql.netlify.com/.netlify/functions/index',
/**
* Options
* See: https://github.com/prisma-labs/graphql-request#passing-more-options-to-fetch
*/
options: {},
/**
* Optional
* default: true (this includes cross-fetch/polyfill before creating the graphql client)
*/
useFetchPolyfill: true,
/**
* Optional
* default: false (this includes graphql-tag for node_modules folder)
*/
includeNodeModules: true,
},
};
After:
module.exports = {
buildModules: ['nuxt-graphql-request'],
graphql: {
/**
* An Object of your GraphQL clients
*/
clients: {
default: {
/**
* The client endpoint url
*/
endpoint: 'https://swapi-graphql.netlify.com/.netlify/functions/index',
/**
* Per-client options overrides
* See: https://github.com/prisma-labs/graphql-request#passing-more-options-to-fetch
*/
options: {},
},
secondClient: {
// ...client config
},
// ...your other clients
},
/**
* Options
* See: https://github.com/prisma-labs/graphql-request#passing-more-options-to-fetch
*/
options: {},
/**
* Optional
* default: true (this includes cross-fetch/polyfill before creating the graphql client)
*/
useFetchPolyfill: true,
/**
* Optional
* default: false (this includes graphql-tag for node_modules folder)
*/
includeNodeModules: true,
},
};