Releases
v8.0.0 5/10/2024
v7.0.0 9/12/2023
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 9/2/2022
BREAKING CHANGES:
graphql-request
now invokes responseMiddleware
in error cases as well.
Features:
https://github.com/prisma-labs/graphql-request/commit/6246ffe47d3a4f849e43a36d4bbfda7518571ebe Allow async requestMiddleware (https://github.com/prisma-labs/graphql-request/pull/379) https://github.com/prisma-labs/graphql-request/commit/2f221a4c5470c22dad7749b53cb1ed560727fd42 (breaking) Invoke responseMiddleware in error cases as well (https://github.com/prisma-labs/graphql-request/pull/372) https://github.com/prisma-labs/graphql-request/commit/a7ac904e3c8bc820d4464d7559036eb9a58a062a TypedDocumentNode support & strict variable typings (https://github.com/prisma-labs/graphql-request/pull/350) https://github.com/prisma-labs/graphql-request/commit/dec0319e27660e10bbd3a0e3c4e95f97c39fa973 added middleware support (https://github.com/prisma-labs/graphql-request/pull/170)
Fixes https://github.com/prisma-labs/graphql-request/commit/55b1bf509a95faac042221765ff4fcd0723b1bfc resolve headers when cross fetch is not available in environment (https://github.com/prisma-labs/graphql-request/pull/296) https://github.com/prisma-labs/graphql-request/commit/988b437103f57efbc642c87b6eded4b03ddef72c use GraphQLError from graphql module (https://github.com/prisma-labs/graphql-request/pull/365)
v4.0.0 2/22/2021
BREAKING CHANGES
https://github.com/Gomah/nuxt-graphql-request/pull/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,
},
};