@contello/client 1.0.2 → 1.0.3
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-PEGBZG77.js");
|
|
8
8
|
break;
|
|
9
9
|
default:
|
|
10
10
|
console.error(command ? `unknown command: ${command}` : "usage: contello-client <command>");
|
|
@@ -149,6 +149,7 @@ async function introspectSchema(url, project, token) {
|
|
|
149
149
|
// src/generate/operation-types.ts
|
|
150
150
|
import {
|
|
151
151
|
Kind as Kind2,
|
|
152
|
+
doTypesOverlap as checkTypesOverlap,
|
|
152
153
|
isCompositeType,
|
|
153
154
|
isEnumType,
|
|
154
155
|
isInterfaceType,
|
|
@@ -314,6 +315,11 @@ ${nested.slice(2)}`);
|
|
|
314
315
|
if (fragment?.selectionSet) {
|
|
315
316
|
const fragmentType = schema.getType(fragment.typeCondition.name.value);
|
|
316
317
|
if (fragmentType && isCompositeType(fragmentType)) {
|
|
318
|
+
if (!checkTypesOverlap(schema, parentType, fragmentType)) {
|
|
319
|
+
throw new Error(
|
|
320
|
+
`fragment "${fragmentName}" (on ${fragmentType.name}) cannot be spread on type "${parentType.name}"`
|
|
321
|
+
);
|
|
322
|
+
}
|
|
317
323
|
const nextVisited = new Set(visited);
|
|
318
324
|
nextVisited.add(fragmentName);
|
|
319
325
|
const fragmentResult = resolveSelectionSet(
|