Skip to content

Commit c3daa95

Browse files
authored
hotfix: filter documents named schema (#157)
1 parent ebe1822 commit c3daa95

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

module/src/module.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,11 @@ export default defineNuxtModule<GqlConfig>({
192192
// })
193193
}
194194

195-
const allowDocument = (f: string) => !!statSync(srcResolver.resolve(f)).size
195+
const allowDocument = (f: string) => {
196+
const isSchema = f.match(/([^/]+)\.(gql|graphql)$/)?.[0]?.toLowerCase().includes('schema')
197+
198+
return !isSchema && !!statSync(srcResolver.resolve(f)).size
199+
}
196200

197201
if (config.watch) {
198202
nuxt.hook('builder:watch', async (event, path) => {

0 commit comments

Comments
 (0)