You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
User Config: modules, runtimeConfig, css, components, postcss, vite
Runtime Modules: nuxt-graphql-client@0.2.24
Build Modules: -
Describe the bug
When starting nuxt dev the process stops/fails if any gql file has an invalid query.
This may happen if the schema changes meanwhile.
Error Message:
ERROR GraphQL Document Validation failed with 1 errors;
This would prevent any rebuild or regeneration of the gql file later during the startup.
Expected behaviour
In dev is true just log the error and continue.
In dev is false stop process to prevent build success.
Reproduction
No response
Additional context
No response
Logs
In this example, an invalid property xxx prevents codegen working properly
---
ERROR GraphQL Document Validation failed with 1 errors; 16:28:37
Error 0: Cannot query field "xxx" on type"Set_Components_ImageWithText".
at ./gql-dx-playground/web/queries/generated/uri.gql:23:3
Error 0: Cannot query field "xxx" on type"Set_Components_ImageWithText".
at queries/generated/uri.gql:23:3
at executeCodegen (node_modules/@graphql-codegen/cli/dist/shared/graphql-codegen-cli-nuxt.111a00cc.mjs:953:20)
at async generate (node_modules/@graphql-codegen/cli/dist/shared/graphql-codegen-cli-nuxt.111a00cc.mjs:1254:23)
at async generate (node_modules/nuxt-graphql-client/dist/module.mjs:62:10)
at async generateGqlTypes (node_modules/nuxt-graphql-client/dist/module.mjs:340:46)
at async setup (node_modules/nuxt-graphql-client/dist/module.mjs:443:5)
at async normalizedModule (node_modules/@nuxt/kit/dist/index.mjs:167:5)
at async installModule (node_modules/@nuxt/kit/dist/index.mjs:435:3)
at async initNuxt (node_modules/nuxt/dist/index.mjs:2034:7)
at async load (node_modules/nuxi/dist/chunks/dev.mjs:6797:9)
at async Object.invoke (node_modules/nuxi/dist/chunks/dev.mjs:6858:5)
Error: GraphQL Document Validation failed with 1 errors;
Error 0: Cannot query field "xxx" on type"Set_Components_ImageWithText".
at queries/generated/uri.gql:23:3
at codegen (node_modules/@graphql-codegen/core/esm/codegen.js:69:19)
at async process2 (node_modules/@graphql-codegen/cli/dist/shared/graphql-codegen-cli-nuxt.111a00cc.mjs:902:44)
at async Promise.all (index 0)
at async node_modules/@graphql-codegen/cli/dist/shared/graphql-codegen-cli-nuxt.111a00cc.mjs:915:27
at async node_modules/@graphql-codegen/cli/dist/shared/graphql-codegen-cli-nuxt.111a00cc.mjs:682:11
at async Task.run (node_modules/listr2/dist/index.js:960:11)
at async node_modules/p-map/index.js:57:22
The text was updated successfully, but these errors were encountered:
@leaderit If your concern is, that multiple requests in a single .gql file should be supported, you'll be better served raising your issue in the GraphQL code generation project https://the-guild.dev/graphql/codegen. This nuxt module just uses the codegen features and has no influence in it.
In your case, I'd rather guess that there is an error in your .gql file with multiple requests because I didn't have had any problems with multiple requests in one single file.
Environment
Darwin
v18.13.0
3.1.0
2.0.0
yarn@1.22.19
vite
modules
,runtimeConfig
,css
,components
,postcss
,vite
nuxt-graphql-client@0.2.24
-
Describe the bug
When starting
nuxt dev
the process stops/fails if any gql file has an invalid query.This may happen if the schema changes meanwhile.
Error Message:
This would prevent any rebuild or regeneration of the gql file later during the startup.
Expected behaviour
In
dev is true
just log the error and continue.In
dev is false
stop process to prevent build success.Reproduction
No response
Additional context
No response
Logs
The text was updated successfully, but these errors were encountered: