⚡️ Minimal GraphQL Client + Code Generation for Nuxt

Overview

nuxt-graphql-client

⚡️ Minimal GraphQL Client + Code Generation for Nuxt

CI Version Downloads MIT

⚡️ Minimal GraphQL Client + Code Generation for Nuxt

Features

StackBlitz

Install

# using yarn
yarn add nuxt-graphql-client

# using npm
npm install nuxt-graphql-client --save

Usage

Nuxt

  1. Add nuxt-graphql-client to the buildModules section of nuxt.config.ts Configuration Options
import { defineNuxtConfig } from 'nuxt3'

export default defineNuxtConfig({
  buildModules: ['nuxt-graphql-client'],

  gql: {
    // configuration
  },
})
  1. Set runtime config GQL_HOST to the URL of your GraphQL API
publicRuntimeConfig: {
  GQL_HOST: 'https://api.spacex.land/graphql' // SpaceX GraphQL API for example
}
  1. Write your GraphQL Queries / Mutations. (Must be written in .gql / .graphql files)

Example using the SpaceX GraphQL API:

./queries/starlink.gql - This query will for the SpaceX API to retrieve the launches for Starlink missions.

query launches($sort: String = "launch_year", $order: String = "desc") {
  launches(sort: $sort, order: $order, find: { mission_name: "Starlink" }) {
    id
    details
    mission_name
    launch_year
    launch_success
    links {
      article_link
      flickr_images
    }
    rocket {
      rocket_name
      rocket_type
    }
  }
}

With autoImport enabled, the query above can be accessed in the Vue portion of your app by prefixing the Operation name (launches in this example with the Function Prefix). The launches query can be executed as GqlLaunches()

  1. ⚡️ You're ready to go!

Run yarn dev for the nuxt-graphql-client module to generate the necessary types and functions.

  • HMR (Hot Module Reload) for your GraphQL documents.
  • Access the types from the GraphQL document(s) that you've written.
  • 🚀 Utilize the auto-imported useGql composable to execute all your queries / mutations.
  • With autoImport enabled, your queries / mutations are accessible within your app by calling the Operation name prefixed by Function Prefix
const { data } = await useAsyncData('starlink', () => GqlLaunches({ order: 'desc' })) ">
<script lang="ts" setup>
const { data } = await useAsyncData('starlink', () => GqlLaunches({ order: 'desc' }))
</script>

Your data is now fully-typed based on it's pertinent GraphQL Document.

Configuration

This module can be configured by adding a gql section inside your nuxt.config.ts

import { defineNuxtConfig } from 'nuxt3'

export default defineNuxtConfig({
  gql: {
    /**
     * Prevent codegen from printing to console in dev mode
     *
     * @type boolean
     * @default true
     */
    silent: boolean,

    /**
     * Enable hot reloading for GraphQL documents
     *
     * @type boolean
     * @default true
     */
    watch: boolean,

    /**
     * Auto import functions based on the operation names of your queries & mutations
     *
     * @type boolean
     * @default true
     */
    autoImport: boolean,

    /**
     * Prefix for auto imported functions
     *
     * @type string
     * @default 'Gql'
     */
    functionPrefix: string,

    /**
     * Path to folder(s) containing .gql or .graphql files. Can be omitted,
     * module will automatically search for GraphQL Documents in the project's root directory.
     *
     * @note Useful for mono repos.
     *
     * @type string[]
     * @example ['../shared/queries']
     * */
    documentPaths: string[],

    /**
     * Only generate the types for the operations in your GraphQL documents.
     * When set to true, only the types needed for your operations will be generated.
     * When set to false, all types from the GraphQL API will be generated.
     *
     * @type boolean
     * @default true
     * */
    onlyOperationTypes: boolean

    /**
     * Allows generating multiple clients with different GraphQL hosts.
     *
     * @note this option overrides the `GQL_HOST` in `publicRuntimeConfig`.
     * */
    clients: GqlClientOptions[]
  },

  publicRuntimeConfig: {
    /**
     * URL pointing to a GraphQL endpoint
     *
     * @type string
     */
    GQL_HOST: string,
  },
})

Credits

nuxt-graphql-client is developed by @diizzayy.

Special thanks to @danielroe for helping me navigate and making this possible!

License

MIT License © 2022 Diizzayy

Comments
  • Multiple GraphQL endpoints not working

    Multiple GraphQL endpoints not working

    Hi all,

    Long time reader, first time poster.

    I'm trying to get this to work in my nuxt app with a connection to shopify and a local graphql api but not having much luck so far. Both the Shopify and local API work in postman respectively and i can call various queries in both, but as soon as I add them both in my config like the below:

    runtimeConfig: {
        public: {
          JWT_SECRET: process.env.JWT_SECRET,
          gql: {
            clients: {
              shopify: {
                default: true,
                host: 'https://zzz.myshopify.com/api/2022-07/graphql.json',
                token: {
                  name: 'X-Shopify-Storefront-Access-Token',
                  value: 'zzzz', 
                  type: null 
                },
                retainToken: true
              },
              concord: {
                host: `http://localhost:8080/graphql`,
                value: 'zzzzzzz'
              }          
            }
          }
        }
      }
    

    In queries/shopify/cartCreate.gql along with a few other queries for shopify stuff

    mutation cartCreate {
        cartCreate {
            cart {
                checkoutUrl
                id
            }
            userErrors {
                field
                message
            }
        }
    }
    

    In queries/concord/test.gql folder I just have 1 query

    query concord_test {
      diamondProductsExternal {
        edges {
          node {
            shape
            id
          }
        }
      }
    }
    

    I get this error. Not really sure whats going on here as I can't find anything about PageInfo anywhere. Could it be something cached. Is there a way to clear the build cache or something like that?

    Cannot start nuxt:                                                                                                                                                                                                                                                        16:25:40
            Failed to load schema from https://zzz.myshopify.com/api/2022-07/graphql.json,http://localhost:8080/graphql:
    
            Unable to merge GraphQL type "PageInfo": Field "endCursor" already defined with a different type. Declared as "ConnectionCursor", but you tried to override with "String"
            Error: Unable to merge GraphQL type "PageInfo": Field "endCursor" already defined with a different type. Declared as "ConnectionCursor", but you tried to override with "String"
        at mergeType (file:///D:/zzz/sf/node_modules/@graphql-tools/merge/esm/typedefs-mergers/type.js:23:19)
        at mergeGraphQLNodes (file:///D:/zzz/sf/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-nodes.js:34:49)
        at mergeGraphQLTypes (file:///D:/zzz/sf/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-typedefs.js:63:25)
        at mergeTypeDefs (file:///D:/zzz/sf/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-typedefs.js:10:22)
        at makeExecutableSchema (file:///D:/zzz/sf/node_modules/@graphql-tools/schema/esm/makeExecutableSchema.js:69:32)
        at mergeSchemas (file:///D:/zzz/sf/node_modules/@graphql-tools/schema/esm/merge-schemas.js:29:12)
        at getSchemaFromSources (file:///D:/zzz/sf/node_modules/@graphql-tools/load/esm/schema.js:51:20)
        at loadSchema (file:///D:/zzz/sf/node_modules/@graphql-tools/load/esm/schema.js:16:12)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async loadSchema (file:///D:/zzz/sf/node_modules/@graphql-codegen/cli/esm/load.js:33:24)
    
            GraphQL Code Generator supports:
              - ES Modules and CommonJS exports (export as default or named export "schema")
              - Introspection JSON File
              - URL of GraphQL endpoint
              - Multiple files with type definitions (glob expression)
              - String in config file
    
            Try to use one of above options and run codegen again.
    
    opened by jckraig 20
  • Unable to use the package

    Unable to use the package

    I am getting an error

    ERROR  Cannot start nuxt:  The requested module '@graphql-codegen/plugin-helpers' does not provide an export named 'DetailedError'                                                         12:03:52
    
      import { DetailedError, createNoopProfiler } from '@graphql-codegen/plugin-helpers';
      ^^^^^^^^^^^^^
      SyntaxError: The requested module '@graphql-codegen/plugin-helpers' does not provide an export named 'DetailedError'
      at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
      at async ModuleJob.run (node:internal/modules/esm/module_job:181:5)
      at async Promise.all (index 0)
      at async ESMLoader.import (node:internal/modules/esm/loader:281:24)
      at async normalizeModule (node_modules/@nuxt/kit/dist/index.mjs:476:26)
      at async installModule (node_modules/@nuxt/kit/dist/index.mjs:455:41)
      at async initNuxt (node_modules/nuxt/dist/index.mjs:1606:7)
      at async load (node_modules/nuxi/dist/chunks/dev.mjs:6778:9)
      at async Object.invoke (node_modules/nuxi/dist/chunks/dev.mjs:6828:5)
      at async _main (node_modules/nuxi/dist/cli.mjs:50:20)
    

    I guess it might be because of the recent update to the graphql-code-generator more specifically because of this PR where they have removed the DetailedError

    bug 
    opened by ShreyAmbesh 17
  • Access token & refresh token setup

    Access token & refresh token setup

    I just found the project here and read #3. Now I have the following question/feature request:

    Will the implementation of an access token and a refresh token setup be supported in the future? E.g. if an error message "token expired" comes back, you automatically call a defined query to generate a new access token with its refresh token (HTTP cookie) and then the original query is automatically executed again.

    enhancement 
    opened by TitusKirch 17
  • SSR not passing cookies

    SSR not passing cookies

    Hey!

    This is probably an issue based on my lack of knowledge about Nuxt. But I can't find a way to solve it.

    I have a Nuxt middleware that makes sure that a user is authenticated before allowing them to navigate to certain pages. The authentication is based on sessions, and a cookie needs to be sent with every request to my graphql api.

    This works great in SPA mode: the cookie is passed directly from the browser to the API. However, on initial page load, when the app runs in SSR mode, the cookie is not passed along to the API. This means that if a user logs in and navigates to a restricted page, then refreshes the window, they are redirected to the login screen even though they have a session.

    How can I make sure that the SSR code passes along the cookie?

    Here is the code for the middleware:

    export default defineNuxtRouteMiddleware(async (to, from) => {
      const user = useState("user");
      if (!user.value) {
        try {
          const { data } = await useAsyncGql("userinfo");
          if (data.value.user) {
            user.value = data.value.user;
          } else {
            return navigateTo({
              path: "/login",
              query: {
                reason: "No user info",
              },
            });
          }
        } catch (err) {
          return navigateTo({
            path: "/login",
            query: {
              reason: 'request error',
            },
          });
        }
      }
    });
    

    Thanks in advance.

    bug 
    opened by MrTeapot 14
  • Demo app failing- Failed to load schema for

    Demo app failing- Failed to load schema for "gql-sdk.ts"

    Hi there

    I just saw that the demo with the SpaceX API is failing under: https://stackblitz.com/github/diizzayy/nuxt-graphql-client-demo

    I got the same error in local with the exact same setup.

    opened by colinscz 14
  • Missing server build import files: Cannot find module '#gql/default' or its corresponding type declarations

    Missing server build import files: Cannot find module '#gql/default' or its corresponding type declarations

    Environment

    Describe the bug

    I've upgraded to Nuxt v3 stable and latest version of lib and updated all imports to #gql. Now it can't build

    Works fine in nuxt dev, fails in nuxt build

    Expected behaviour

    Project builds

    Reproduction

    No response

    Additional context

    runtimeConfig: {
            public: {
                'graphql-client': {
                    codegen: {
                        onlyOperationTypes: false,
                    },
                },
            },
        },
    

    Logs

    ℹ Client built in 11342ms
    ℹ Building server...
    ✔ Server built in 8706ms
    ✔ Generated public .output/public
    ℹ Building Nitro Server (preset: node-server)
    src/components/views/catalog/CatalogCardPresentation.vue(27,28): error TS2307: Cannot find module '#gql/default' or its corresponding type declarations.
    
    bug 
    opened by daniluk4000 9
  • Unknown type error

    Unknown type error

    Hi I'm trying to connect with my Keystone JS app. I need to use a mutation to make a login and get the user's token. This is login.gql:

    type Mutation { authenticateUserWithPassword(email: String!, password: String!): UserAuthenticationWithPasswordResult! }

    type Query { authenticatedItem: AuthenticatedItem }

    union AuthenticatedItem = User

    union UserAuthenticationWithPasswordResult = UserAuthenticationWithPasswordSuccess | UserAuthenticationWithPasswordFailure

    type UserAuthenticationWithPasswordSuccess { sessionToken: String! item: User! }

    type UserAuthenticationWithPasswordFailure { message: String! }

    mutation { authenticateUserWithPassword( email: "[email protected]", password: "1234567890" ) { ... on UserAuthenticationWithPasswordSuccess { item { id name email } } ... on UserAuthenticationWithPasswordFailure { message } } }

    I get those error when I run npm run dev: Unknown type "UserAuthenticationWithPasswordSuccess" Unknown type "UserAuthenticationWithPasswordFailure"

    Do I doing something wrong? Thanks

    opened by yalondpsi 9
  • 401 Unauthorized when I query the same url more then once without a page request

    401 Unauthorized when I query the same url more then once without a page request

    I am trying to do call for data from my CMS with the same Token in two different places, a component(Header) and a NuxtPage(Body). One page load, both useAsyncData calls work and the page works as expected. However, if I change the NuxtPage with a NuxtLink, and hence need to fetch new data for that page, I get a '401 Unauthorized' Error from my CMS (datoCMS). I am using the refreshnuxtdata to do that data refresh and it seems like that function is not sending the token?

    This seems like the most relevant code but let me know if you need more information

    const { data } = await useAsyncData("allworkGet", () => GqlLaunches());
    const refresh = () => refreshNuxtData('allworkGet')
    

    Things I tried

    Didn't Work, even though GQL_TOKEN is in .env

    function refreshFunc(){
        const config = useRuntimeConfig();
        console.log('URL:',config.GQL_HOST);
        // logs the URL
        console.log('URL:',config.GQL_TOKEN);
        // logs undefined
        useGqlToken(config.GQL_TOKEN);
        refreshNuxtData('allworkGet');
    }
    
    const refresh = () => refreshFunc()
    

    Did work but seems to be a bad solution to have to add my token by hand

    function refreshFunc(){
    
        useGqlToken('my_tokens_string');
        refreshNuxtData('allworkGet');
    }
    
    
    opened by FWORDIE 9
  • When `nuxt-graphql-client` is defined in `modules`, it throws a TS error on npm run dev when `.nuxt` is removed

    When `nuxt-graphql-client` is defined in `modules`, it throws a TS error on npm run dev when `.nuxt` is removed

    When you remove the .nuxt folder (e.g. with npx nuxi clean) and try to start dev mode, this plugin crashes because it's trying to run TS before the .nuxt folder is generated.

    It looks like this module is running some typescript compilation before the .nuxt folder is generated, and since tsconfig.json depends on a config file in .nuxt, it will fail to run at all:

      error TS5083: Cannot read file '.nuxt/tsconfig.json'.
    
      at createTSError (node_modules/ts-node/src/index.ts:859:12)
      at reportTSError (node_modules/ts-node/src/index.ts:863:19)
      at createFromPreloadedConfig (node_modules/ts-node/src/index.ts:874:36)
      at create (node_modules/ts-node/src/index.ts:624:10)
      at register (node_modules/ts-node/src/index.ts:591:15)
      at TypeScriptLoader (node_modules/cosmiconfig-typescript-loader/dist/cjs/index.js:52:54)
      at node_modules/@graphql-codegen/cli/esm/config.js:16:18
      at ModuleJob.run (node:internal/modules/esm/module_job:198:25)
      at async Promise.all (index 0)
      at async ESMLoader.import (node:internal/modules/esm/loader:385:24)
      at async normalizeModule (node_modules/nuxt/node_modules/@nuxt/kit/dist/index.mjs:476:26)
      at async installModule (node_modules/nuxt/node_modules/@nuxt/kit/dist/index.mjs:455:41)
      at async initNuxt (node_modules/nuxt/dist/index.mjs:1606:7)
      at async load (node_modules/nuxi/dist/chunks/dev.mjs:6778:9)
      at async Object.invoke (node_modules/nuxi/dist/chunks/dev.mjs:6828:5)
      at async _main (node_modules/nuxi/dist/cli.mjs:50:20)
    
    opened by TheDutchCoder 8
  • How to disable generating

    How to disable generating

    Hi, our graphql API does not provide introspection on the main endpoint of graphql host. Is there possibility to disable generating or setup different url to get introspection ?

    opened by mercs600 8
  • Force query documentation

    Force query documentation

    I lack the documentation needed to fire the same query multiple times within a session and it actually making a request to the graphql endpoint each time, instead of only once and the using cached data.

    opened by Pjort 8
  • chore(deps-dev): bump vitest from 0.25.8 to 0.26.3

    chore(deps-dev): bump vitest from 0.25.8 to 0.26.3

    Bumps vitest from 0.25.8 to 0.26.3.

    Release notes

    Sourced from vitest's releases.

    v0.26.3

       🚀 Features

       🐞 Bug Fixes

        View changes on GitHub

    v0.26.2

       🚀 Features

       🐞 Bug Fixes

        View changes on GitHub

    v0.26.1

       🚀 Features

       🐞 Bug Fixes

        View changes on GitHub

    v0.26.0

       🚨 Breaking Changes

    • vite-node: Rewrite how vite-node resolves id  -  by @​sheremet-va in vitest-dev/vitest#2463 (58ee8)
    • Correctly interop nested default for external and inlined modules  -  by @​sheremet-va in vitest-dev/vitest#2512 (084e9)
      • If your environment is node, Vitest will not resolve invalid named exports (exports that are on "default" property will not magically appear as named exports), unless deps.interopDefault is enabled, or dependency is in deps.inline. This change doesn't affect jsdom, happy-dom or edge environments.
    • web-worker: Make web-worker implementation more compatible with spec  -  by @​sheremet-va in vitest-dev/vitest#2431 (c3a63)
      • Messages are now cloned with structuredClone, if it's available, or fallbacks to a polyfill.
      • Added support for SharedWorker

    ... (truncated)

    Commits
    • 8d64790 chore: release v0.26.3
    • dba1337 fix(coverage): env-replacer to remove query params from sourcemaps filenames ...
    • 32a577b fix: show list of tests when typechecking (#2585)
    • c479d9c fix: don't hang when mocking module with circular dependency (#2572)
    • 9f41edd fix: start tracking module resolution as soon as possible for easier tracking...
    • ef77dcc fix(api): make api parse error stacks and return sourcePos in onTaskUpdate (#...
    • 853eedd feat(mock): expose a importOriginal helper to the factory (#2551)
    • 07ef0f2 chore: release v0.26.2
    • f6b592a fix(cli): respect inline config dir (#2550)
    • 84f98e7 feat: project name
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies javascript 
    opened by dependabot[bot] 0
  • chore(deps-dev): bump @vitest/coverage-c8 from 0.25.8 to 0.26.3

    chore(deps-dev): bump @vitest/coverage-c8 from 0.25.8 to 0.26.3

    Bumps @vitest/coverage-c8 from 0.25.8 to 0.26.3.

    Release notes

    Sourced from @​vitest/coverage-c8's releases.

    v0.26.3

       🚀 Features

       🐞 Bug Fixes

        View changes on GitHub

    v0.26.2

       🚀 Features

       🐞 Bug Fixes

        View changes on GitHub

    v0.26.1

       🚀 Features

       🐞 Bug Fixes

        View changes on GitHub

    v0.26.0

       🚨 Breaking Changes

    • vite-node: Rewrite how vite-node resolves id  -  by @​sheremet-va in vitest-dev/vitest#2463 (58ee8)
    • Correctly interop nested default for external and inlined modules  -  by @​sheremet-va in vitest-dev/vitest#2512 (084e9)
      • If your environment is node, Vitest will not resolve invalid named exports (exports that are on "default" property will not magically appear as named exports), unless deps.interopDefault is enabled, or dependency is in deps.inline. This change doesn't affect jsdom, happy-dom or edge environments.
    • web-worker: Make web-worker implementation more compatible with spec  -  by @​sheremet-va in vitest-dev/vitest#2431 (c3a63)
      • Messages are now cloned with structuredClone, if it's available, or fallbacks to a polyfill.
      • Added support for SharedWorker

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies javascript 
    opened by dependabot[bot] 0
  • Unhandled rejection when starting nuxt

    Unhandled rejection when starting nuxt

    Environment

    Describe the bug

    When I'm starting up nuxt with nuxt dev I always get thrown the error

     ERROR  [unhandledRejection] First parameter has member 'readable' that is not a ReadableStream.                                                                                     10:46:09
    
      at assertReadableStream (node_modules/ohmyfetch/node_modules/node-fetch-native/dist/shared/node-fetch-native.b703cef9.mjs:428:21)
      at convertReadableWritablePair (node_modules/ohmyfetch/node_modules/node-fetch-native/dist/shared/node-fetch-native.b703cef9.mjs:3505:11)
      at ReadableStream.pipeThrough (node_modules/ohmyfetch/node_modules/node-fetch-native/dist/shared/node-fetch-native.b703cef9.mjs:3580:33)
      at fetchFinale (node_modules/undici/lib/fetch/index.js:976:52)
      at mainFetch (node_modules/undici/lib/fetch/index.js:776:5)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
    

    Tracing the strack trace it comes from the generate function, when running the graphql codegen.

    const outputFiles = await context.profiler.run(() => executeCodegen(context), "executeCodegen");
    

    This is run with the following config:

    Generate {                                                                                                                   11:09:28
      clients: {
        default: {
          token: [Object],
          proxyCookies: true,
          tokenStorage: [Object],
          preferGETQueries: false,
          host: 'http://localhost:8888/api/graphql'                                                                              11:09:26
        }
      },
      plugins: [
        'typescript',
        'typescript-operations',
        'typescript-graphql-request'
      ],
      documents: [
         // list of my graphql-files
      ],
      resolver: {
        resolve: [Function: resolve],
        resolvePath: [Function: resolvePath]
      },
      clientDocs: {
        default: [
         // list of my graphql-files
        ]
      },
      silent: true,
      skipTypename: true,
      useTypeImports: true,
      dedupeFragments: true,
      disableOnBuild: false,
      onlyOperationTypes: true
    } {
      silent: true,
      generates: {
        'default.ts': {
          config: [Object],
          schema: [Array],
          plugins: [Array],
          documents: [Array]
        }
      }
    }
    
    bug 
    opened by itzaks 0
  • Many warnings when yarn install

    Many warnings when yarn install

    Environment


    • Operating System: Windows_NT
    • Node Version: v19.2.0
    • Nuxt Version: 3.0.0
    • Nitro Version: 1.0.0
    • Package Manager: [email protected]
    • Builder: vite
    • User Config: app, css, alias, runtimeConfig, modules, graphql-client
    • Runtime Modules: @pinia/[email protected], [email protected]
    • Build Modules: -

    Describe the bug

    warning "nuxt-graphql-client > @graphql-codegen/[email protected]" has unmet peer dependency "graphql-tag@^2.0.0". warning "nuxt-graphql-client > @graphql-codegen/cli > [email protected]" has unmet peer dependency "@types/node@". warning "nuxt-graphql-client > @graphql-codegen/cli > [email protected]" has unmet peer dependency "ts-node@>=10". warning "nuxt-graphql-client > @graphql-codegen/cli > [email protected]" has unmet peer dependency "typescript@>=3". warning "nuxt-graphql-client > @graphql-codegen/cli > graphql-config > [email protected]" has unmet peer dependency "@types/node@". warning "nuxt-graphql-client > @graphql-codegen/cli > graphql-config > [email protected]" has unmet peer dependency "typescript@>=3". warning "nuxt-graphql-client > @graphql-codegen/cli > graphql-config > [email protected]" has unmet peer dependency "@types/node@*". warning "nuxt-graphql-client > @graphql-codegen/cli > graphql-config > [email protected]" has unmet peer dependency "typescript@>=2.7". warning "nuxt-graphql-client > @graphql-codegen/cli > @graphql-tools/code-file-loader > @graphql-tools/graphql-tag-pluck > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".

    Expected behaviour

    remove warnings

    Reproduction

    No response

    Additional context

    No response

    Logs

    No response

    bug 
    opened by cdwmhcc 0
  • Support for persisted queries

    Support for persisted queries

    Your use case

    I'd like to implement persisted queries.

    The solution you'd like

    I think this could be achieved by being able to pass along a query id to the server, or even better, some kind of integration with persistgraphql or something like it, as I see that repo is now archived.

    Possible alternatives

    No response

    Additional information

    No response

    enhancement 
    opened by stephiescastle 0
  • fix: codegen error on layers `extend`

    fix: codegen error on layers `extend`

    fixes: #271

    @Diizzayy what basically happen'd -- it was watching on all paths of extend even in node_modules/ folder that would not map to any client docs then error out but where all the same file. To resolve this we block all unlink events and path changes in ../ that basically represent the theme it's extending in watch mode.

    example of event:

    ✔ Nitro built in 420 ms                                                                                                                         nitro 10:02:50
    [add] PATH:  ../basic/node_modules/nuxt-graphql-client/examples/extends/queries/test2.gql                                                             10:03:00
    allowDocument:  true                                                                                                                                  10:03:00
    [add] PATH:  ../basic/node_modules/nuxt-graphql-client/playground/node_modules/nuxt-graphql-client/examples/extends/queries/test2.gql                 10:03:00
    allowDocument:  true                                                                                                                                  10:03:00
    [unlink] PATH:  queries/test1.gql 
    
    opened by cpreston321 1
Releases(v0.2.24)
Owner
Dizzy
The Intricate Developer
Dizzy
Easy generation of OpenGraph & Twitter meta-tags in Nuxt 3 📋

nuxt-social-tags Easy generation of OpenGraph & Twitter meta-tags in Nuxt 3 ✨ Release Notes ?? Read the documentation Features Nuxt3 ready Composables

Conner 19 Dec 17, 2022
A Nuxt.js module that injects a server route to serve the GraphQL Playground

@pin-pon/nuxt-graphql-playground A Nuxt.js module that injects a server route to serve the GraphQL Playground Setup Add @pin-pon/nuxt-graphql-playgrou

Pin-Pon 3 Sep 22, 2022
Minimal, zero-configuration and fast solution for static site generation in any front-end framework.

Staticit - Introduction Whether you want to increase performance of your web application or improve SEO. Generally you have 2 options, use SSR (Server

Engineerhub 4 Jun 11, 2022
Nuxt eureka client

Nuxt eureka client

Kirill 5 May 30, 2022
Remove all client-side JS from your Nuxt 3 app

Nuxt Zero JS Remove all client-side JS from your Nuxt 3 app ✨ Changelog ▶️ Online playground Features ⚠️ nuxt-zero-js is under active development. ⚠️

Daniel Roe 163 Jan 3, 2023
(unofficial) Nuxt VS Code Extension

(unofficial) nuxt-vscode This uses nuxi but makes it interactive and easy to use with a nuxt 3 project. Nuxi commands for vscode. This extension is no

Christian Preston 15 Dec 25, 2022
🏎 A tiny and fast GraphQL client for Vue.js

villus Villus is a finger-like structures in the small intestine. They help to absorb digested food. A small and fast GraphQL client for Vue.js. This

Abdelrahman Awad 639 Jan 8, 2023
Nuxt.js module to use Unleash toggle feature services

nuxt-unleash Nuxt.js module to use Unleash toggle feature services ?? Release Notes Features Use $unleash to access and handle your Unleash feature fl

Juanjo Conejero 15 Dec 3, 2022
Easily connect your Nuxt 3 application with LogSnag 📰

Nuxt LogSnag ?? LogSnag integration for Nuxt 3 ✨ Release Notes Features Nuxt 3 ready Easy integration Handy composables TypeScript support Setup Insta

Conner 13 Apr 28, 2022
Nuxt 3 starter with Algolia, Storyblok, and Indexer

Nuxt 3 with Storyblok CMS and Algolia Search (incl. automatic indexing) This is a demo repository for an article in Dev.to. We recommend to look at th

Jakub Andrzejewski 5 May 24, 2022
End-to-end typesafe APIs with tRPC.io in Nuxt applications.

tRPC-Nuxt End-to-end typesafe APIs with tRPC.io in Nuxt applications. The client above is not importing any code from the server, only its type declar

Robert Soriano 231 Dec 30, 2022
A modern, zero-dependency uptime monitoring tool & status page based on GitHub Actions & Nuxt Content v2.

StatusBase Uptime monitoring tool & beautiful status pages Powered by Nuxt Content v2! Free • Open Source • Notification View Demo · Report Bug · Requ

zernonia 208 Dec 27, 2022
🔎 Algolia module for Nuxt

@nuxtjs/algolia Algolia module for Nuxt ✨ Release Notes ?? Read the documentation Features Nuxt 3 ready Easy integration with Algolia Handy composable

Nuxt Community 128 Jan 7, 2023
Nuxt 3 module for Kirby's Query Language API

nuxt-kql Kirby KQL module for Nuxt 3. This module provides a useKql composable, which under the hood uses useFetch. Thus, KQL query fetching in your N

Johann Schopplich 25 Dec 15, 2022
This repo contains a fully configured nuxt 3 instance supporting TypeScript and several considered as useful libraries, fully configured and ready to use in real world projects!

Nuxt 3 Starter This repo contains a fully configured nuxt 3 instance supporting TypeScript and several considered as useful libraries, fully configure

Ali Soueidan 26 Dec 27, 2022
Batteries-included, zero-config Ionic integration for Nuxt

Nuxt Ionic Ionic integration for Nuxt ✨ Changelog ?? Read the documentation ▶️ Online playground Features ⚠️ nuxt-ionic is currently a work in progres

Daniel Roe 211 Dec 28, 2022
Http-proxy middleware for Nuxt 3.

nuxt-proxy Http-proxy middleware for Nuxt 3. Installation npm install nuxt-proxy Usage export default defineNuxtConfig({ modules: ['nuxt-proxy'],

Robert Soriano 49 Dec 30, 2022
Nuxt 3 module for Web3.js

nuxt-web3.js Nuxt 3 module for Web3.js. Installation npm install nuxt-web3.js Usage export default defineNuxtConfig({ modules: ['nuxt-web3.js'], })

Robert Soriano 8 Dec 16, 2022
OpenID-Connect(OIDC) integration module for nuxt 3.0.

Nuxt OpenID-Connect OpenID-Connect(OIDC) integration module for nuxt 3.0. Features An Nuxt 3 module. OIDC integration ( implemetation base openid-clie

Aborn Jiang 10 Dec 24, 2022