nuxt-graphql-client icon indicating copy to clipboard operation
nuxt-graphql-client copied to clipboard

How to disable generating

Open mercs600 opened this issue 1 year ago • 4 comments

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 ?

mercs600 avatar Sep 29 '22 14:09 mercs600

We have a similar situation at our company. It would be great to have the option to disable the type generation

kihayu avatar Sep 30 '22 08:09 kihayu

@mercs600 @kihayu I've just released an experimental version that should enable this, I'd be happy to have the both of you onboard to assist in testing it if you're willing

The edge version can be installed via: yarn add nuxt-graphql-client@edge

Codegen can be disabled via: 'graphql-client'.codegen: false

Diizzayy avatar Sep 30 '22 10:09 Diizzayy

Thanks for the quick response. Will test it as soon as I have time

kihayu avatar Sep 30 '22 11:09 kihayu

When I start the dev-server and visit the page, I get the following error:

[nuxt] [request error] [unhandled] [500] request to http://[::]:3000/__nuxt_vite_node__/manifest failed, reason: connect EADDRNOTAVAIL :::3000 - Local (:::0) ()
  at async $fetchRaw2 (./node_modules/ohmyfetch/dist/shared/ohmyfetch.c2a48baf.mjs:132:20)  
  at async ./.nuxt/dev/index.mjs:457:20  
  at async ./.nuxt/dev/index.mjs:526:64  
  at async ./.nuxt/dev/index.mjs:106:22  
  at async ./node_modules/h3/dist/index.mjs:592:19  
  at async nodeHandler (./node_modules/h3/dist/index.mjs:538:7)  
  at async ufetch (./node_modules/unenv/runtime/fetch/index.mjs:9:17)  
  at async $fetchRaw2 (./node_modules/ohmyfetch/dist/shared/ohmyfetch.c2a48baf.mjs:132:20)  
  at async Object.errorhandler [as onError] (./.nuxt/dev/index.mjs:354:29)  
  at async Server.nodeHandler (./node_modules/h3/dist/index.mjs:545:9)

GraphQL server is available for sure.

kihayu avatar Oct 03 '22 06:10 kihayu

@Diizzayy thank you for quick response. It works for me @kihayu

mercs600 avatar Oct 06 '22 13:10 mercs600

@Diizzayy will it be possible to provide different URL to get introspection ?

mercs600 avatar Oct 07 '22 11:10 mercs600

will it be possible to provide different URL to get introspection ?

@mercs600 Certainly, It will be included in the next edge release.

Diizzayy avatar Oct 07 '22 11:10 Diizzayy

@mercs600 @Drillan767 Codegen can be disabled as of v0.2.0, by setting the codegen property of the graphql-client configuration to false.

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

    runtimeConfig: {
        public: {
            'graphql-client': {
              codegen: false,
                clients: {
                    spacex: 'https://api.spacex.land/graphql',
                }
            }
        }
    }
})

Diizzayy avatar Oct 17 '22 23:10 Diizzayy