Skip to content

Commit

Permalink
fix upstream Diizzayy#315 in dev mode log validation error
Browse files Browse the repository at this point in the history
Don't stop `nuxt dev` if a GraphQl validation error happens.
Allow other build tools to fix the problem later on.
  • Loading branch information
sheggi committed Mar 1, 2023
1 parent cc0ea98 commit 471c14d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@ export default defineNuxtModule<GqlConfig>({
clientDocs,
...(typeof config.codegen !== 'boolean' && config.codegen)
}).then(output => output.reduce<Record<string, string>>((acc, c) => ({ ...acc, [c.filename.split('.ts')[0]]: c.content }), {}))
.catch(e => {
if(nuxt.options.dev) {
console.error(e)
return {}
}
throw e
})
: ctx.clients!.reduce<Record<string, string>>((acc, k) => {
if (!clientDocs?.[k]?.length) { return acc }

Expand Down

0 comments on commit 471c14d

Please sign in to comment.