Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: codegen error on layers extend #274

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,13 @@ export default defineNuxtModule<GqlConfig>({

if (config.watch) {
nuxt.hook('builder:watch', async (event, path) => {
if (!path.match(/\.(gql|graphql)$/)) { return }
// Ignore paths with `../` for nuxt layers & non gql files
if (!path.match(/\.(gql|graphql)$/) || path.match(/^\.\.\//)) { return }

if (event !== 'unlink' && !allowDocument(path)) { return }
// Ignore schema files & `unlink` events
if ((event !== 'unlink' && !allowDocument(path)) || (event === 'unlink')) { return }

// Start Codegen Generation
const start = Date.now()
await generateGqlTypes(path)
await nuxt.callHook('builder:generateApp')
Expand Down