nuxt-graphql-middleware 4.0.0-beta.8 → 4.0.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/module.mjs +10 -4
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -20,7 +20,7 @@ import * as PluginSchemaAst from '@graphql-codegen/schema-ast';
|
|
|
20
20
|
import { pascalCase } from 'change-case-all';
|
|
21
21
|
|
|
22
22
|
const name = "nuxt-graphql-middleware";
|
|
23
|
-
const version = "4.0.0-beta.
|
|
23
|
+
const version = "4.0.0-beta.9";
|
|
24
24
|
|
|
25
25
|
const DEVTOOLS_UI_ROUTE = "/__nuxt-graphql-middleware";
|
|
26
26
|
const DEVTOOLS_UI_LOCAL_PORT = 3300;
|
|
@@ -557,7 +557,8 @@ async function generate(options, schemaPath, resolver, srcDir, logEverything = f
|
|
|
557
557
|
const extracted = validated.filter(
|
|
558
558
|
(v) => !v.operation
|
|
559
559
|
);
|
|
560
|
-
validated.
|
|
560
|
+
for (let i = 0; i < validated.length; i++) {
|
|
561
|
+
const v = validated[i];
|
|
561
562
|
if (v.isValid) {
|
|
562
563
|
try {
|
|
563
564
|
const node = parse(v.content);
|
|
@@ -589,15 +590,20 @@ async function generate(options, schemaPath, resolver, srcDir, logEverything = f
|
|
|
589
590
|
});
|
|
590
591
|
} catch (e) {
|
|
591
592
|
logger.error(e);
|
|
593
|
+
extracted.push(v);
|
|
594
|
+
break;
|
|
592
595
|
}
|
|
596
|
+
} else {
|
|
597
|
+
extracted.push(v);
|
|
598
|
+
break;
|
|
593
599
|
}
|
|
594
|
-
}
|
|
600
|
+
}
|
|
595
601
|
const templates = await generateTemplates(
|
|
596
602
|
extracted.filter((v) => v.isValid).map((v) => v.content),
|
|
597
603
|
schemaPath,
|
|
598
604
|
options
|
|
599
605
|
);
|
|
600
|
-
const hasErrors = extracted.some((v) => !v.isValid);
|
|
606
|
+
const hasErrors = extracted.some((v) => !v.isValid) || validated.some((v) => !v.isValid);
|
|
601
607
|
if (hasErrors || logEverything) {
|
|
602
608
|
const table = new Table({
|
|
603
609
|
head: ["Operation", "Name", "File", "Errors"].map((v) => chalk.white(v))
|