nuxt-graphql-request

Easy Minimal GraphQL client integration with Nuxt.js.

MIT License

Downloads
7.6K
Stars
194
Committers
10

Bot releases are hidden (Show)

nuxt-graphql-request - v8.0.0 Latest Release

Published by Gomah 5 months ago

What's Changed

BREAKING CHANGES

nuxt-graphql-request - v7.0.0

Published by Gomah about 1 year ago

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
nuxt-graphql-request - v4.0.0

Published by Gomah over 3 years ago

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,
  },
};
Package Rankings
Top 3.39% on Npmjs.org
Badges
Extracted from project README
nuxt-graphql-request npm version Dependencies npm downloads code style: prettier License: MIT