houdini 0.19.4 → 1.0.0-next.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/build/cmd-cjs/index.js +337 -355
- package/build/cmd-esm/index.js +337 -355
- package/build/codegen/utils/index.d.ts +0 -1
- package/build/codegen-cjs/index.js +324 -311
- package/build/codegen-esm/index.js +324 -311
- package/build/lib/graphql.d.ts +14 -0
- package/build/lib-cjs/index.js +119 -43
- package/build/lib-esm/index.js +115 -42
- package/build/runtime/lib/scalars.d.ts +1 -0
- package/build/runtime/lib/types.d.ts +1 -1
- package/build/runtime-cjs/lib/scalars.d.ts +1 -0
- package/build/runtime-cjs/lib/scalars.js +24 -1
- package/build/runtime-cjs/lib/types.d.ts +1 -1
- package/build/runtime-esm/lib/scalars.d.ts +1 -0
- package/build/runtime-esm/lib/scalars.js +23 -1
- package/build/runtime-esm/lib/types.d.ts +1 -1
- package/build/test-cjs/index.js +322 -309
- package/build/test-esm/index.js +322 -309
- package/build/vite-cjs/index.js +324 -311
- package/build/vite-esm/index.js +324 -311
- package/package.json +1 -1
- package/build/codegen/utils/graphql.d.ts +0 -15
package/build/vite-cjs/index.js
CHANGED
|
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
// ../../node_modules/.pnpm/minimatch@5.1.
|
|
33
|
+
// ../../node_modules/.pnpm/minimatch@5.1.2/node_modules/minimatch/lib/path.js
|
|
34
34
|
var require_path = __commonJS({
|
|
35
|
-
"../../node_modules/.pnpm/minimatch@5.1.
|
|
35
|
+
"../../node_modules/.pnpm/minimatch@5.1.2/node_modules/minimatch/lib/path.js"(exports, module2) {
|
|
36
36
|
var isWindows = typeof process === "object" && process && process.platform === "win32";
|
|
37
37
|
module2.exports = isWindows ? { sep: "\\" } : { sep: "/" };
|
|
38
38
|
}
|
|
@@ -249,9 +249,9 @@ var require_brace_expansion = __commonJS({
|
|
|
249
249
|
}
|
|
250
250
|
});
|
|
251
251
|
|
|
252
|
-
// ../../node_modules/.pnpm/minimatch@5.1.
|
|
252
|
+
// ../../node_modules/.pnpm/minimatch@5.1.2/node_modules/minimatch/minimatch.js
|
|
253
253
|
var require_minimatch = __commonJS({
|
|
254
|
-
"../../node_modules/.pnpm/minimatch@5.1.
|
|
254
|
+
"../../node_modules/.pnpm/minimatch@5.1.2/node_modules/minimatch/minimatch.js"(exports, module2) {
|
|
255
255
|
var minimatch3 = module2.exports = (p, pattern, options = {}) => {
|
|
256
256
|
assertValidPattern(pattern);
|
|
257
257
|
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
@@ -337,7 +337,9 @@ var require_minimatch = __commonJS({
|
|
|
337
337
|
return list;
|
|
338
338
|
};
|
|
339
339
|
var globUnescape = (s2) => s2.replace(/\\(.)/g, "$1");
|
|
340
|
+
var charUnescape = (s2) => s2.replace(/\\([^-\]])/g, "$1");
|
|
340
341
|
var regExpEscape = (s2) => s2.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
342
|
+
var braExpEscape = (s2) => s2.replace(/[[\]\\]/g, "\\$&");
|
|
341
343
|
var Minimatch = class {
|
|
342
344
|
constructor(pattern, options) {
|
|
343
345
|
assertValidPattern(pattern);
|
|
@@ -529,6 +531,10 @@ var require_minimatch = __commonJS({
|
|
|
529
531
|
return false;
|
|
530
532
|
}
|
|
531
533
|
case "\\":
|
|
534
|
+
if (inClass && pattern.charAt(i2 + 1) === "-") {
|
|
535
|
+
re += c;
|
|
536
|
+
continue;
|
|
537
|
+
}
|
|
532
538
|
clearStateChar();
|
|
533
539
|
escaping = true;
|
|
534
540
|
continue;
|
|
@@ -611,17 +617,13 @@ var require_minimatch = __commonJS({
|
|
|
611
617
|
}
|
|
612
618
|
cs = pattern.substring(classStart + 1, i2);
|
|
613
619
|
try {
|
|
614
|
-
RegExp("[" + cs + "]");
|
|
620
|
+
RegExp("[" + braExpEscape(charUnescape(cs)) + "]");
|
|
621
|
+
re += c;
|
|
615
622
|
} catch (er) {
|
|
616
|
-
|
|
617
|
-
re = re.substring(0, reClassStart) + "\\[" + sp[0] + "\\]";
|
|
618
|
-
hasMagic = hasMagic || sp[1];
|
|
619
|
-
inClass = false;
|
|
620
|
-
continue;
|
|
623
|
+
re = re.substring(0, reClassStart) + "(?:$.)";
|
|
621
624
|
}
|
|
622
625
|
hasMagic = true;
|
|
623
626
|
inClass = false;
|
|
624
|
-
re += c;
|
|
625
627
|
continue;
|
|
626
628
|
default:
|
|
627
629
|
clearStateChar();
|
|
@@ -13900,7 +13902,7 @@ var require_graphql = __commonJS({
|
|
|
13900
13902
|
Object.defineProperty(exports, "__esModule", {
|
|
13901
13903
|
value: true
|
|
13902
13904
|
});
|
|
13903
|
-
exports.graphql =
|
|
13905
|
+
exports.graphql = graphql29;
|
|
13904
13906
|
exports.graphqlSync = graphqlSync;
|
|
13905
13907
|
var _isPromise = _interopRequireDefault(require_isPromise());
|
|
13906
13908
|
var _parser = require_parser();
|
|
@@ -13910,7 +13912,7 @@ var require_graphql = __commonJS({
|
|
|
13910
13912
|
function _interopRequireDefault(obj) {
|
|
13911
13913
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
13912
13914
|
}
|
|
13913
|
-
function
|
|
13915
|
+
function graphql29(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) {
|
|
13914
13916
|
var _arguments = arguments;
|
|
13915
13917
|
return new Promise(function(resolve2) {
|
|
13916
13918
|
return resolve2(
|
|
@@ -30861,9 +30863,9 @@ var init_multipart_parser = __esm({
|
|
|
30861
30863
|
}
|
|
30862
30864
|
});
|
|
30863
30865
|
|
|
30864
|
-
// ../../node_modules/.pnpm/@babel+parser@7.20.
|
|
30866
|
+
// ../../node_modules/.pnpm/@babel+parser@7.20.7/node_modules/@babel/parser/lib/index.js
|
|
30865
30867
|
var require_lib3 = __commonJS({
|
|
30866
|
-
"../../node_modules/.pnpm/@babel+parser@7.20.
|
|
30868
|
+
"../../node_modules/.pnpm/@babel+parser@7.20.7/node_modules/@babel/parser/lib/index.js"(exports) {
|
|
30867
30869
|
"use strict";
|
|
30868
30870
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30869
30871
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
@@ -30979,9 +30981,9 @@ var require_lib3 = __commonJS({
|
|
|
30979
30981
|
AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.",
|
|
30980
30982
|
AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.",
|
|
30981
30983
|
AwaitNotInAsyncFunction: "'await' is only allowed within async functions.",
|
|
30982
|
-
BadGetterArity: "A 'get'
|
|
30983
|
-
BadSetterArity: "A 'set'
|
|
30984
|
-
BadSetterRestParameter: "A 'set'
|
|
30984
|
+
BadGetterArity: "A 'get' accessor must not have any formal parameters.",
|
|
30985
|
+
BadSetterArity: "A 'set' accessor must have exactly one formal parameter.",
|
|
30986
|
+
BadSetterRestParameter: "A 'set' accessor function argument must not be a rest parameter.",
|
|
30985
30987
|
ConstructorClassField: "Classes may not have a field named 'constructor'.",
|
|
30986
30988
|
ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.",
|
|
30987
30989
|
ConstructorIsAccessor: "Class constructor may not be an accessor.",
|
|
@@ -34415,7 +34417,7 @@ var require_lib3 = __commonJS({
|
|
|
34415
34417
|
}
|
|
34416
34418
|
this.parser.raise(toParseError, origin);
|
|
34417
34419
|
}
|
|
34418
|
-
|
|
34420
|
+
recordArrowParameterBindingError(error, {
|
|
34419
34421
|
at: node
|
|
34420
34422
|
}) {
|
|
34421
34423
|
const {
|
|
@@ -38174,6 +38176,7 @@ var require_lib3 = __commonJS({
|
|
|
38174
38176
|
}) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`,
|
|
38175
38177
|
AccesorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.",
|
|
38176
38178
|
AccesorCannotHaveTypeParameters: "An accessor cannot have type parameters.",
|
|
38179
|
+
AccessorCannotBeOptional: "An 'accessor' property cannot be declared optional.",
|
|
38177
38180
|
ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.",
|
|
38178
38181
|
ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.",
|
|
38179
38182
|
ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",
|
|
@@ -40136,8 +40139,12 @@ var require_lib3 = __commonJS({
|
|
|
40136
40139
|
node.typeParameters = typeParameters;
|
|
40137
40140
|
}
|
|
40138
40141
|
parseClassPropertyAnnotation(node) {
|
|
40139
|
-
if (!node.optional
|
|
40140
|
-
|
|
40142
|
+
if (!node.optional) {
|
|
40143
|
+
if (this.eat(35)) {
|
|
40144
|
+
node.definite = true;
|
|
40145
|
+
} else if (this.eat(17)) {
|
|
40146
|
+
node.optional = true;
|
|
40147
|
+
}
|
|
40141
40148
|
}
|
|
40142
40149
|
const type = this.tsTryParseTypeAnnotation();
|
|
40143
40150
|
if (type)
|
|
@@ -40176,6 +40183,15 @@ var require_lib3 = __commonJS({
|
|
|
40176
40183
|
this.parseClassPropertyAnnotation(node);
|
|
40177
40184
|
return super.parseClassPrivateProperty(node);
|
|
40178
40185
|
}
|
|
40186
|
+
parseClassAccessorProperty(node) {
|
|
40187
|
+
this.parseClassPropertyAnnotation(node);
|
|
40188
|
+
if (node.optional) {
|
|
40189
|
+
this.raise(TSErrors.AccessorCannotBeOptional, {
|
|
40190
|
+
at: node
|
|
40191
|
+
});
|
|
40192
|
+
}
|
|
40193
|
+
return super.parseClassAccessorProperty(node);
|
|
40194
|
+
}
|
|
40179
40195
|
pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
|
|
40180
40196
|
const typeParameters = this.tsTryParseTypeParameters();
|
|
40181
40197
|
if (typeParameters && isConstructor) {
|
|
@@ -40386,7 +40402,7 @@ var require_lib3 = __commonJS({
|
|
|
40386
40402
|
case "TSNonNullExpression":
|
|
40387
40403
|
case "TSTypeAssertion":
|
|
40388
40404
|
if (isLHS) {
|
|
40389
|
-
this.expressionScope.
|
|
40405
|
+
this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter, {
|
|
40390
40406
|
at: node
|
|
40391
40407
|
});
|
|
40392
40408
|
} else {
|
|
@@ -41093,7 +41109,7 @@ var require_lib3 = __commonJS({
|
|
|
41093
41109
|
parenthesized = unwrapParenthesizedExpression(node);
|
|
41094
41110
|
if (isLHS) {
|
|
41095
41111
|
if (parenthesized.type === "Identifier") {
|
|
41096
|
-
this.expressionScope.
|
|
41112
|
+
this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment, {
|
|
41097
41113
|
at: node
|
|
41098
41114
|
});
|
|
41099
41115
|
} else if (parenthesized.type !== "MemberExpression") {
|
|
@@ -61938,7 +61954,7 @@ function watchAndRun(params) {
|
|
|
61938
61954
|
}
|
|
61939
61955
|
|
|
61940
61956
|
// src/codegen/index.ts
|
|
61941
|
-
var
|
|
61957
|
+
var graphql28 = __toESM(require_graphql2(), 1);
|
|
61942
61958
|
|
|
61943
61959
|
// src/lib/pipeline.ts
|
|
61944
61960
|
async function runPipeline(config4, pipeline2, target) {
|
|
@@ -69112,6 +69128,60 @@ function formatErrors(e2, afterError) {
|
|
|
69112
69128
|
afterError?.(e2);
|
|
69113
69129
|
}
|
|
69114
69130
|
}
|
|
69131
|
+
function unwrapType(config4, type, wrappers = []) {
|
|
69132
|
+
if (type.kind === "NonNullType") {
|
|
69133
|
+
return unwrapType(config4, type.type, [TypeWrapper.NonNull, ...wrappers]);
|
|
69134
|
+
}
|
|
69135
|
+
if (type instanceof graphql3.GraphQLNonNull) {
|
|
69136
|
+
return unwrapType(config4, type.ofType, [TypeWrapper.NonNull, ...wrappers]);
|
|
69137
|
+
}
|
|
69138
|
+
if (wrappers[0] !== TypeWrapper.NonNull) {
|
|
69139
|
+
wrappers.unshift(TypeWrapper.Nullable);
|
|
69140
|
+
}
|
|
69141
|
+
if (type.kind === "ListType") {
|
|
69142
|
+
return unwrapType(config4, type.type, [TypeWrapper.List, ...wrappers]);
|
|
69143
|
+
}
|
|
69144
|
+
if (type instanceof graphql3.GraphQLList) {
|
|
69145
|
+
return unwrapType(config4, type.ofType, [TypeWrapper.List, ...wrappers]);
|
|
69146
|
+
}
|
|
69147
|
+
const namedType = config4.schema.getType(type.name.value || type.name);
|
|
69148
|
+
if (!namedType) {
|
|
69149
|
+
throw new Error("Could not unwrap type: " + JSON.stringify(type));
|
|
69150
|
+
}
|
|
69151
|
+
return { type: namedType, wrappers };
|
|
69152
|
+
}
|
|
69153
|
+
function wrapType({
|
|
69154
|
+
type,
|
|
69155
|
+
wrappers
|
|
69156
|
+
}) {
|
|
69157
|
+
const head = wrappers[0];
|
|
69158
|
+
const tail = wrappers.slice(1);
|
|
69159
|
+
let kind = graphql3.Kind.NAMED_TYPE;
|
|
69160
|
+
if (head === TypeWrapper.List) {
|
|
69161
|
+
kind = graphql3.Kind.LIST_TYPE;
|
|
69162
|
+
} else if (head === TypeWrapper.NonNull) {
|
|
69163
|
+
kind = graphql3.Kind.NON_NULL_TYPE;
|
|
69164
|
+
}
|
|
69165
|
+
if (kind === "NamedType") {
|
|
69166
|
+
return {
|
|
69167
|
+
kind,
|
|
69168
|
+
name: {
|
|
69169
|
+
kind: graphql3.Kind.NAME,
|
|
69170
|
+
value: type.name
|
|
69171
|
+
}
|
|
69172
|
+
};
|
|
69173
|
+
}
|
|
69174
|
+
return {
|
|
69175
|
+
kind,
|
|
69176
|
+
type: wrapType({ type, wrappers: tail })
|
|
69177
|
+
};
|
|
69178
|
+
}
|
|
69179
|
+
var TypeWrapper = /* @__PURE__ */ ((TypeWrapper2) => {
|
|
69180
|
+
TypeWrapper2["Nullable"] = "Nullable";
|
|
69181
|
+
TypeWrapper2["List"] = "List";
|
|
69182
|
+
TypeWrapper2["NonNull"] = "NonNull";
|
|
69183
|
+
return TypeWrapper2;
|
|
69184
|
+
})(TypeWrapper || {});
|
|
69115
69185
|
|
|
69116
69186
|
// src/lib/parse.ts
|
|
69117
69187
|
var import_parser = __toESM(require_lib3(), 1);
|
|
@@ -69356,7 +69426,7 @@ async function find_graphql(config4, parsedScript, walker) {
|
|
|
69356
69426
|
}
|
|
69357
69427
|
|
|
69358
69428
|
// src/codegen/generators/artifacts/index.ts
|
|
69359
|
-
var
|
|
69429
|
+
var graphql13 = __toESM(require_graphql2(), 1);
|
|
69360
69430
|
var recast5 = __toESM(require_main2(), 1);
|
|
69361
69431
|
|
|
69362
69432
|
// src/codegen/utils/commonjs.ts
|
|
@@ -69532,63 +69602,6 @@ var FieldCollection = class {
|
|
|
69532
69602
|
}
|
|
69533
69603
|
};
|
|
69534
69604
|
|
|
69535
|
-
// src/codegen/utils/graphql.ts
|
|
69536
|
-
var graphql5 = __toESM(require_graphql2(), 1);
|
|
69537
|
-
function unwrapType(config4, type, wrappers = []) {
|
|
69538
|
-
if (type.kind === "NonNullType") {
|
|
69539
|
-
return unwrapType(config4, type.type, [TypeWrapper.NonNull, ...wrappers]);
|
|
69540
|
-
}
|
|
69541
|
-
if (type instanceof graphql5.GraphQLNonNull) {
|
|
69542
|
-
return unwrapType(config4, type.ofType, [TypeWrapper.NonNull, ...wrappers]);
|
|
69543
|
-
}
|
|
69544
|
-
if (wrappers[0] !== TypeWrapper.NonNull) {
|
|
69545
|
-
wrappers.unshift(TypeWrapper.Nullable);
|
|
69546
|
-
}
|
|
69547
|
-
if (type.kind === "ListType") {
|
|
69548
|
-
return unwrapType(config4, type.type, [TypeWrapper.List, ...wrappers]);
|
|
69549
|
-
}
|
|
69550
|
-
if (type instanceof graphql5.GraphQLList) {
|
|
69551
|
-
return unwrapType(config4, type.ofType, [TypeWrapper.List, ...wrappers]);
|
|
69552
|
-
}
|
|
69553
|
-
const namedType = config4.schema.getType(type.name.value || type.name);
|
|
69554
|
-
if (!namedType) {
|
|
69555
|
-
throw new Error("Could not unwrap type: " + JSON.stringify(type));
|
|
69556
|
-
}
|
|
69557
|
-
return { type: namedType, wrappers };
|
|
69558
|
-
}
|
|
69559
|
-
function wrapType({
|
|
69560
|
-
type,
|
|
69561
|
-
wrappers
|
|
69562
|
-
}) {
|
|
69563
|
-
const head = wrappers[0];
|
|
69564
|
-
const tail = wrappers.slice(1);
|
|
69565
|
-
let kind = graphql5.Kind.NAMED_TYPE;
|
|
69566
|
-
if (head === TypeWrapper.List) {
|
|
69567
|
-
kind = graphql5.Kind.LIST_TYPE;
|
|
69568
|
-
} else if (head === TypeWrapper.NonNull) {
|
|
69569
|
-
kind = graphql5.Kind.NON_NULL_TYPE;
|
|
69570
|
-
}
|
|
69571
|
-
if (kind === "NamedType") {
|
|
69572
|
-
return {
|
|
69573
|
-
kind,
|
|
69574
|
-
name: {
|
|
69575
|
-
kind: graphql5.Kind.NAME,
|
|
69576
|
-
value: type.name
|
|
69577
|
-
}
|
|
69578
|
-
};
|
|
69579
|
-
}
|
|
69580
|
-
return {
|
|
69581
|
-
kind,
|
|
69582
|
-
type: wrapType({ type, wrappers: tail })
|
|
69583
|
-
};
|
|
69584
|
-
}
|
|
69585
|
-
var TypeWrapper = /* @__PURE__ */ ((TypeWrapper2) => {
|
|
69586
|
-
TypeWrapper2["Nullable"] = "Nullable";
|
|
69587
|
-
TypeWrapper2["List"] = "List";
|
|
69588
|
-
TypeWrapper2["NonNull"] = "NonNull";
|
|
69589
|
-
return TypeWrapper2;
|
|
69590
|
-
})(TypeWrapper || {});
|
|
69591
|
-
|
|
69592
69605
|
// src/codegen/utils/moduleExport.ts
|
|
69593
69606
|
var recast2 = __toESM(require_main2(), 1);
|
|
69594
69607
|
var AST2 = recast2.types.builders;
|
|
@@ -69675,7 +69688,7 @@ ${exportDefaultFrom(`./${doc.name}`, doc.name)}`,
|
|
|
69675
69688
|
}
|
|
69676
69689
|
|
|
69677
69690
|
// src/codegen/generators/artifacts/inputs.ts
|
|
69678
|
-
var
|
|
69691
|
+
var graphql5 = __toESM(require_graphql2(), 1);
|
|
69679
69692
|
var recast3 = __toESM(require_main2(), 1);
|
|
69680
69693
|
var AST3 = recast3.types.builders;
|
|
69681
69694
|
function inputObject(config4, inputs) {
|
|
@@ -69700,10 +69713,10 @@ function walkInputs(config4, visitedTypes, inputObj, rootType) {
|
|
|
69700
69713
|
if (visitedTypes.has(type.name)) {
|
|
69701
69714
|
return;
|
|
69702
69715
|
}
|
|
69703
|
-
if (
|
|
69716
|
+
if (graphql5.isEnumType(type) || graphql5.isScalarType(type)) {
|
|
69704
69717
|
return;
|
|
69705
69718
|
}
|
|
69706
|
-
if (
|
|
69719
|
+
if (graphql5.isUnionType(type)) {
|
|
69707
69720
|
return;
|
|
69708
69721
|
}
|
|
69709
69722
|
visitedTypes.add(type.name);
|
|
@@ -69721,10 +69734,10 @@ function walkInputs(config4, visitedTypes, inputObj, rootType) {
|
|
|
69721
69734
|
}
|
|
69722
69735
|
|
|
69723
69736
|
// src/codegen/generators/artifacts/operations.ts
|
|
69724
|
-
var
|
|
69737
|
+
var graphql7 = __toESM(require_graphql2(), 1);
|
|
69725
69738
|
|
|
69726
69739
|
// src/codegen/generators/artifacts/utils.ts
|
|
69727
|
-
var
|
|
69740
|
+
var graphql6 = __toESM(require_graphql2(), 1);
|
|
69728
69741
|
var recast4 = __toESM(require_main2(), 1);
|
|
69729
69742
|
var AST4 = recast4.types.builders;
|
|
69730
69743
|
function serializeValue(value) {
|
|
@@ -69776,19 +69789,19 @@ function deepMerge(filepath, ...targets) {
|
|
|
69776
69789
|
function convertValue(config4, val) {
|
|
69777
69790
|
let value;
|
|
69778
69791
|
let kind;
|
|
69779
|
-
if (val.kind ===
|
|
69792
|
+
if (val.kind === graphql6.Kind.INT) {
|
|
69780
69793
|
value = parseInt(val.value, 10);
|
|
69781
69794
|
kind = "Int";
|
|
69782
|
-
} else if (val.kind ===
|
|
69795
|
+
} else if (val.kind === graphql6.Kind.FLOAT) {
|
|
69783
69796
|
value = parseFloat(val.value);
|
|
69784
69797
|
kind = "Float";
|
|
69785
|
-
} else if (val.kind ===
|
|
69798
|
+
} else if (val.kind === graphql6.Kind.BOOLEAN) {
|
|
69786
69799
|
value = val.value;
|
|
69787
69800
|
kind = "Boolean";
|
|
69788
|
-
} else if (val.kind ===
|
|
69801
|
+
} else if (val.kind === graphql6.Kind.VARIABLE) {
|
|
69789
69802
|
value = val.name.value;
|
|
69790
69803
|
kind = "Variable";
|
|
69791
|
-
} else if (val.kind ===
|
|
69804
|
+
} else if (val.kind === graphql6.Kind.STRING) {
|
|
69792
69805
|
value = val.value;
|
|
69793
69806
|
kind = "String";
|
|
69794
69807
|
}
|
|
@@ -69801,7 +69814,7 @@ function operationsByPath(config4, filepath, definition, filterTypes) {
|
|
|
69801
69814
|
return {};
|
|
69802
69815
|
}
|
|
69803
69816
|
const pathOperations = {};
|
|
69804
|
-
|
|
69817
|
+
graphql7.visit(definition, {
|
|
69805
69818
|
FragmentSpread(node, _, __, ___, ancestors) {
|
|
69806
69819
|
if (!config4.isListFragment(node.name.value)) {
|
|
69807
69820
|
return;
|
|
@@ -69960,7 +69973,7 @@ function ancestorKey(ancestors) {
|
|
|
69960
69973
|
}
|
|
69961
69974
|
|
|
69962
69975
|
// src/codegen/generators/artifacts/selection.ts
|
|
69963
|
-
var
|
|
69976
|
+
var graphql12 = __toESM(require_graphql2(), 1);
|
|
69964
69977
|
|
|
69965
69978
|
// ../../node_modules/.pnpm/@kitql+helper@0.5.0/node_modules/@kitql/helper/index.mjs
|
|
69966
69979
|
var config2 = {
|
|
@@ -70006,16 +70019,16 @@ async function sleep2(ms) {
|
|
|
70006
70019
|
}
|
|
70007
70020
|
|
|
70008
70021
|
// src/codegen/transforms/list.ts
|
|
70009
|
-
var
|
|
70022
|
+
var graphql10 = __toESM(require_graphql2(), 1);
|
|
70010
70023
|
|
|
70011
70024
|
// src/codegen/utils/objectIdentificationSelection.ts
|
|
70012
|
-
var
|
|
70025
|
+
var graphql8 = __toESM(require_graphql2(), 1);
|
|
70013
70026
|
var objectIdentificationSelection = (config4, type) => {
|
|
70014
70027
|
return config4.keyFieldsForType(type.name).map((key) => {
|
|
70015
70028
|
return {
|
|
70016
|
-
kind:
|
|
70029
|
+
kind: graphql8.Kind.FIELD,
|
|
70017
70030
|
name: {
|
|
70018
|
-
kind:
|
|
70031
|
+
kind: graphql8.Kind.NAME,
|
|
70019
70032
|
value: key
|
|
70020
70033
|
}
|
|
70021
70034
|
};
|
|
@@ -70023,7 +70036,7 @@ var objectIdentificationSelection = (config4, type) => {
|
|
|
70023
70036
|
};
|
|
70024
70037
|
|
|
70025
70038
|
// src/codegen/transforms/paginate.ts
|
|
70026
|
-
var
|
|
70039
|
+
var graphql9 = __toESM(require_graphql2(), 1);
|
|
70027
70040
|
async function paginate(config4, documents) {
|
|
70028
70041
|
const newDocs = [];
|
|
70029
70042
|
for (const doc of documents) {
|
|
@@ -70056,7 +70069,7 @@ async function paginate(config4, documents) {
|
|
|
70056
70069
|
};
|
|
70057
70070
|
let cursorType = "String";
|
|
70058
70071
|
let paginationPath = [];
|
|
70059
|
-
doc.document =
|
|
70072
|
+
doc.document = graphql9.visit(doc.document, {
|
|
70060
70073
|
Field(node, _, __, ___, ancestors) {
|
|
70061
70074
|
const paginateDirective = node.directives?.find(
|
|
70062
70075
|
(directive) => directive.name.value === config4.paginateDirective
|
|
@@ -70083,7 +70096,7 @@ async function paginate(config4, documents) {
|
|
|
70083
70096
|
flags.offset.enabled = offsetPagination;
|
|
70084
70097
|
flags.limit.enabled = offsetPagination;
|
|
70085
70098
|
paginationPath = ancestors.filter(
|
|
70086
|
-
(ancestor) => !Array.isArray(ancestor) && ancestor.kind ===
|
|
70099
|
+
(ancestor) => !Array.isArray(ancestor) && ancestor.kind === graphql9.Kind.FIELD
|
|
70087
70100
|
).concat(node).map((field) => field.alias?.value || field.name.value);
|
|
70088
70101
|
return {
|
|
70089
70102
|
...node,
|
|
@@ -70104,7 +70117,7 @@ async function paginate(config4, documents) {
|
|
|
70104
70117
|
refetchUpdate = "prepend" /* prepend */;
|
|
70105
70118
|
}
|
|
70106
70119
|
let fragment = "";
|
|
70107
|
-
doc.document =
|
|
70120
|
+
doc.document = graphql9.visit(doc.document, {
|
|
70108
70121
|
OperationDefinition(node) {
|
|
70109
70122
|
if (node.operation !== "query") {
|
|
70110
70123
|
throw new HoudiniError({
|
|
@@ -70158,9 +70171,9 @@ async function paginate(config4, documents) {
|
|
|
70158
70171
|
directives: [
|
|
70159
70172
|
...node.directives || [],
|
|
70160
70173
|
{
|
|
70161
|
-
kind:
|
|
70174
|
+
kind: graphql9.Kind.DIRECTIVE,
|
|
70162
70175
|
name: {
|
|
70163
|
-
kind:
|
|
70176
|
+
kind: graphql9.Kind.NAME,
|
|
70164
70177
|
value: config4.argumentsDirective
|
|
70165
70178
|
}
|
|
70166
70179
|
}
|
|
@@ -70223,16 +70236,16 @@ async function paginate(config4, documents) {
|
|
|
70223
70236
|
const paginationArgs = Object.entries(flags).filter(([_, { enabled }]) => enabled).map(([key, value]) => ({ name: key, ...value }));
|
|
70224
70237
|
const fragmentSpreadSelection = [
|
|
70225
70238
|
{
|
|
70226
|
-
kind:
|
|
70239
|
+
kind: graphql9.Kind.FRAGMENT_SPREAD,
|
|
70227
70240
|
name: {
|
|
70228
|
-
kind:
|
|
70241
|
+
kind: graphql9.Kind.NAME,
|
|
70229
70242
|
value: fragmentName
|
|
70230
70243
|
},
|
|
70231
70244
|
directives: [
|
|
70232
70245
|
{
|
|
70233
|
-
kind:
|
|
70246
|
+
kind: graphql9.Kind.DIRECTIVE,
|
|
70234
70247
|
name: {
|
|
70235
|
-
kind:
|
|
70248
|
+
kind: graphql9.Kind.NAME,
|
|
70236
70249
|
value: config4.withDirective
|
|
70237
70250
|
},
|
|
70238
70251
|
["arguments"]: paginationArgs.map(
|
|
@@ -70260,29 +70273,29 @@ async function paginate(config4, documents) {
|
|
|
70260
70273
|
});
|
|
70261
70274
|
const typeConfig = config4.typeConfig?.[fragment];
|
|
70262
70275
|
const queryDoc = {
|
|
70263
|
-
kind:
|
|
70276
|
+
kind: graphql9.Kind.DOCUMENT,
|
|
70264
70277
|
definitions: [
|
|
70265
70278
|
{
|
|
70266
|
-
kind:
|
|
70279
|
+
kind: graphql9.Kind.OPERATION_DEFINITION,
|
|
70267
70280
|
name: {
|
|
70268
|
-
kind:
|
|
70281
|
+
kind: graphql9.Kind.NAME,
|
|
70269
70282
|
value: refetchQueryName
|
|
70270
70283
|
},
|
|
70271
70284
|
operation: "query",
|
|
70272
70285
|
variableDefinitions: paginationArgs.map(
|
|
70273
70286
|
(arg) => ({
|
|
70274
|
-
kind:
|
|
70287
|
+
kind: graphql9.Kind.VARIABLE_DEFINITION,
|
|
70275
70288
|
type: {
|
|
70276
|
-
kind:
|
|
70289
|
+
kind: graphql9.Kind.NAMED_TYPE,
|
|
70277
70290
|
name: {
|
|
70278
|
-
kind:
|
|
70291
|
+
kind: graphql9.Kind.NAME,
|
|
70279
70292
|
value: arg.type
|
|
70280
70293
|
}
|
|
70281
70294
|
},
|
|
70282
70295
|
variable: {
|
|
70283
|
-
kind:
|
|
70296
|
+
kind: graphql9.Kind.VARIABLE,
|
|
70284
70297
|
name: {
|
|
70285
|
-
kind:
|
|
70298
|
+
kind: graphql9.Kind.NAME,
|
|
70286
70299
|
value: arg.name
|
|
70287
70300
|
}
|
|
70288
70301
|
},
|
|
@@ -70294,12 +70307,12 @@ async function paginate(config4, documents) {
|
|
|
70294
70307
|
).concat(
|
|
70295
70308
|
!nodeQuery ? [] : keys.map(
|
|
70296
70309
|
(key) => ({
|
|
70297
|
-
kind:
|
|
70310
|
+
kind: graphql9.Kind.VARIABLE_DEFINITION,
|
|
70298
70311
|
type: key.type,
|
|
70299
70312
|
variable: {
|
|
70300
|
-
kind:
|
|
70313
|
+
kind: graphql9.Kind.VARIABLE,
|
|
70301
70314
|
name: {
|
|
70302
|
-
kind:
|
|
70315
|
+
kind: graphql9.Kind.NAME,
|
|
70303
70316
|
value: key.name
|
|
70304
70317
|
}
|
|
70305
70318
|
}
|
|
@@ -70307,42 +70320,42 @@ async function paginate(config4, documents) {
|
|
|
70307
70320
|
)
|
|
70308
70321
|
),
|
|
70309
70322
|
selectionSet: {
|
|
70310
|
-
kind:
|
|
70323
|
+
kind: graphql9.Kind.SELECTION_SET,
|
|
70311
70324
|
selections: !nodeQuery ? fragmentSpreadSelection : [
|
|
70312
70325
|
{
|
|
70313
|
-
kind:
|
|
70326
|
+
kind: graphql9.Kind.FIELD,
|
|
70314
70327
|
name: {
|
|
70315
|
-
kind:
|
|
70328
|
+
kind: graphql9.Kind.NAME,
|
|
70316
70329
|
value: typeConfig?.resolve?.queryField || "node"
|
|
70317
70330
|
},
|
|
70318
70331
|
["arguments"]: keys.map((key) => ({
|
|
70319
|
-
kind:
|
|
70332
|
+
kind: graphql9.Kind.ARGUMENT,
|
|
70320
70333
|
name: {
|
|
70321
|
-
kind:
|
|
70334
|
+
kind: graphql9.Kind.NAME,
|
|
70322
70335
|
value: key.name
|
|
70323
70336
|
},
|
|
70324
70337
|
value: {
|
|
70325
|
-
kind:
|
|
70338
|
+
kind: graphql9.Kind.VARIABLE,
|
|
70326
70339
|
name: {
|
|
70327
|
-
kind:
|
|
70340
|
+
kind: graphql9.Kind.NAME,
|
|
70328
70341
|
value: key.name
|
|
70329
70342
|
}
|
|
70330
70343
|
}
|
|
70331
70344
|
})),
|
|
70332
70345
|
selectionSet: {
|
|
70333
|
-
kind:
|
|
70346
|
+
kind: graphql9.Kind.SELECTION_SET,
|
|
70334
70347
|
selections: [
|
|
70335
70348
|
{
|
|
70336
|
-
kind:
|
|
70349
|
+
kind: graphql9.Kind.FIELD,
|
|
70337
70350
|
name: {
|
|
70338
|
-
kind:
|
|
70351
|
+
kind: graphql9.Kind.NAME,
|
|
70339
70352
|
value: "__typename"
|
|
70340
70353
|
}
|
|
70341
70354
|
},
|
|
70342
70355
|
...(typeConfig?.keys || ["id"]).map((key) => ({
|
|
70343
|
-
kind:
|
|
70356
|
+
kind: graphql9.Kind.FIELD,
|
|
70344
70357
|
name: {
|
|
70345
|
-
kind:
|
|
70358
|
+
kind: graphql9.Kind.NAME,
|
|
70346
70359
|
value: key
|
|
70347
70360
|
}
|
|
70348
70361
|
})),
|
|
@@ -70404,15 +70417,15 @@ function replaceArgumentsWithVariables(args, flags) {
|
|
|
70404
70417
|
}
|
|
70405
70418
|
function variableAsArgument(name2, variable) {
|
|
70406
70419
|
return {
|
|
70407
|
-
kind:
|
|
70420
|
+
kind: graphql9.Kind.ARGUMENT,
|
|
70408
70421
|
name: {
|
|
70409
|
-
kind:
|
|
70422
|
+
kind: graphql9.Kind.NAME,
|
|
70410
70423
|
value: name2
|
|
70411
70424
|
},
|
|
70412
70425
|
value: {
|
|
70413
|
-
kind:
|
|
70426
|
+
kind: graphql9.Kind.VARIABLE,
|
|
70414
70427
|
name: {
|
|
70415
|
-
kind:
|
|
70428
|
+
kind: graphql9.Kind.NAME,
|
|
70416
70429
|
value: variable ?? name2
|
|
70417
70430
|
}
|
|
70418
70431
|
}
|
|
@@ -70420,18 +70433,18 @@ function variableAsArgument(name2, variable) {
|
|
|
70420
70433
|
}
|
|
70421
70434
|
function staticVariableDefinition(name2, type, defaultValue, variableName) {
|
|
70422
70435
|
return {
|
|
70423
|
-
kind:
|
|
70436
|
+
kind: graphql9.Kind.VARIABLE_DEFINITION,
|
|
70424
70437
|
type: {
|
|
70425
|
-
kind:
|
|
70438
|
+
kind: graphql9.Kind.NAMED_TYPE,
|
|
70426
70439
|
name: {
|
|
70427
|
-
kind:
|
|
70440
|
+
kind: graphql9.Kind.NAME,
|
|
70428
70441
|
value: type
|
|
70429
70442
|
}
|
|
70430
70443
|
},
|
|
70431
70444
|
variable: {
|
|
70432
|
-
kind:
|
|
70445
|
+
kind: graphql9.Kind.VARIABLE,
|
|
70433
70446
|
name: {
|
|
70434
|
-
kind:
|
|
70447
|
+
kind: graphql9.Kind.NAME,
|
|
70435
70448
|
value: variableName ?? name2
|
|
70436
70449
|
}
|
|
70437
70450
|
},
|
|
@@ -70443,9 +70456,9 @@ function staticVariableDefinition(name2, type, defaultValue, variableName) {
|
|
|
70443
70456
|
}
|
|
70444
70457
|
function argumentNode(name2, value) {
|
|
70445
70458
|
return {
|
|
70446
|
-
kind:
|
|
70459
|
+
kind: graphql9.Kind.ARGUMENT,
|
|
70447
70460
|
name: {
|
|
70448
|
-
kind:
|
|
70461
|
+
kind: graphql9.Kind.NAME,
|
|
70449
70462
|
value: name2
|
|
70450
70463
|
},
|
|
70451
70464
|
value: objectNode(value)
|
|
@@ -70453,16 +70466,16 @@ function argumentNode(name2, value) {
|
|
|
70453
70466
|
}
|
|
70454
70467
|
function objectNode([type, defaultValue]) {
|
|
70455
70468
|
const node = {
|
|
70456
|
-
kind:
|
|
70469
|
+
kind: graphql9.Kind.OBJECT,
|
|
70457
70470
|
fields: [
|
|
70458
70471
|
{
|
|
70459
|
-
kind:
|
|
70472
|
+
kind: graphql9.Kind.OBJECT_FIELD,
|
|
70460
70473
|
name: {
|
|
70461
|
-
kind:
|
|
70474
|
+
kind: graphql9.Kind.NAME,
|
|
70462
70475
|
value: "type"
|
|
70463
70476
|
},
|
|
70464
70477
|
value: {
|
|
70465
|
-
kind:
|
|
70478
|
+
kind: graphql9.Kind.STRING,
|
|
70466
70479
|
value: type
|
|
70467
70480
|
}
|
|
70468
70481
|
}
|
|
@@ -70470,8 +70483,8 @@ function objectNode([type, defaultValue]) {
|
|
|
70470
70483
|
};
|
|
70471
70484
|
if (defaultValue) {
|
|
70472
70485
|
node.fields.push({
|
|
70473
|
-
kind:
|
|
70474
|
-
name: { kind:
|
|
70486
|
+
kind: graphql9.Kind.OBJECT_FIELD,
|
|
70487
|
+
name: { kind: graphql9.Kind.NAME, value: "default" },
|
|
70475
70488
|
value: {
|
|
70476
70489
|
kind: typeof defaultValue === "number" ? "IntValue" : "StringValue",
|
|
70477
70490
|
value: defaultValue.toString()
|
|
@@ -70482,34 +70495,34 @@ function objectNode([type, defaultValue]) {
|
|
|
70482
70495
|
}
|
|
70483
70496
|
var pageInfoSelection = [
|
|
70484
70497
|
{
|
|
70485
|
-
kind:
|
|
70498
|
+
kind: graphql9.Kind.FIELD,
|
|
70486
70499
|
name: {
|
|
70487
|
-
kind:
|
|
70500
|
+
kind: graphql9.Kind.NAME,
|
|
70488
70501
|
value: "edges"
|
|
70489
70502
|
},
|
|
70490
70503
|
selectionSet: {
|
|
70491
|
-
kind:
|
|
70504
|
+
kind: graphql9.Kind.SELECTION_SET,
|
|
70492
70505
|
selections: [
|
|
70493
70506
|
{
|
|
70494
|
-
kind:
|
|
70507
|
+
kind: graphql9.Kind.FIELD,
|
|
70495
70508
|
name: {
|
|
70496
|
-
kind:
|
|
70509
|
+
kind: graphql9.Kind.NAME,
|
|
70497
70510
|
value: "cursor"
|
|
70498
70511
|
}
|
|
70499
70512
|
},
|
|
70500
70513
|
{
|
|
70501
|
-
kind:
|
|
70514
|
+
kind: graphql9.Kind.FIELD,
|
|
70502
70515
|
name: {
|
|
70503
|
-
kind:
|
|
70516
|
+
kind: graphql9.Kind.NAME,
|
|
70504
70517
|
value: "node"
|
|
70505
70518
|
},
|
|
70506
70519
|
selectionSet: {
|
|
70507
|
-
kind:
|
|
70520
|
+
kind: graphql9.Kind.SELECTION_SET,
|
|
70508
70521
|
selections: [
|
|
70509
70522
|
{
|
|
70510
|
-
kind:
|
|
70523
|
+
kind: graphql9.Kind.FIELD,
|
|
70511
70524
|
name: {
|
|
70512
|
-
kind:
|
|
70525
|
+
kind: graphql9.Kind.NAME,
|
|
70513
70526
|
value: "__typename"
|
|
70514
70527
|
}
|
|
70515
70528
|
}
|
|
@@ -70520,39 +70533,39 @@ var pageInfoSelection = [
|
|
|
70520
70533
|
}
|
|
70521
70534
|
},
|
|
70522
70535
|
{
|
|
70523
|
-
kind:
|
|
70536
|
+
kind: graphql9.Kind.FIELD,
|
|
70524
70537
|
name: {
|
|
70525
|
-
kind:
|
|
70538
|
+
kind: graphql9.Kind.NAME,
|
|
70526
70539
|
value: "pageInfo"
|
|
70527
70540
|
},
|
|
70528
70541
|
selectionSet: {
|
|
70529
|
-
kind:
|
|
70542
|
+
kind: graphql9.Kind.SELECTION_SET,
|
|
70530
70543
|
selections: [
|
|
70531
70544
|
{
|
|
70532
|
-
kind:
|
|
70545
|
+
kind: graphql9.Kind.FIELD,
|
|
70533
70546
|
name: {
|
|
70534
|
-
kind:
|
|
70547
|
+
kind: graphql9.Kind.NAME,
|
|
70535
70548
|
value: "hasPreviousPage"
|
|
70536
70549
|
}
|
|
70537
70550
|
},
|
|
70538
70551
|
{
|
|
70539
|
-
kind:
|
|
70552
|
+
kind: graphql9.Kind.FIELD,
|
|
70540
70553
|
name: {
|
|
70541
|
-
kind:
|
|
70554
|
+
kind: graphql9.Kind.NAME,
|
|
70542
70555
|
value: "hasNextPage"
|
|
70543
70556
|
}
|
|
70544
70557
|
},
|
|
70545
70558
|
{
|
|
70546
|
-
kind:
|
|
70559
|
+
kind: graphql9.Kind.FIELD,
|
|
70547
70560
|
name: {
|
|
70548
|
-
kind:
|
|
70561
|
+
kind: graphql9.Kind.NAME,
|
|
70549
70562
|
value: "startCursor"
|
|
70550
70563
|
}
|
|
70551
70564
|
},
|
|
70552
70565
|
{
|
|
70553
|
-
kind:
|
|
70566
|
+
kind: graphql9.Kind.FIELD,
|
|
70554
70567
|
name: {
|
|
70555
|
-
kind:
|
|
70568
|
+
kind: graphql9.Kind.NAME,
|
|
70556
70569
|
value: "endCursor"
|
|
70557
70570
|
}
|
|
70558
70571
|
}
|
|
@@ -70566,15 +70579,15 @@ async function addListFragments(config4, documents) {
|
|
|
70566
70579
|
const lists = {};
|
|
70567
70580
|
const errors = [];
|
|
70568
70581
|
for (const doc of documents) {
|
|
70569
|
-
doc.document =
|
|
70582
|
+
doc.document = graphql10.visit(doc.document, {
|
|
70570
70583
|
Directive(node, key, parent, path2, ancestors) {
|
|
70571
70584
|
if ([config4.listDirective, config4.paginateDirective].includes(node.name.value)) {
|
|
70572
70585
|
const nameArg = node.arguments?.find((arg) => arg.name.value === "name");
|
|
70573
70586
|
let error = {
|
|
70574
|
-
...new
|
|
70587
|
+
...new graphql10.GraphQLError(
|
|
70575
70588
|
"",
|
|
70576
70589
|
node,
|
|
70577
|
-
new
|
|
70590
|
+
new graphql10.Source(""),
|
|
70578
70591
|
node.loc ? [node.loc.start, node.loc.end] : null,
|
|
70579
70592
|
path2
|
|
70580
70593
|
),
|
|
@@ -70626,7 +70639,7 @@ async function addListFragments(config4, documents) {
|
|
|
70626
70639
|
{
|
|
70627
70640
|
kind: "Argument",
|
|
70628
70641
|
name: {
|
|
70629
|
-
kind:
|
|
70642
|
+
kind: graphql10.Kind.NAME,
|
|
70630
70643
|
value: "connection"
|
|
70631
70644
|
},
|
|
70632
70645
|
value: {
|
|
@@ -70676,7 +70689,7 @@ async function addListFragments(config4, documents) {
|
|
|
70676
70689
|
const validDeletes = [
|
|
70677
70690
|
...new Set(
|
|
70678
70691
|
Object.values(lists).map(({ type }) => {
|
|
70679
|
-
if (!(type instanceof
|
|
70692
|
+
if (!(type instanceof graphql10.GraphQLObjectType)) {
|
|
70680
70693
|
return "";
|
|
70681
70694
|
}
|
|
70682
70695
|
if (config4.keyFieldsForType(type.name).length !== 1) {
|
|
@@ -70690,7 +70703,7 @@ async function addListFragments(config4, documents) {
|
|
|
70690
70703
|
return;
|
|
70691
70704
|
}
|
|
70692
70705
|
const generatedDoc = {
|
|
70693
|
-
kind:
|
|
70706
|
+
kind: graphql10.Kind.DOCUMENT,
|
|
70694
70707
|
definitions: Object.entries(lists).flatMap(
|
|
70695
70708
|
([name2, { selection: selection2, type }]) => {
|
|
70696
70709
|
const schemaType = config4.schema.getType(type.name);
|
|
@@ -70698,7 +70711,7 @@ async function addListFragments(config4, documents) {
|
|
|
70698
70711
|
throw new HoudiniError({ message: "Lists must have a selection" });
|
|
70699
70712
|
}
|
|
70700
70713
|
const fragmentSelection = {
|
|
70701
|
-
kind:
|
|
70714
|
+
kind: graphql10.Kind.SELECTION_SET,
|
|
70702
70715
|
selections: [...selection2.selections]
|
|
70703
70716
|
};
|
|
70704
70717
|
if (schemaType && fragmentSelection && !fragmentSelection?.selections.find(
|
|
@@ -70713,14 +70726,14 @@ async function addListFragments(config4, documents) {
|
|
|
70713
70726
|
{
|
|
70714
70727
|
name: {
|
|
70715
70728
|
value: config4.listInsertFragment(name2),
|
|
70716
|
-
kind:
|
|
70729
|
+
kind: graphql10.Kind.NAME
|
|
70717
70730
|
},
|
|
70718
|
-
kind:
|
|
70731
|
+
kind: graphql10.Kind.FRAGMENT_DEFINITION,
|
|
70719
70732
|
selectionSet: fragmentSelection,
|
|
70720
70733
|
typeCondition: {
|
|
70721
|
-
kind:
|
|
70734
|
+
kind: graphql10.Kind.NAMED_TYPE,
|
|
70722
70735
|
name: {
|
|
70723
|
-
kind:
|
|
70736
|
+
kind: graphql10.Kind.NAME,
|
|
70724
70737
|
value: type.name
|
|
70725
70738
|
}
|
|
70726
70739
|
}
|
|
@@ -70728,32 +70741,32 @@ async function addListFragments(config4, documents) {
|
|
|
70728
70741
|
{
|
|
70729
70742
|
name: {
|
|
70730
70743
|
value: config4.listToggleFragment(name2),
|
|
70731
|
-
kind:
|
|
70744
|
+
kind: graphql10.Kind.NAME
|
|
70732
70745
|
},
|
|
70733
|
-
kind:
|
|
70746
|
+
kind: graphql10.Kind.FRAGMENT_DEFINITION,
|
|
70734
70747
|
selectionSet: fragmentSelection,
|
|
70735
70748
|
typeCondition: {
|
|
70736
|
-
kind:
|
|
70749
|
+
kind: graphql10.Kind.NAMED_TYPE,
|
|
70737
70750
|
name: {
|
|
70738
|
-
kind:
|
|
70751
|
+
kind: graphql10.Kind.NAME,
|
|
70739
70752
|
value: type.name
|
|
70740
70753
|
}
|
|
70741
70754
|
}
|
|
70742
70755
|
},
|
|
70743
70756
|
{
|
|
70744
|
-
kind:
|
|
70757
|
+
kind: graphql10.Kind.FRAGMENT_DEFINITION,
|
|
70745
70758
|
name: {
|
|
70746
70759
|
value: config4.listRemoveFragment(name2),
|
|
70747
|
-
kind:
|
|
70760
|
+
kind: graphql10.Kind.NAME
|
|
70748
70761
|
},
|
|
70749
70762
|
selectionSet: {
|
|
70750
|
-
kind:
|
|
70763
|
+
kind: graphql10.Kind.SELECTION_SET,
|
|
70751
70764
|
selections: [...objectIdentificationSelection(config4, type)]
|
|
70752
70765
|
},
|
|
70753
70766
|
typeCondition: {
|
|
70754
|
-
kind:
|
|
70767
|
+
kind: graphql10.Kind.NAMED_TYPE,
|
|
70755
70768
|
name: {
|
|
70756
|
-
kind:
|
|
70769
|
+
kind: graphql10.Kind.NAME,
|
|
70757
70770
|
value: type.name
|
|
70758
70771
|
}
|
|
70759
70772
|
}
|
|
@@ -70762,14 +70775,14 @@ async function addListFragments(config4, documents) {
|
|
|
70762
70775
|
}
|
|
70763
70776
|
).concat(
|
|
70764
70777
|
...validDeletes.map((typeName) => ({
|
|
70765
|
-
kind:
|
|
70778
|
+
kind: graphql10.Kind.DIRECTIVE_DEFINITION,
|
|
70766
70779
|
name: {
|
|
70767
|
-
kind:
|
|
70780
|
+
kind: graphql10.Kind.NAME,
|
|
70768
70781
|
value: config4.listDeleteDirective(typeName)
|
|
70769
70782
|
},
|
|
70770
70783
|
locations: [
|
|
70771
70784
|
{
|
|
70772
|
-
kind:
|
|
70785
|
+
kind: graphql10.Kind.NAME,
|
|
70773
70786
|
value: "FIELD"
|
|
70774
70787
|
}
|
|
70775
70788
|
],
|
|
@@ -70777,8 +70790,8 @@ async function addListFragments(config4, documents) {
|
|
|
70777
70790
|
}))
|
|
70778
70791
|
)
|
|
70779
70792
|
};
|
|
70780
|
-
config4.newSchema += "\n" + generatedDoc.definitions.filter((c) => c.kind !== "FragmentDefinition").map(
|
|
70781
|
-
config4.newDocuments += "\n" + generatedDoc.definitions.filter((c) => c.kind === "FragmentDefinition").map(
|
|
70793
|
+
config4.newSchema += "\n" + generatedDoc.definitions.filter((c) => c.kind !== "FragmentDefinition").map(graphql10.print).join("\n\n");
|
|
70794
|
+
config4.newDocuments += "\n" + generatedDoc.definitions.filter((c) => c.kind === "FragmentDefinition").map(graphql10.print).join("\n\n");
|
|
70782
70795
|
documents.push({
|
|
70783
70796
|
name: "generated::lists",
|
|
70784
70797
|
kind: "HoudiniFragment" /* Fragment */,
|
|
@@ -70863,11 +70876,11 @@ var nodeNotDefinedMessage = (config4) => `Looks like you are trying to use the $
|
|
|
70863
70876
|
For more information, visit this link: ${siteURL}/guides/pagination`;
|
|
70864
70877
|
|
|
70865
70878
|
// src/codegen/generators/artifacts/fieldKey.ts
|
|
70866
|
-
var
|
|
70879
|
+
var graphql11 = __toESM(require_graphql2(), 1);
|
|
70867
70880
|
function fieldKey(config4, field) {
|
|
70868
70881
|
const attributeName = field.alias?.value || field.name.value;
|
|
70869
|
-
const printed =
|
|
70870
|
-
const secondParse =
|
|
70882
|
+
const printed = graphql11.print(field);
|
|
70883
|
+
const secondParse = graphql11.parse(`{${printed}}`).definitions[0].selectionSet.selections[0];
|
|
70871
70884
|
const paginated = !!field.directives?.find(
|
|
70872
70885
|
(directive) => directive.name.value === config4.paginateDirective
|
|
70873
70886
|
);
|
|
@@ -70962,8 +70975,8 @@ function selection({
|
|
|
70962
70975
|
const typeConditionName = field.typeCondition.name.value;
|
|
70963
70976
|
const typeCondition = config4.schema.getType(typeConditionName);
|
|
70964
70977
|
const possibleTypes = [];
|
|
70965
|
-
if (!
|
|
70966
|
-
} else if (
|
|
70978
|
+
if (!graphql12.isAbstractType(typeCondition)) {
|
|
70979
|
+
} else if (graphql12.isAbstractType(parentType)) {
|
|
70967
70980
|
const possibleParentTypes = config4.schema.getPossibleTypes(parentType).map((type) => type.name);
|
|
70968
70981
|
for (const possible of config4.schema.getPossibleTypes(typeCondition)) {
|
|
70969
70982
|
if (possibleParentTypes.includes(possible.name)) {
|
|
@@ -71011,7 +71024,7 @@ function selection({
|
|
|
71011
71024
|
} else {
|
|
71012
71025
|
let typeRef = type.getFields()[field.name.value].type;
|
|
71013
71026
|
fieldType = getRootType(typeRef);
|
|
71014
|
-
nullable = !
|
|
71027
|
+
nullable = !graphql12.isNonNullType(typeRef);
|
|
71015
71028
|
}
|
|
71016
71029
|
const typeName = fieldType.toString();
|
|
71017
71030
|
const pathSoFar = path2.concat(attributeName);
|
|
@@ -71076,7 +71089,7 @@ function selection({
|
|
|
71076
71089
|
{}
|
|
71077
71090
|
);
|
|
71078
71091
|
}
|
|
71079
|
-
if (
|
|
71092
|
+
if (graphql12.isInterfaceType(fieldType) || graphql12.isUnionType(fieldType)) {
|
|
71080
71093
|
fieldObj.abstract = true;
|
|
71081
71094
|
}
|
|
71082
71095
|
object.fields = {
|
|
@@ -71133,7 +71146,7 @@ function artifactGenerator(stats) {
|
|
|
71133
71146
|
return async function(config4, docs) {
|
|
71134
71147
|
const filterTypes = {};
|
|
71135
71148
|
for (const doc of docs) {
|
|
71136
|
-
|
|
71149
|
+
graphql13.visit(doc.document, {
|
|
71137
71150
|
Directive(node, _, __, ___, ancestors) {
|
|
71138
71151
|
if (node.name.value !== config4.listDirective) {
|
|
71139
71152
|
return;
|
|
@@ -71192,7 +71205,7 @@ function artifactGenerator(stats) {
|
|
|
71192
71205
|
return;
|
|
71193
71206
|
}
|
|
71194
71207
|
const usedVariableNames = /* @__PURE__ */ new Set();
|
|
71195
|
-
let documentWithoutInternalDirectives =
|
|
71208
|
+
let documentWithoutInternalDirectives = graphql13.visit(document, {
|
|
71196
71209
|
Directive(node) {
|
|
71197
71210
|
if (config4.isInternalDirective(node)) {
|
|
71198
71211
|
return null;
|
|
@@ -71205,7 +71218,7 @@ function artifactGenerator(stats) {
|
|
|
71205
71218
|
}
|
|
71206
71219
|
}
|
|
71207
71220
|
});
|
|
71208
|
-
let documentWithoutExtraVariables =
|
|
71221
|
+
let documentWithoutExtraVariables = graphql13.visit(
|
|
71209
71222
|
documentWithoutInternalDirectives,
|
|
71210
71223
|
{
|
|
71211
71224
|
VariableDefinition(variableDefinitionNode) {
|
|
@@ -71216,13 +71229,13 @@ function artifactGenerator(stats) {
|
|
|
71216
71229
|
}
|
|
71217
71230
|
}
|
|
71218
71231
|
);
|
|
71219
|
-
let rawString =
|
|
71232
|
+
let rawString = graphql13.print(documentWithoutExtraVariables);
|
|
71220
71233
|
let docKind = doc.kind;
|
|
71221
71234
|
const operations = document.definitions.filter(
|
|
71222
|
-
({ kind }) => kind ===
|
|
71235
|
+
({ kind }) => kind === graphql13.Kind.OPERATION_DEFINITION
|
|
71223
71236
|
);
|
|
71224
71237
|
const fragments = document.definitions.filter(
|
|
71225
|
-
({ kind }) => kind ===
|
|
71238
|
+
({ kind }) => kind === graphql13.Kind.FRAGMENT_DEFINITION
|
|
71226
71239
|
);
|
|
71227
71240
|
let rootType = "";
|
|
71228
71241
|
let selectionSet;
|
|
@@ -71464,15 +71477,15 @@ async function generatePluginRuntime(config4, plugin) {
|
|
|
71464
71477
|
var recast12 = __toESM(require_main2(), 1);
|
|
71465
71478
|
|
|
71466
71479
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
71467
|
-
var
|
|
71480
|
+
var graphql16 = __toESM(require_graphql2(), 1);
|
|
71468
71481
|
var recast9 = __toESM(require_main2(), 1);
|
|
71469
71482
|
|
|
71470
71483
|
// src/codegen/generators/typescript/typeReference.ts
|
|
71471
|
-
var
|
|
71484
|
+
var graphql15 = __toESM(require_graphql2(), 1);
|
|
71472
71485
|
var recast8 = __toESM(require_main2(), 1);
|
|
71473
71486
|
|
|
71474
71487
|
// src/codegen/generators/typescript/types.ts
|
|
71475
|
-
var
|
|
71488
|
+
var graphql14 = __toESM(require_graphql2(), 1);
|
|
71476
71489
|
var recast7 = __toESM(require_main2(), 1);
|
|
71477
71490
|
var AST7 = recast7.types.builders;
|
|
71478
71491
|
function readonlyProperty(prop, enable = true) {
|
|
@@ -71506,7 +71519,7 @@ function scalarPropertyValue(config4, missingScalars, target) {
|
|
|
71506
71519
|
return AST7.tsStringKeyword();
|
|
71507
71520
|
}
|
|
71508
71521
|
default: {
|
|
71509
|
-
if (
|
|
71522
|
+
if (graphql14.isNonNullType(target) && "ofType" in target) {
|
|
71510
71523
|
return scalarPropertyValue(
|
|
71511
71524
|
config4,
|
|
71512
71525
|
missingScalars,
|
|
@@ -71527,7 +71540,7 @@ var AST8 = recast8.types.builders;
|
|
|
71527
71540
|
function tsTypeReference(config4, missingScalars, definition) {
|
|
71528
71541
|
const { type, wrappers } = unwrapType(config4, definition.type);
|
|
71529
71542
|
let result;
|
|
71530
|
-
if (
|
|
71543
|
+
if (graphql15.isScalarType(type)) {
|
|
71531
71544
|
result = scalarPropertyValue(config4, missingScalars, type);
|
|
71532
71545
|
} else {
|
|
71533
71546
|
result = AST8.tsTypeReference(AST8.identifier(type.name));
|
|
@@ -71548,17 +71561,17 @@ function tsTypeReference(config4, missingScalars, definition) {
|
|
|
71548
71561
|
var AST9 = recast9.types.builders;
|
|
71549
71562
|
function addReferencedInputTypes(config4, filepath, body, visitedTypes, missingScalars, rootType) {
|
|
71550
71563
|
const { type } = unwrapType(config4, rootType);
|
|
71551
|
-
if (
|
|
71564
|
+
if (graphql16.isScalarType(type)) {
|
|
71552
71565
|
return;
|
|
71553
71566
|
}
|
|
71554
71567
|
if (visitedTypes.has(type.name)) {
|
|
71555
71568
|
return;
|
|
71556
71569
|
}
|
|
71557
|
-
if (
|
|
71570
|
+
if (graphql16.isUnionType(type)) {
|
|
71558
71571
|
throw new HoudiniError({ filepath, message: "Input Unions are not supported yet. Sorry!" });
|
|
71559
71572
|
}
|
|
71560
71573
|
visitedTypes.add(type.name);
|
|
71561
|
-
if (
|
|
71574
|
+
if (graphql16.isEnumType(type)) {
|
|
71562
71575
|
ensureImports({
|
|
71563
71576
|
config: config4,
|
|
71564
71577
|
body,
|
|
@@ -71575,7 +71588,7 @@ function addReferencedInputTypes(config4, filepath, body, visitedTypes, missingS
|
|
|
71575
71588
|
AST9.tsPropertySignature(
|
|
71576
71589
|
AST9.identifier(field.name),
|
|
71577
71590
|
AST9.tsTypeAnnotation(tsTypeReference(config4, missingScalars, field)),
|
|
71578
|
-
|
|
71591
|
+
graphql16.isNullableType(field.type)
|
|
71579
71592
|
)
|
|
71580
71593
|
);
|
|
71581
71594
|
}
|
|
@@ -71583,7 +71596,7 @@ function addReferencedInputTypes(config4, filepath, body, visitedTypes, missingS
|
|
|
71583
71596
|
}
|
|
71584
71597
|
|
|
71585
71598
|
// src/codegen/generators/typescript/imperativeCache.ts
|
|
71586
|
-
var
|
|
71599
|
+
var graphql17 = __toESM(require_graphql2(), 1);
|
|
71587
71600
|
var recast10 = __toESM(require_main2(), 1);
|
|
71588
71601
|
var AST10 = recast10.types.builders;
|
|
71589
71602
|
async function imperativeCacheTypef(config4, docs) {
|
|
@@ -71619,7 +71632,7 @@ function typeDefinitions(config4, body) {
|
|
|
71619
71632
|
const operationTypes = [config4.schema.getMutationType(), config4.schema.getSubscriptionType()].filter(Boolean).map((type) => type?.name);
|
|
71620
71633
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
71621
71634
|
const types17 = Object.values(config4.schema.getTypeMap()).filter(
|
|
71622
|
-
(type) => !
|
|
71635
|
+
(type) => !graphql17.isAbstractType(type) && !graphql17.isScalarType(type) && !graphql17.isEnumType(type) && !graphql17.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
|
|
71623
71636
|
);
|
|
71624
71637
|
return AST10.tsTypeLiteral(
|
|
71625
71638
|
types17.map((type) => {
|
|
@@ -71629,7 +71642,7 @@ function typeDefinitions(config4, body) {
|
|
|
71629
71642
|
}
|
|
71630
71643
|
let idFields = AST10.tsNeverKeyword();
|
|
71631
71644
|
const keys = keyFieldsForType(config4.configFile, type.name);
|
|
71632
|
-
if (
|
|
71645
|
+
if (graphql17.isObjectType(type) && keys.length > 0 && keys.every((key) => type.getFields()[key])) {
|
|
71633
71646
|
idFields = AST10.tsTypeLiteral(
|
|
71634
71647
|
keys.map((key) => {
|
|
71635
71648
|
const fieldType = type.getFields()[key];
|
|
@@ -71646,21 +71659,21 @@ function typeDefinitions(config4, body) {
|
|
|
71646
71659
|
idFields = AST10.tsTypeLiteral([]);
|
|
71647
71660
|
}
|
|
71648
71661
|
let fields = AST10.tsTypeLiteral([]);
|
|
71649
|
-
if (
|
|
71662
|
+
if (graphql17.isObjectType(type)) {
|
|
71650
71663
|
fields = AST10.tsTypeLiteral(
|
|
71651
71664
|
Object.entries(type.getFields()).map(
|
|
71652
71665
|
([key, fieldType]) => {
|
|
71653
71666
|
const unwrapped = unwrapType(config4, fieldType.type);
|
|
71654
71667
|
let typeOptions = AST10.tsUnionType([]);
|
|
71655
|
-
if (
|
|
71668
|
+
if (graphql17.isScalarType(unwrapped.type)) {
|
|
71656
71669
|
typeOptions.types.push(
|
|
71657
71670
|
scalarPropertyValue(config4, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
71658
71671
|
);
|
|
71659
|
-
} else if (
|
|
71672
|
+
} else if (graphql17.isEnumType(unwrapped.type)) {
|
|
71660
71673
|
typeOptions.types.push(
|
|
71661
71674
|
AST10.tsTypeReference(AST10.identifier(unwrapped.type.name))
|
|
71662
71675
|
);
|
|
71663
|
-
} else if (!
|
|
71676
|
+
} else if (!graphql17.isAbstractType(unwrapped.type)) {
|
|
71664
71677
|
typeOptions.types.push(record(unwrapped.type.name));
|
|
71665
71678
|
} else {
|
|
71666
71679
|
typeOptions.types.push(
|
|
@@ -71746,7 +71759,7 @@ function listDefinitions(config4, docs) {
|
|
|
71746
71759
|
const lists = [];
|
|
71747
71760
|
const visitedLists = /* @__PURE__ */ new Set();
|
|
71748
71761
|
for (const doc of docs) {
|
|
71749
|
-
|
|
71762
|
+
graphql17.visit(doc.document, {
|
|
71750
71763
|
Directive(node, key, parent, path2, ancestors) {
|
|
71751
71764
|
if (![config4.listDirective, config4.paginateDirective].includes(node.name.value)) {
|
|
71752
71765
|
return;
|
|
@@ -71766,7 +71779,7 @@ function listDefinitions(config4, docs) {
|
|
|
71766
71779
|
const targetFieldDefinition = parentType.getFields()[targetField.name.value];
|
|
71767
71780
|
const { type: listType } = unwrapType(config4, targetFieldDefinition.type);
|
|
71768
71781
|
const possibleTypes = [];
|
|
71769
|
-
if (
|
|
71782
|
+
if (graphql17.isAbstractType(listType)) {
|
|
71770
71783
|
possibleTypes.push(
|
|
71771
71784
|
...config4.schema.getPossibleTypes(listType).map((possible) => possible.name)
|
|
71772
71785
|
);
|
|
@@ -71830,7 +71843,7 @@ function record(name2) {
|
|
|
71830
71843
|
}
|
|
71831
71844
|
|
|
71832
71845
|
// src/codegen/generators/typescript/inlineType.ts
|
|
71833
|
-
var
|
|
71846
|
+
var graphql18 = __toESM(require_graphql2(), 1);
|
|
71834
71847
|
var recast11 = __toESM(require_main2(), 1);
|
|
71835
71848
|
var AST11 = recast11.types.builders;
|
|
71836
71849
|
var fragmentKey = "$fragments";
|
|
@@ -71849,9 +71862,9 @@ function inlineType({
|
|
|
71849
71862
|
}) {
|
|
71850
71863
|
const { type, wrappers } = unwrapType(config4, rootType);
|
|
71851
71864
|
let result;
|
|
71852
|
-
if (
|
|
71865
|
+
if (graphql18.isScalarType(type)) {
|
|
71853
71866
|
result = scalarPropertyValue(config4, missingScalars, type);
|
|
71854
|
-
} else if (
|
|
71867
|
+
} else if (graphql18.isEnumType(type)) {
|
|
71855
71868
|
if (!visitedTypes.has(type.name)) {
|
|
71856
71869
|
ensureImports({
|
|
71857
71870
|
config: config4,
|
|
@@ -71869,11 +71882,11 @@ function inlineType({
|
|
|
71869
71882
|
for (const selection2 of selections) {
|
|
71870
71883
|
if (selection2.kind === "InlineFragment" && selection2.typeCondition) {
|
|
71871
71884
|
const fragmentType = config4.schema.getType(selection2.typeCondition.name.value);
|
|
71872
|
-
if (!
|
|
71885
|
+
if (!graphql18.isInterfaceType(type) && !graphql18.isUnionType(type)) {
|
|
71873
71886
|
selectedFields.push(...selection2.selectionSet.selections);
|
|
71874
71887
|
continue;
|
|
71875
71888
|
}
|
|
71876
|
-
if (!
|
|
71889
|
+
if (!graphql18.isInterfaceType(fragmentType) && !graphql18.isUnionType(fragmentType)) {
|
|
71877
71890
|
if (!inlineFragments[fragmentType.name]) {
|
|
71878
71891
|
inlineFragments[fragmentType.name] = [];
|
|
71879
71892
|
}
|
|
@@ -71993,7 +72006,7 @@ function inlineType({
|
|
|
71993
72006
|
}
|
|
71994
72007
|
}
|
|
71995
72008
|
}
|
|
71996
|
-
if (objectType.type === "TSTypeLiteral" && !
|
|
72009
|
+
if (objectType.type === "TSTypeLiteral" && !graphql18.isInterfaceType(fragmentRootType) && !graphql18.isUnionType(fragmentRootType)) {
|
|
71997
72010
|
const existingTypenameIndex = objectType.members.findIndex(
|
|
71998
72011
|
(member) => member.type === "TSPropertySignature" && member.key.type === "Identifier" && member.key.name === "__typename"
|
|
71999
72012
|
);
|
|
@@ -72060,7 +72073,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection2) {
|
|
|
72060
72073
|
},
|
|
72061
72074
|
type: schema.getType("String")
|
|
72062
72075
|
};
|
|
72063
|
-
} else if (
|
|
72076
|
+
} else if (graphql18.isNonNullType(rootType) && "getFields" in rootType.ofType) {
|
|
72064
72077
|
fields = rootType.ofType.getFields();
|
|
72065
72078
|
} else {
|
|
72066
72079
|
fields = rootType.getFields();
|
|
@@ -72072,7 +72085,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection2) {
|
|
|
72072
72085
|
message: `Could not find type information for field ${rootType.toString()}.${selectionName} ${field}`
|
|
72073
72086
|
});
|
|
72074
72087
|
}
|
|
72075
|
-
const fieldType =
|
|
72088
|
+
const fieldType = graphql18.getNamedType(field.type);
|
|
72076
72089
|
if (!fieldType) {
|
|
72077
72090
|
throw new HoudiniError({
|
|
72078
72091
|
filepath,
|
|
@@ -72393,7 +72406,7 @@ async function generateFragmentTypeDefs(config4, filepath, body, selections, def
|
|
|
72393
72406
|
}
|
|
72394
72407
|
|
|
72395
72408
|
// src/codegen/generators/persistedQueries/index.ts
|
|
72396
|
-
var
|
|
72409
|
+
var graphql19 = __toESM(require_graphql2(), 1);
|
|
72397
72410
|
async function persistOutputGenerator(config4, docs) {
|
|
72398
72411
|
if (typeof config4.persistedQueryPath !== "string" || config4.persistedQueryPath.length === 0)
|
|
72399
72412
|
return;
|
|
@@ -72405,8 +72418,8 @@ async function persistOutputGenerator(config4, docs) {
|
|
|
72405
72418
|
if (!generateArtifact) {
|
|
72406
72419
|
return acc;
|
|
72407
72420
|
}
|
|
72408
|
-
let rawString =
|
|
72409
|
-
|
|
72421
|
+
let rawString = graphql19.print(
|
|
72422
|
+
graphql19.visit(document, {
|
|
72410
72423
|
Directive(node) {
|
|
72411
72424
|
if (config4.isInternalDirective(node)) {
|
|
72412
72425
|
return null;
|
|
@@ -72415,7 +72428,7 @@ async function persistOutputGenerator(config4, docs) {
|
|
|
72415
72428
|
})
|
|
72416
72429
|
);
|
|
72417
72430
|
const operations = document.definitions.filter(
|
|
72418
|
-
({ kind }) => kind ===
|
|
72431
|
+
({ kind }) => kind === graphql19.Kind.OPERATION_DEFINITION
|
|
72419
72432
|
);
|
|
72420
72433
|
if (operations.length > 0 && operations[0].kind === "OperationDefinition") {
|
|
72421
72434
|
acc[hashDocument(rawString)] = rawString;
|
|
@@ -72428,11 +72441,11 @@ async function persistOutputGenerator(config4, docs) {
|
|
|
72428
72441
|
}
|
|
72429
72442
|
|
|
72430
72443
|
// src/codegen/generators/definitions/enums.ts
|
|
72431
|
-
var
|
|
72444
|
+
var graphql20 = __toESM(require_graphql2(), 1);
|
|
72432
72445
|
var recast13 = __toESM(require_main2(), 1);
|
|
72433
72446
|
var AST13 = recast13.types.builders;
|
|
72434
72447
|
async function definitionsGenerator(config4) {
|
|
72435
|
-
const enums =
|
|
72448
|
+
const enums = graphql20.parse(graphql20.printSchema(config4.schema)).definitions.filter(
|
|
72436
72449
|
(definition) => definition.kind === "EnumTypeDefinition"
|
|
72437
72450
|
).filter((def) => !config4.isInternalEnum(def));
|
|
72438
72451
|
const runtimeDefinitions = recast13.print(
|
|
@@ -72605,7 +72618,7 @@ function flattenFragments(filepath, operation, fragments) {
|
|
|
72605
72618
|
}
|
|
72606
72619
|
|
|
72607
72620
|
// src/codegen/transforms/schema.ts
|
|
72608
|
-
var
|
|
72621
|
+
var graphql22 = __toESM(require_graphql2(), 1);
|
|
72609
72622
|
async function graphqlExtensions(config4, documents) {
|
|
72610
72623
|
const internalSchema = `
|
|
72611
72624
|
enum CachePolicy {
|
|
@@ -72683,19 +72696,19 @@ directive @${config4.maskEnableDirective} on FRAGMENT_SPREAD
|
|
|
72683
72696
|
"""
|
|
72684
72697
|
directive @${config4.maskDisableDirective} on FRAGMENT_SPREAD
|
|
72685
72698
|
`;
|
|
72686
|
-
let currentSchema =
|
|
72699
|
+
let currentSchema = graphql22.printSchema(config4.schema);
|
|
72687
72700
|
if (!currentSchema.includes(`directive @${config4.listDirective}`)) {
|
|
72688
72701
|
currentSchema += internalSchema;
|
|
72689
72702
|
}
|
|
72690
72703
|
config4.newSchema += internalSchema;
|
|
72691
|
-
config4.schema =
|
|
72704
|
+
config4.schema = graphql22.buildSchema(currentSchema);
|
|
72692
72705
|
}
|
|
72693
72706
|
|
|
72694
72707
|
// src/codegen/transforms/typename.ts
|
|
72695
|
-
var
|
|
72708
|
+
var graphql23 = __toESM(require_graphql2(), 1);
|
|
72696
72709
|
async function addTypename(config4, documents) {
|
|
72697
72710
|
for (const doc of documents) {
|
|
72698
|
-
doc.document =
|
|
72711
|
+
doc.document = graphql23.visit(doc.document, {
|
|
72699
72712
|
Field(node, key, parent, path2, ancestors) {
|
|
72700
72713
|
if (!node.selectionSet) {
|
|
72701
72714
|
return;
|
|
@@ -72707,7 +72720,7 @@ async function addTypename(config4, documents) {
|
|
|
72707
72720
|
);
|
|
72708
72721
|
const field = type.getFields()[node.name.value];
|
|
72709
72722
|
const fieldType = unwrapType(config4, field.type).type;
|
|
72710
|
-
if (
|
|
72723
|
+
if (graphql23.isInterfaceType(fieldType) || graphql23.isUnionType(fieldType)) {
|
|
72711
72724
|
return {
|
|
72712
72725
|
...node,
|
|
72713
72726
|
selectionSet: {
|
|
@@ -72715,9 +72728,9 @@ async function addTypename(config4, documents) {
|
|
|
72715
72728
|
selections: [
|
|
72716
72729
|
...node.selectionSet.selections,
|
|
72717
72730
|
{
|
|
72718
|
-
kind:
|
|
72731
|
+
kind: graphql23.Kind.FIELD,
|
|
72719
72732
|
name: {
|
|
72720
|
-
kind:
|
|
72733
|
+
kind: graphql23.Kind.NAME,
|
|
72721
72734
|
value: "__typename"
|
|
72722
72735
|
}
|
|
72723
72736
|
}
|
|
@@ -72731,10 +72744,10 @@ async function addTypename(config4, documents) {
|
|
|
72731
72744
|
}
|
|
72732
72745
|
|
|
72733
72746
|
// src/codegen/transforms/addID.ts
|
|
72734
|
-
var
|
|
72747
|
+
var graphql24 = __toESM(require_graphql2(), 1);
|
|
72735
72748
|
async function addID(config4, documents) {
|
|
72736
72749
|
for (const doc of documents) {
|
|
72737
|
-
doc.document =
|
|
72750
|
+
doc.document = graphql24.visit(doc.document, {
|
|
72738
72751
|
Field(node, key, parent, path2, ancestors) {
|
|
72739
72752
|
if (!node.selectionSet) {
|
|
72740
72753
|
return;
|
|
@@ -72747,7 +72760,7 @@ async function addID(config4, documents) {
|
|
|
72747
72760
|
const field = type.getFields()[node.name.value];
|
|
72748
72761
|
const fieldType = unwrapType(config4, field.type).type;
|
|
72749
72762
|
if (node.selectionSet?.selections.length > 0) {
|
|
72750
|
-
if (!
|
|
72763
|
+
if (!graphql24.isObjectType(fieldType) && !graphql24.isInterfaceType(fieldType)) {
|
|
72751
72764
|
return;
|
|
72752
72765
|
}
|
|
72753
72766
|
const keyFields = config4.keyFieldsForType(fieldType.name);
|
|
@@ -72762,9 +72775,9 @@ async function addID(config4, documents) {
|
|
|
72762
72775
|
continue;
|
|
72763
72776
|
}
|
|
72764
72777
|
selections.push({
|
|
72765
|
-
kind:
|
|
72778
|
+
kind: graphql24.Kind.FIELD,
|
|
72766
72779
|
name: {
|
|
72767
|
-
kind:
|
|
72780
|
+
kind: graphql24.Kind.NAME,
|
|
72768
72781
|
value: keyField
|
|
72769
72782
|
}
|
|
72770
72783
|
});
|
|
@@ -72783,8 +72796,8 @@ async function addID(config4, documents) {
|
|
|
72783
72796
|
}
|
|
72784
72797
|
|
|
72785
72798
|
// src/codegen/transforms/fragmentVariables.ts
|
|
72786
|
-
var
|
|
72787
|
-
var GraphqlKinds2 =
|
|
72799
|
+
var graphql25 = __toESM(require_graphql2(), 1);
|
|
72800
|
+
var GraphqlKinds2 = graphql25.Kind;
|
|
72788
72801
|
async function fragmentVariables(config4, documents) {
|
|
72789
72802
|
const fragments = collectFragments(config4, documents);
|
|
72790
72803
|
const generatedFragments = {};
|
|
@@ -72807,7 +72820,7 @@ async function fragmentVariables(config4, documents) {
|
|
|
72807
72820
|
});
|
|
72808
72821
|
}
|
|
72809
72822
|
const doc = {
|
|
72810
|
-
kind:
|
|
72823
|
+
kind: graphql25.Kind.DOCUMENT,
|
|
72811
72824
|
definitions: Object.values(generatedFragments)
|
|
72812
72825
|
};
|
|
72813
72826
|
documents.push({
|
|
@@ -72843,7 +72856,7 @@ function inlineFragmentArgs({
|
|
|
72843
72856
|
filepath,
|
|
72844
72857
|
document
|
|
72845
72858
|
).reduce((acc, arg) => ({ ...acc, [arg.name]: arg }), {});
|
|
72846
|
-
const result =
|
|
72859
|
+
const result = graphql25.visit(document, {
|
|
72847
72860
|
FragmentSpread(node) {
|
|
72848
72861
|
const { definition } = fragmentDefinitions[node.name.value];
|
|
72849
72862
|
let { args, hash } = collectWithArguments(config4, filepath, node, scope);
|
|
@@ -72931,7 +72944,7 @@ function inlineFragmentArgs({
|
|
|
72931
72944
|
});
|
|
72932
72945
|
if (newName) {
|
|
72933
72946
|
result.name = {
|
|
72934
|
-
kind:
|
|
72947
|
+
kind: graphql25.Kind.NAME,
|
|
72935
72948
|
value: newName
|
|
72936
72949
|
};
|
|
72937
72950
|
}
|
|
@@ -73043,7 +73056,7 @@ function operationScope(operation) {
|
|
|
73043
73056
|
}
|
|
73044
73057
|
|
|
73045
73058
|
// src/codegen/validators/typeCheck.ts
|
|
73046
|
-
var
|
|
73059
|
+
var graphql26 = __toESM(require_graphql2(), 1);
|
|
73047
73060
|
async function typeCheck(config4, docs) {
|
|
73048
73061
|
const errors = [];
|
|
73049
73062
|
const freeLists = [];
|
|
@@ -73051,11 +73064,11 @@ async function typeCheck(config4, docs) {
|
|
|
73051
73064
|
const listTypes = [];
|
|
73052
73065
|
const fragments = {};
|
|
73053
73066
|
for (const { document: parsed, filename } of docs) {
|
|
73054
|
-
|
|
73055
|
-
[
|
|
73067
|
+
graphql26.visit(parsed, {
|
|
73068
|
+
[graphql26.Kind.FRAGMENT_DEFINITION](definition) {
|
|
73056
73069
|
fragments[definition.name.value] = definition;
|
|
73057
73070
|
},
|
|
73058
|
-
[
|
|
73071
|
+
[graphql26.Kind.DIRECTIVE](directive, _, parent, __, ancestors) {
|
|
73059
73072
|
if (![config4.listDirective, config4.paginateDirective].includes(directive.name.value)) {
|
|
73060
73073
|
return;
|
|
73061
73074
|
}
|
|
@@ -73101,14 +73114,14 @@ async function typeCheck(config4, docs) {
|
|
|
73101
73114
|
);
|
|
73102
73115
|
return;
|
|
73103
73116
|
}
|
|
73104
|
-
if (
|
|
73117
|
+
if (graphql26.isListType(rootType) || graphql26.isNonNullType(rootType) && graphql26.isListType(rootType.ofType)) {
|
|
73105
73118
|
needsParent = true;
|
|
73106
73119
|
break;
|
|
73107
73120
|
}
|
|
73108
|
-
if (
|
|
73121
|
+
if (graphql26.isNonNullType(rootType) && "ofType" in rootType) {
|
|
73109
73122
|
rootType = rootType.ofType;
|
|
73110
73123
|
}
|
|
73111
|
-
if (
|
|
73124
|
+
if (graphql26.isScalarType(rootType)) {
|
|
73112
73125
|
break;
|
|
73113
73126
|
}
|
|
73114
73127
|
rootType = rootType?.getFields()[parent2.name.value]?.type;
|
|
@@ -73184,9 +73197,9 @@ async function typeCheck(config4, docs) {
|
|
|
73184
73197
|
);
|
|
73185
73198
|
}
|
|
73186
73199
|
let targetTypes = [type];
|
|
73187
|
-
if (
|
|
73200
|
+
if (graphql26.isUnionType(type)) {
|
|
73188
73201
|
targetTypes = config4.schema.getPossibleTypes(type);
|
|
73189
|
-
} else if (
|
|
73202
|
+
} else if (graphql26.isInterfaceType(type)) {
|
|
73190
73203
|
try {
|
|
73191
73204
|
for (const key of config4.keyFieldsForType(type.name)) {
|
|
73192
73205
|
if (!type.getFields()[key]) {
|
|
@@ -73224,13 +73237,13 @@ async function typeCheck(config4, docs) {
|
|
|
73224
73237
|
if (errors.length > 0) {
|
|
73225
73238
|
throw errors;
|
|
73226
73239
|
}
|
|
73227
|
-
const rules = (filepath) => [...
|
|
73240
|
+
const rules = (filepath) => [...graphql26.specifiedRules].filter(
|
|
73228
73241
|
(rule) => ![
|
|
73229
|
-
|
|
73230
|
-
|
|
73231
|
-
|
|
73232
|
-
|
|
73233
|
-
|
|
73242
|
+
graphql26.NoUnusedFragmentsRule,
|
|
73243
|
+
graphql26.KnownFragmentNamesRule,
|
|
73244
|
+
graphql26.ExecutableDefinitionsRule,
|
|
73245
|
+
graphql26.KnownDirectivesRule,
|
|
73246
|
+
graphql26.KnownArgumentNamesRule
|
|
73234
73247
|
].includes(rule)
|
|
73235
73248
|
).concat(
|
|
73236
73249
|
validateLists({
|
|
@@ -73249,7 +73262,7 @@ async function typeCheck(config4, docs) {
|
|
|
73249
73262
|
noUnusedFragmentArguments(config4)
|
|
73250
73263
|
);
|
|
73251
73264
|
for (const { filename, document: parsed } of docs) {
|
|
73252
|
-
for (const error of
|
|
73265
|
+
for (const error of graphql26.validate(config4.schema, parsed, rules(filename))) {
|
|
73253
73266
|
errors.push(
|
|
73254
73267
|
new HoudiniError({
|
|
73255
73268
|
filepath: filename,
|
|
@@ -73275,7 +73288,7 @@ var validateLists = ({
|
|
|
73275
73288
|
if (!config4.isListFragment(node.name.value)) {
|
|
73276
73289
|
if (!fragments[node.name.value]) {
|
|
73277
73290
|
ctx.reportError(
|
|
73278
|
-
new
|
|
73291
|
+
new graphql26.GraphQLError(
|
|
73279
73292
|
"Encountered unknown fragment: " + node.name.value
|
|
73280
73293
|
)
|
|
73281
73294
|
);
|
|
@@ -73285,7 +73298,7 @@ var validateLists = ({
|
|
|
73285
73298
|
const listName = config4.listNameFromFragment(node.name.value);
|
|
73286
73299
|
if (!lists.includes(listName)) {
|
|
73287
73300
|
ctx.reportError(
|
|
73288
|
-
new
|
|
73301
|
+
new graphql26.GraphQLError(
|
|
73289
73302
|
"Encountered fragment referencing unknown list: " + listName
|
|
73290
73303
|
)
|
|
73291
73304
|
);
|
|
@@ -73310,7 +73323,7 @@ var validateLists = ({
|
|
|
73310
73323
|
);
|
|
73311
73324
|
if (parentArg) {
|
|
73312
73325
|
ctx.reportError(
|
|
73313
|
-
new
|
|
73326
|
+
new graphql26.GraphQLError(
|
|
73314
73327
|
`@${config4.deprecatedlistDirectiveParentIDArg} should be defined only in it's own directive now`
|
|
73315
73328
|
)
|
|
73316
73329
|
);
|
|
@@ -73326,7 +73339,7 @@ var validateLists = ({
|
|
|
73326
73339
|
return;
|
|
73327
73340
|
}
|
|
73328
73341
|
ctx.reportError(
|
|
73329
|
-
new
|
|
73342
|
+
new graphql26.GraphQLError(
|
|
73330
73343
|
`For this list fragment, you need to add or @${config4.listParentDirective} or @${config4.listAllListsDirective} directive to specify the behavior`
|
|
73331
73344
|
)
|
|
73332
73345
|
);
|
|
@@ -73336,7 +73349,7 @@ var validateLists = ({
|
|
|
73336
73349
|
const directiveName = node.name.value;
|
|
73337
73350
|
if (directiveName === "connection") {
|
|
73338
73351
|
ctx.reportError(
|
|
73339
|
-
new
|
|
73352
|
+
new graphql26.GraphQLError(
|
|
73340
73353
|
"@connection was renamed to @list. Please change your components. If you were using `cache.connection` in your components, you will need to update that to `cache.list` too."
|
|
73341
73354
|
)
|
|
73342
73355
|
);
|
|
@@ -73345,7 +73358,7 @@ var validateLists = ({
|
|
|
73345
73358
|
if (!config4.isInternalDirective(node)) {
|
|
73346
73359
|
if (!config4.schema.getDirective(directiveName)) {
|
|
73347
73360
|
ctx.reportError(
|
|
73348
|
-
new
|
|
73361
|
+
new graphql26.GraphQLError(
|
|
73349
73362
|
"Encountered unknown directive: " + directiveName
|
|
73350
73363
|
)
|
|
73351
73364
|
);
|
|
@@ -73354,7 +73367,7 @@ var validateLists = ({
|
|
|
73354
73367
|
}
|
|
73355
73368
|
if (config4.isListOperationDirective(directiveName) && !listTypes.includes(config4.listNameFromDirective(directiveName))) {
|
|
73356
73369
|
ctx.reportError(
|
|
73357
|
-
new
|
|
73370
|
+
new graphql26.GraphQLError(
|
|
73358
73371
|
"Encountered directive referencing unknown list: " + directiveName
|
|
73359
73372
|
)
|
|
73360
73373
|
);
|
|
@@ -73365,7 +73378,7 @@ var validateLists = ({
|
|
|
73365
73378
|
};
|
|
73366
73379
|
function knownArguments(config4) {
|
|
73367
73380
|
return function(ctx) {
|
|
73368
|
-
const nativeValidator =
|
|
73381
|
+
const nativeValidator = graphql26.KnownArgumentNamesRule(ctx);
|
|
73369
73382
|
return {
|
|
73370
73383
|
...nativeValidator,
|
|
73371
73384
|
Directive(directiveNode) {
|
|
@@ -73398,7 +73411,7 @@ function validateFragmentArguments(config4, filepath, fragments) {
|
|
|
73398
73411
|
for (const arg of node.arguments || []) {
|
|
73399
73412
|
if (arg.value.kind !== "ObjectValue") {
|
|
73400
73413
|
ctx.reportError(
|
|
73401
|
-
new
|
|
73414
|
+
new graphql26.GraphQLError("values in @arguments must be an object")
|
|
73402
73415
|
);
|
|
73403
73416
|
return;
|
|
73404
73417
|
}
|
|
@@ -73408,13 +73421,13 @@ function validateFragmentArguments(config4, filepath, fragments) {
|
|
|
73408
73421
|
);
|
|
73409
73422
|
if (!typeArg) {
|
|
73410
73423
|
ctx.reportError(
|
|
73411
|
-
new
|
|
73424
|
+
new graphql26.GraphQLError("missing type field for @arguments directive")
|
|
73412
73425
|
);
|
|
73413
73426
|
return;
|
|
73414
73427
|
}
|
|
73415
|
-
if (typeArg.value.kind !==
|
|
73428
|
+
if (typeArg.value.kind !== graphql26.Kind.STRING) {
|
|
73416
73429
|
ctx.reportError(
|
|
73417
|
-
new
|
|
73430
|
+
new graphql26.GraphQLError("type field to @arguments must be a string")
|
|
73418
73431
|
);
|
|
73419
73432
|
return;
|
|
73420
73433
|
}
|
|
@@ -73427,7 +73440,7 @@ function validateFragmentArguments(config4, filepath, fragments) {
|
|
|
73427
73440
|
);
|
|
73428
73441
|
if (typeArg.value.value !== defaultValueType) {
|
|
73429
73442
|
ctx.reportError(
|
|
73430
|
-
new
|
|
73443
|
+
new graphql26.GraphQLError(
|
|
73431
73444
|
`Invalid default value provided for ${arg.name.value}. Expected ${typeArg.value.value}, found ${defaultValueType}`
|
|
73432
73445
|
)
|
|
73433
73446
|
);
|
|
@@ -73445,7 +73458,7 @@ function validateFragmentArguments(config4, filepath, fragments) {
|
|
|
73445
73458
|
try {
|
|
73446
73459
|
args = fragmentArguments(config4, filepath, fragments[fragmentName]);
|
|
73447
73460
|
} catch (e2) {
|
|
73448
|
-
ctx.reportError(new
|
|
73461
|
+
ctx.reportError(new graphql26.GraphQLError(e2.message));
|
|
73449
73462
|
return;
|
|
73450
73463
|
}
|
|
73451
73464
|
fragmentArguments2[fragmentName] = args;
|
|
@@ -73468,7 +73481,7 @@ function validateFragmentArguments(config4, filepath, fragments) {
|
|
|
73468
73481
|
);
|
|
73469
73482
|
if (missing.length > 0) {
|
|
73470
73483
|
ctx.reportError(
|
|
73471
|
-
new
|
|
73484
|
+
new graphql26.GraphQLError(
|
|
73472
73485
|
"The following arguments are missing from this fragment: " + JSON.stringify(missing)
|
|
73473
73486
|
)
|
|
73474
73487
|
);
|
|
@@ -73479,7 +73492,7 @@ function validateFragmentArguments(config4, filepath, fragments) {
|
|
|
73479
73492
|
);
|
|
73480
73493
|
if (unknown.length > 0) {
|
|
73481
73494
|
ctx.reportError(
|
|
73482
|
-
new
|
|
73495
|
+
new graphql26.GraphQLError(
|
|
73483
73496
|
"Encountered unknown arguments: " + JSON.stringify(unknown)
|
|
73484
73497
|
)
|
|
73485
73498
|
);
|
|
@@ -73491,7 +73504,7 @@ function validateFragmentArguments(config4, filepath, fragments) {
|
|
|
73491
73504
|
]
|
|
73492
73505
|
);
|
|
73493
73506
|
for (const [applied, target] of zipped) {
|
|
73494
|
-
if (applied.value.kind ===
|
|
73507
|
+
if (applied.value.kind === graphql26.Kind.VARIABLE || applied.value.kind === graphql26.Kind.LIST || applied.value.kind === graphql26.Kind.OBJECT) {
|
|
73495
73508
|
continue;
|
|
73496
73509
|
}
|
|
73497
73510
|
const appliedType = applied.value.kind.substring(
|
|
@@ -73500,7 +73513,7 @@ function validateFragmentArguments(config4, filepath, fragments) {
|
|
|
73500
73513
|
);
|
|
73501
73514
|
if (appliedType !== target) {
|
|
73502
73515
|
ctx.reportError(
|
|
73503
|
-
new
|
|
73516
|
+
new graphql26.GraphQLError(
|
|
73504
73517
|
`Invalid argument type. Expected ${target}, found ${appliedType}`
|
|
73505
73518
|
)
|
|
73506
73519
|
);
|
|
@@ -73521,7 +73534,7 @@ function paginateArgs(config4, filepath) {
|
|
|
73521
73534
|
}
|
|
73522
73535
|
if (alreadyPaginated) {
|
|
73523
73536
|
ctx.reportError(
|
|
73524
|
-
new
|
|
73537
|
+
new graphql26.GraphQLError(
|
|
73525
73538
|
`@${config4.paginateDirective} can only appear in a document once.`
|
|
73526
73539
|
)
|
|
73527
73540
|
);
|
|
@@ -73536,7 +73549,7 @@ function paginateArgs(config4, filepath) {
|
|
|
73536
73549
|
const hasRequiredArgs = definitionArgs.find((arg) => arg.required);
|
|
73537
73550
|
if (hasRequiredArgs) {
|
|
73538
73551
|
ctx.reportError(
|
|
73539
|
-
new
|
|
73552
|
+
new graphql26.GraphQLError(
|
|
73540
73553
|
"@paginate cannot appear on a document with required args"
|
|
73541
73554
|
)
|
|
73542
73555
|
);
|
|
@@ -73568,14 +73581,14 @@ function paginateArgs(config4, filepath) {
|
|
|
73568
73581
|
const backwards = appliedArgs.has("last");
|
|
73569
73582
|
if (!forward && !backwards) {
|
|
73570
73583
|
ctx.reportError(
|
|
73571
|
-
new
|
|
73584
|
+
new graphql26.GraphQLError(
|
|
73572
73585
|
"A field with cursor-based pagination must have a first or last argument"
|
|
73573
73586
|
)
|
|
73574
73587
|
);
|
|
73575
73588
|
}
|
|
73576
73589
|
if (forward && backwards) {
|
|
73577
73590
|
ctx.reportError(
|
|
73578
|
-
new
|
|
73591
|
+
new graphql26.GraphQLError(
|
|
73579
73592
|
`A field with cursor pagination cannot go forwards an backwards simultaneously`
|
|
73580
73593
|
)
|
|
73581
73594
|
);
|
|
@@ -73589,7 +73602,7 @@ function paginateArgs(config4, filepath) {
|
|
|
73589
73602
|
);
|
|
73590
73603
|
if (!appliedLimitArg) {
|
|
73591
73604
|
ctx.reportError(
|
|
73592
|
-
new
|
|
73605
|
+
new graphql26.GraphQLError(
|
|
73593
73606
|
"A field with offset-based pagination must have a limit argument"
|
|
73594
73607
|
)
|
|
73595
73608
|
);
|
|
@@ -73605,20 +73618,20 @@ function noUnusedFragmentArguments(config4) {
|
|
|
73605
73618
|
const args = /* @__PURE__ */ new Set();
|
|
73606
73619
|
return {
|
|
73607
73620
|
enter(node) {
|
|
73608
|
-
if (node.kind ===
|
|
73621
|
+
if (node.kind === graphql26.Kind.FRAGMENT_DEFINITION) {
|
|
73609
73622
|
const definitionArguments = node.directives?.filter((directive) => directive.name.value === config4.argumentsDirective).flatMap((directive) => directive.arguments);
|
|
73610
73623
|
for (const arg of definitionArguments?.map((arg2) => arg2?.name.value) || []) {
|
|
73611
73624
|
args.add(arg);
|
|
73612
73625
|
}
|
|
73613
|
-
} else if (node.kind ===
|
|
73626
|
+
} else if (node.kind === graphql26.Kind.VARIABLE) {
|
|
73614
73627
|
args.delete(node.name.value);
|
|
73615
73628
|
}
|
|
73616
73629
|
},
|
|
73617
73630
|
leave(node) {
|
|
73618
|
-
if (node.kind ===
|
|
73631
|
+
if (node.kind === graphql26.Kind.FRAGMENT_DEFINITION) {
|
|
73619
73632
|
if (args.size > 0) {
|
|
73620
73633
|
ctx.reportError(
|
|
73621
|
-
new
|
|
73634
|
+
new graphql26.GraphQLError(
|
|
73622
73635
|
"Encountered unused fragment arguments: " + [...args].join(",")
|
|
73623
73636
|
)
|
|
73624
73637
|
);
|
|
@@ -73654,7 +73667,7 @@ function nodeDirectives(config4, directives) {
|
|
|
73654
73667
|
if (definition.kind === "OperationDefinition") {
|
|
73655
73668
|
if (definition.operation !== "query") {
|
|
73656
73669
|
ctx.reportError(
|
|
73657
|
-
new
|
|
73670
|
+
new graphql26.GraphQLError(
|
|
73658
73671
|
`@${node.name.value} must fall on a fragment or query document`
|
|
73659
73672
|
)
|
|
73660
73673
|
);
|
|
@@ -73666,7 +73679,7 @@ function nodeDirectives(config4, directives) {
|
|
|
73666
73679
|
}
|
|
73667
73680
|
if (!possibleNodes.includes(definitionType)) {
|
|
73668
73681
|
ctx.reportError(
|
|
73669
|
-
new
|
|
73682
|
+
new graphql26.GraphQLError(paginateOnNonNodeMessage(config4, node.name.value))
|
|
73670
73683
|
);
|
|
73671
73684
|
}
|
|
73672
73685
|
}
|
|
@@ -73685,7 +73698,7 @@ function checkMutationOperation(config4) {
|
|
|
73685
73698
|
);
|
|
73686
73699
|
if (append && prepend) {
|
|
73687
73700
|
ctx.reportError(
|
|
73688
|
-
new
|
|
73701
|
+
new graphql26.GraphQLError(
|
|
73689
73702
|
`You can't apply both @${config4.listPrependDirective} and @${config4.listAppendDirective} at the same time`
|
|
73690
73703
|
)
|
|
73691
73704
|
);
|
|
@@ -73699,7 +73712,7 @@ function checkMutationOperation(config4) {
|
|
|
73699
73712
|
);
|
|
73700
73713
|
if (parentId && allLists) {
|
|
73701
73714
|
ctx.reportError(
|
|
73702
|
-
new
|
|
73715
|
+
new graphql26.GraphQLError(
|
|
73703
73716
|
`You can't apply both @${config4.listParentDirective} and @${config4.listAllListsDirective} at the same time`
|
|
73704
73717
|
)
|
|
73705
73718
|
);
|
|
@@ -73721,7 +73734,7 @@ function checkMaskDirective(config4) {
|
|
|
73721
73734
|
);
|
|
73722
73735
|
if (maskEnableDirective && maskDisableDirective) {
|
|
73723
73736
|
ctx.reportError(
|
|
73724
|
-
new
|
|
73737
|
+
new graphql26.GraphQLError(
|
|
73725
73738
|
`You can't apply both @${config4.maskEnableDirective} and @${config4.maskDisableDirective} at the same time`
|
|
73726
73739
|
)
|
|
73727
73740
|
);
|
|
@@ -73737,7 +73750,7 @@ function getAndVerifyNodeInterface(config4) {
|
|
|
73737
73750
|
if (!nodeInterface) {
|
|
73738
73751
|
return null;
|
|
73739
73752
|
}
|
|
73740
|
-
if (!
|
|
73753
|
+
if (!graphql26.isInterfaceType(nodeInterface)) {
|
|
73741
73754
|
displayInvalidNodeFieldMessage(config4.logLevel);
|
|
73742
73755
|
return null;
|
|
73743
73756
|
}
|
|
@@ -73835,11 +73848,11 @@ async function uniqueDocumentNames(config4, docs) {
|
|
|
73835
73848
|
}
|
|
73836
73849
|
|
|
73837
73850
|
// src/codegen/validators/noIDAlias.ts
|
|
73838
|
-
var
|
|
73851
|
+
var graphql27 = __toESM(require_graphql2(), 1);
|
|
73839
73852
|
async function noIDAlias(config4, docs) {
|
|
73840
73853
|
const errors = [];
|
|
73841
73854
|
for (const { filename, document } of docs) {
|
|
73842
|
-
|
|
73855
|
+
graphql27.visit(document, {
|
|
73843
73856
|
Field(node, _, __, ___, ancestors) {
|
|
73844
73857
|
const fieldType = parentTypeFromAncestors(config4.schema, filename, ancestors).name;
|
|
73845
73858
|
if (config4.keyFieldsForType(fieldType).includes(node.alias?.value || "")) {
|
|
@@ -74037,12 +74050,12 @@ async function processJSFile(config4, contents) {
|
|
|
74037
74050
|
return documents;
|
|
74038
74051
|
}
|
|
74039
74052
|
async function processGraphQLDocument(config4, filepath, document) {
|
|
74040
|
-
const parsedDoc =
|
|
74053
|
+
const parsedDoc = graphql28.parse(document);
|
|
74041
74054
|
const operations = parsedDoc.definitions.filter(
|
|
74042
|
-
({ kind: kind2 }) => kind2 ===
|
|
74055
|
+
({ kind: kind2 }) => kind2 === graphql28.Kind.OPERATION_DEFINITION
|
|
74043
74056
|
);
|
|
74044
74057
|
const fragments = parsedDoc.definitions.filter(
|
|
74045
|
-
({ kind: kind2 }) => kind2 ===
|
|
74058
|
+
({ kind: kind2 }) => kind2 === graphql28.Kind.FRAGMENT_DEFINITION
|
|
74046
74059
|
);
|
|
74047
74060
|
if (operations.length > 1) {
|
|
74048
74061
|
throw new HoudiniError({
|