@contello/client 1.2.0 → 1.2.1
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/cli.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var command = process.argv[2];
|
|
5
5
|
switch (command) {
|
|
6
6
|
case "generate":
|
|
7
|
-
await import("./generate-
|
|
7
|
+
await import("./generate-AVDKBRM7.js");
|
|
8
8
|
break;
|
|
9
9
|
default:
|
|
10
10
|
console.error(command ? `unknown command: ${command}` : "usage: contello-client <command>");
|
|
@@ -40,10 +40,15 @@ async function loadConfig(cwd) {
|
|
|
40
40
|
// src/generate/documents.ts
|
|
41
41
|
import {
|
|
42
42
|
Kind,
|
|
43
|
+
NoFragmentCyclesRule,
|
|
44
|
+
NoUnusedFragmentsRule,
|
|
43
45
|
getLocation,
|
|
44
46
|
print,
|
|
47
|
+
specifiedRules,
|
|
45
48
|
validate
|
|
46
49
|
} from "graphql";
|
|
50
|
+
var SUPPRESSED_RULE_NAMES = /* @__PURE__ */ new Set([NoFragmentCyclesRule.name, NoUnusedFragmentsRule.name]);
|
|
51
|
+
var VALIDATION_RULES = specifiedRules.filter((rule) => !SUPPRESSED_RULE_NAMES.has(rule.name));
|
|
47
52
|
function collectFragments(documents) {
|
|
48
53
|
const fragments = /* @__PURE__ */ new Map();
|
|
49
54
|
for (const doc of documents) {
|
|
@@ -126,7 +131,7 @@ function validateDocuments(schema, fragments, operations) {
|
|
|
126
131
|
kind: Kind.DOCUMENT,
|
|
127
132
|
definitions: [...fragments.values(), ...operations]
|
|
128
133
|
};
|
|
129
|
-
const errors = validate(schema, combined);
|
|
134
|
+
const errors = validate(schema, combined, VALIDATION_RULES);
|
|
130
135
|
if (errors.length === 0) {
|
|
131
136
|
return;
|
|
132
137
|
}
|