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-esm/index.js
CHANGED
|
@@ -35,9 +35,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
35
35
|
mod
|
|
36
36
|
));
|
|
37
37
|
|
|
38
|
-
// ../../node_modules/.pnpm/minimatch@5.1.
|
|
38
|
+
// ../../node_modules/.pnpm/minimatch@5.1.2/node_modules/minimatch/lib/path.js
|
|
39
39
|
var require_path = __commonJS({
|
|
40
|
-
"../../node_modules/.pnpm/minimatch@5.1.
|
|
40
|
+
"../../node_modules/.pnpm/minimatch@5.1.2/node_modules/minimatch/lib/path.js"(exports, module) {
|
|
41
41
|
var isWindows = typeof process === "object" && process && process.platform === "win32";
|
|
42
42
|
module.exports = isWindows ? { sep: "\\" } : { sep: "/" };
|
|
43
43
|
}
|
|
@@ -254,9 +254,9 @@ var require_brace_expansion = __commonJS({
|
|
|
254
254
|
}
|
|
255
255
|
});
|
|
256
256
|
|
|
257
|
-
// ../../node_modules/.pnpm/minimatch@5.1.
|
|
257
|
+
// ../../node_modules/.pnpm/minimatch@5.1.2/node_modules/minimatch/minimatch.js
|
|
258
258
|
var require_minimatch = __commonJS({
|
|
259
|
-
"../../node_modules/.pnpm/minimatch@5.1.
|
|
259
|
+
"../../node_modules/.pnpm/minimatch@5.1.2/node_modules/minimatch/minimatch.js"(exports, module) {
|
|
260
260
|
var minimatch3 = module.exports = (p, pattern, options = {}) => {
|
|
261
261
|
assertValidPattern(pattern);
|
|
262
262
|
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
@@ -342,7 +342,9 @@ var require_minimatch = __commonJS({
|
|
|
342
342
|
return list;
|
|
343
343
|
};
|
|
344
344
|
var globUnescape = (s2) => s2.replace(/\\(.)/g, "$1");
|
|
345
|
+
var charUnescape = (s2) => s2.replace(/\\([^-\]])/g, "$1");
|
|
345
346
|
var regExpEscape = (s2) => s2.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
347
|
+
var braExpEscape = (s2) => s2.replace(/[[\]\\]/g, "\\$&");
|
|
346
348
|
var Minimatch = class {
|
|
347
349
|
constructor(pattern, options) {
|
|
348
350
|
assertValidPattern(pattern);
|
|
@@ -534,6 +536,10 @@ var require_minimatch = __commonJS({
|
|
|
534
536
|
return false;
|
|
535
537
|
}
|
|
536
538
|
case "\\":
|
|
539
|
+
if (inClass && pattern.charAt(i2 + 1) === "-") {
|
|
540
|
+
re += c;
|
|
541
|
+
continue;
|
|
542
|
+
}
|
|
537
543
|
clearStateChar();
|
|
538
544
|
escaping = true;
|
|
539
545
|
continue;
|
|
@@ -616,17 +622,13 @@ var require_minimatch = __commonJS({
|
|
|
616
622
|
}
|
|
617
623
|
cs = pattern.substring(classStart + 1, i2);
|
|
618
624
|
try {
|
|
619
|
-
RegExp("[" + cs + "]");
|
|
625
|
+
RegExp("[" + braExpEscape(charUnescape(cs)) + "]");
|
|
626
|
+
re += c;
|
|
620
627
|
} catch (er) {
|
|
621
|
-
|
|
622
|
-
re = re.substring(0, reClassStart) + "\\[" + sp[0] + "\\]";
|
|
623
|
-
hasMagic = hasMagic || sp[1];
|
|
624
|
-
inClass = false;
|
|
625
|
-
continue;
|
|
628
|
+
re = re.substring(0, reClassStart) + "(?:$.)";
|
|
626
629
|
}
|
|
627
630
|
hasMagic = true;
|
|
628
631
|
inClass = false;
|
|
629
|
-
re += c;
|
|
630
632
|
continue;
|
|
631
633
|
default:
|
|
632
634
|
clearStateChar();
|
|
@@ -13905,7 +13907,7 @@ var require_graphql = __commonJS({
|
|
|
13905
13907
|
Object.defineProperty(exports, "__esModule", {
|
|
13906
13908
|
value: true
|
|
13907
13909
|
});
|
|
13908
|
-
exports.graphql =
|
|
13910
|
+
exports.graphql = graphql29;
|
|
13909
13911
|
exports.graphqlSync = graphqlSync;
|
|
13910
13912
|
var _isPromise = _interopRequireDefault(require_isPromise());
|
|
13911
13913
|
var _parser = require_parser();
|
|
@@ -13915,7 +13917,7 @@ var require_graphql = __commonJS({
|
|
|
13915
13917
|
function _interopRequireDefault(obj) {
|
|
13916
13918
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
13917
13919
|
}
|
|
13918
|
-
function
|
|
13920
|
+
function graphql29(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) {
|
|
13919
13921
|
var _arguments = arguments;
|
|
13920
13922
|
return new Promise(function(resolve2) {
|
|
13921
13923
|
return resolve2(
|
|
@@ -30866,9 +30868,9 @@ var init_multipart_parser = __esm({
|
|
|
30866
30868
|
}
|
|
30867
30869
|
});
|
|
30868
30870
|
|
|
30869
|
-
// ../../node_modules/.pnpm/@babel+parser@7.20.
|
|
30871
|
+
// ../../node_modules/.pnpm/@babel+parser@7.20.7/node_modules/@babel/parser/lib/index.js
|
|
30870
30872
|
var require_lib3 = __commonJS({
|
|
30871
|
-
"../../node_modules/.pnpm/@babel+parser@7.20.
|
|
30873
|
+
"../../node_modules/.pnpm/@babel+parser@7.20.7/node_modules/@babel/parser/lib/index.js"(exports) {
|
|
30872
30874
|
"use strict";
|
|
30873
30875
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30874
30876
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
@@ -30984,9 +30986,9 @@ var require_lib3 = __commonJS({
|
|
|
30984
30986
|
AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.",
|
|
30985
30987
|
AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.",
|
|
30986
30988
|
AwaitNotInAsyncFunction: "'await' is only allowed within async functions.",
|
|
30987
|
-
BadGetterArity: "A 'get'
|
|
30988
|
-
BadSetterArity: "A 'set'
|
|
30989
|
-
BadSetterRestParameter: "A 'set'
|
|
30989
|
+
BadGetterArity: "A 'get' accessor must not have any formal parameters.",
|
|
30990
|
+
BadSetterArity: "A 'set' accessor must have exactly one formal parameter.",
|
|
30991
|
+
BadSetterRestParameter: "A 'set' accessor function argument must not be a rest parameter.",
|
|
30990
30992
|
ConstructorClassField: "Classes may not have a field named 'constructor'.",
|
|
30991
30993
|
ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.",
|
|
30992
30994
|
ConstructorIsAccessor: "Class constructor may not be an accessor.",
|
|
@@ -34420,7 +34422,7 @@ var require_lib3 = __commonJS({
|
|
|
34420
34422
|
}
|
|
34421
34423
|
this.parser.raise(toParseError, origin);
|
|
34422
34424
|
}
|
|
34423
|
-
|
|
34425
|
+
recordArrowParameterBindingError(error, {
|
|
34424
34426
|
at: node
|
|
34425
34427
|
}) {
|
|
34426
34428
|
const {
|
|
@@ -38179,6 +38181,7 @@ var require_lib3 = __commonJS({
|
|
|
38179
38181
|
}) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`,
|
|
38180
38182
|
AccesorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.",
|
|
38181
38183
|
AccesorCannotHaveTypeParameters: "An accessor cannot have type parameters.",
|
|
38184
|
+
AccessorCannotBeOptional: "An 'accessor' property cannot be declared optional.",
|
|
38182
38185
|
ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.",
|
|
38183
38186
|
ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.",
|
|
38184
38187
|
ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",
|
|
@@ -40141,8 +40144,12 @@ var require_lib3 = __commonJS({
|
|
|
40141
40144
|
node.typeParameters = typeParameters;
|
|
40142
40145
|
}
|
|
40143
40146
|
parseClassPropertyAnnotation(node) {
|
|
40144
|
-
if (!node.optional
|
|
40145
|
-
|
|
40147
|
+
if (!node.optional) {
|
|
40148
|
+
if (this.eat(35)) {
|
|
40149
|
+
node.definite = true;
|
|
40150
|
+
} else if (this.eat(17)) {
|
|
40151
|
+
node.optional = true;
|
|
40152
|
+
}
|
|
40146
40153
|
}
|
|
40147
40154
|
const type = this.tsTryParseTypeAnnotation();
|
|
40148
40155
|
if (type)
|
|
@@ -40181,6 +40188,15 @@ var require_lib3 = __commonJS({
|
|
|
40181
40188
|
this.parseClassPropertyAnnotation(node);
|
|
40182
40189
|
return super.parseClassPrivateProperty(node);
|
|
40183
40190
|
}
|
|
40191
|
+
parseClassAccessorProperty(node) {
|
|
40192
|
+
this.parseClassPropertyAnnotation(node);
|
|
40193
|
+
if (node.optional) {
|
|
40194
|
+
this.raise(TSErrors.AccessorCannotBeOptional, {
|
|
40195
|
+
at: node
|
|
40196
|
+
});
|
|
40197
|
+
}
|
|
40198
|
+
return super.parseClassAccessorProperty(node);
|
|
40199
|
+
}
|
|
40184
40200
|
pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
|
|
40185
40201
|
const typeParameters = this.tsTryParseTypeParameters();
|
|
40186
40202
|
if (typeParameters && isConstructor) {
|
|
@@ -40391,7 +40407,7 @@ var require_lib3 = __commonJS({
|
|
|
40391
40407
|
case "TSNonNullExpression":
|
|
40392
40408
|
case "TSTypeAssertion":
|
|
40393
40409
|
if (isLHS) {
|
|
40394
|
-
this.expressionScope.
|
|
40410
|
+
this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter, {
|
|
40395
40411
|
at: node
|
|
40396
40412
|
});
|
|
40397
40413
|
} else {
|
|
@@ -41098,7 +41114,7 @@ var require_lib3 = __commonJS({
|
|
|
41098
41114
|
parenthesized = unwrapParenthesizedExpression(node);
|
|
41099
41115
|
if (isLHS) {
|
|
41100
41116
|
if (parenthesized.type === "Identifier") {
|
|
41101
|
-
this.expressionScope.
|
|
41117
|
+
this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment, {
|
|
41102
41118
|
at: node
|
|
41103
41119
|
});
|
|
41104
41120
|
} else if (parenthesized.type !== "MemberExpression") {
|
|
@@ -61933,7 +61949,7 @@ function watchAndRun(params) {
|
|
|
61933
61949
|
}
|
|
61934
61950
|
|
|
61935
61951
|
// src/codegen/index.ts
|
|
61936
|
-
var
|
|
61952
|
+
var graphql28 = __toESM(require_graphql2(), 1);
|
|
61937
61953
|
|
|
61938
61954
|
// src/lib/pipeline.ts
|
|
61939
61955
|
async function runPipeline(config4, pipeline2, target) {
|
|
@@ -69106,6 +69122,60 @@ function formatErrors(e2, afterError) {
|
|
|
69106
69122
|
afterError?.(e2);
|
|
69107
69123
|
}
|
|
69108
69124
|
}
|
|
69125
|
+
function unwrapType(config4, type, wrappers = []) {
|
|
69126
|
+
if (type.kind === "NonNullType") {
|
|
69127
|
+
return unwrapType(config4, type.type, [TypeWrapper.NonNull, ...wrappers]);
|
|
69128
|
+
}
|
|
69129
|
+
if (type instanceof graphql3.GraphQLNonNull) {
|
|
69130
|
+
return unwrapType(config4, type.ofType, [TypeWrapper.NonNull, ...wrappers]);
|
|
69131
|
+
}
|
|
69132
|
+
if (wrappers[0] !== TypeWrapper.NonNull) {
|
|
69133
|
+
wrappers.unshift(TypeWrapper.Nullable);
|
|
69134
|
+
}
|
|
69135
|
+
if (type.kind === "ListType") {
|
|
69136
|
+
return unwrapType(config4, type.type, [TypeWrapper.List, ...wrappers]);
|
|
69137
|
+
}
|
|
69138
|
+
if (type instanceof graphql3.GraphQLList) {
|
|
69139
|
+
return unwrapType(config4, type.ofType, [TypeWrapper.List, ...wrappers]);
|
|
69140
|
+
}
|
|
69141
|
+
const namedType = config4.schema.getType(type.name.value || type.name);
|
|
69142
|
+
if (!namedType) {
|
|
69143
|
+
throw new Error("Could not unwrap type: " + JSON.stringify(type));
|
|
69144
|
+
}
|
|
69145
|
+
return { type: namedType, wrappers };
|
|
69146
|
+
}
|
|
69147
|
+
function wrapType({
|
|
69148
|
+
type,
|
|
69149
|
+
wrappers
|
|
69150
|
+
}) {
|
|
69151
|
+
const head = wrappers[0];
|
|
69152
|
+
const tail = wrappers.slice(1);
|
|
69153
|
+
let kind = graphql3.Kind.NAMED_TYPE;
|
|
69154
|
+
if (head === TypeWrapper.List) {
|
|
69155
|
+
kind = graphql3.Kind.LIST_TYPE;
|
|
69156
|
+
} else if (head === TypeWrapper.NonNull) {
|
|
69157
|
+
kind = graphql3.Kind.NON_NULL_TYPE;
|
|
69158
|
+
}
|
|
69159
|
+
if (kind === "NamedType") {
|
|
69160
|
+
return {
|
|
69161
|
+
kind,
|
|
69162
|
+
name: {
|
|
69163
|
+
kind: graphql3.Kind.NAME,
|
|
69164
|
+
value: type.name
|
|
69165
|
+
}
|
|
69166
|
+
};
|
|
69167
|
+
}
|
|
69168
|
+
return {
|
|
69169
|
+
kind,
|
|
69170
|
+
type: wrapType({ type, wrappers: tail })
|
|
69171
|
+
};
|
|
69172
|
+
}
|
|
69173
|
+
var TypeWrapper = /* @__PURE__ */ ((TypeWrapper2) => {
|
|
69174
|
+
TypeWrapper2["Nullable"] = "Nullable";
|
|
69175
|
+
TypeWrapper2["List"] = "List";
|
|
69176
|
+
TypeWrapper2["NonNull"] = "NonNull";
|
|
69177
|
+
return TypeWrapper2;
|
|
69178
|
+
})(TypeWrapper || {});
|
|
69109
69179
|
|
|
69110
69180
|
// src/lib/parse.ts
|
|
69111
69181
|
var import_parser = __toESM(require_lib3(), 1);
|
|
@@ -69350,7 +69420,7 @@ async function find_graphql(config4, parsedScript, walker) {
|
|
|
69350
69420
|
}
|
|
69351
69421
|
|
|
69352
69422
|
// src/codegen/generators/artifacts/index.ts
|
|
69353
|
-
var
|
|
69423
|
+
var graphql13 = __toESM(require_graphql2(), 1);
|
|
69354
69424
|
var recast5 = __toESM(require_main2(), 1);
|
|
69355
69425
|
|
|
69356
69426
|
// src/codegen/utils/commonjs.ts
|
|
@@ -69526,63 +69596,6 @@ var FieldCollection = class {
|
|
|
69526
69596
|
}
|
|
69527
69597
|
};
|
|
69528
69598
|
|
|
69529
|
-
// src/codegen/utils/graphql.ts
|
|
69530
|
-
var graphql5 = __toESM(require_graphql2(), 1);
|
|
69531
|
-
function unwrapType(config4, type, wrappers = []) {
|
|
69532
|
-
if (type.kind === "NonNullType") {
|
|
69533
|
-
return unwrapType(config4, type.type, [TypeWrapper.NonNull, ...wrappers]);
|
|
69534
|
-
}
|
|
69535
|
-
if (type instanceof graphql5.GraphQLNonNull) {
|
|
69536
|
-
return unwrapType(config4, type.ofType, [TypeWrapper.NonNull, ...wrappers]);
|
|
69537
|
-
}
|
|
69538
|
-
if (wrappers[0] !== TypeWrapper.NonNull) {
|
|
69539
|
-
wrappers.unshift(TypeWrapper.Nullable);
|
|
69540
|
-
}
|
|
69541
|
-
if (type.kind === "ListType") {
|
|
69542
|
-
return unwrapType(config4, type.type, [TypeWrapper.List, ...wrappers]);
|
|
69543
|
-
}
|
|
69544
|
-
if (type instanceof graphql5.GraphQLList) {
|
|
69545
|
-
return unwrapType(config4, type.ofType, [TypeWrapper.List, ...wrappers]);
|
|
69546
|
-
}
|
|
69547
|
-
const namedType = config4.schema.getType(type.name.value || type.name);
|
|
69548
|
-
if (!namedType) {
|
|
69549
|
-
throw new Error("Could not unwrap type: " + JSON.stringify(type));
|
|
69550
|
-
}
|
|
69551
|
-
return { type: namedType, wrappers };
|
|
69552
|
-
}
|
|
69553
|
-
function wrapType({
|
|
69554
|
-
type,
|
|
69555
|
-
wrappers
|
|
69556
|
-
}) {
|
|
69557
|
-
const head = wrappers[0];
|
|
69558
|
-
const tail = wrappers.slice(1);
|
|
69559
|
-
let kind = graphql5.Kind.NAMED_TYPE;
|
|
69560
|
-
if (head === TypeWrapper.List) {
|
|
69561
|
-
kind = graphql5.Kind.LIST_TYPE;
|
|
69562
|
-
} else if (head === TypeWrapper.NonNull) {
|
|
69563
|
-
kind = graphql5.Kind.NON_NULL_TYPE;
|
|
69564
|
-
}
|
|
69565
|
-
if (kind === "NamedType") {
|
|
69566
|
-
return {
|
|
69567
|
-
kind,
|
|
69568
|
-
name: {
|
|
69569
|
-
kind: graphql5.Kind.NAME,
|
|
69570
|
-
value: type.name
|
|
69571
|
-
}
|
|
69572
|
-
};
|
|
69573
|
-
}
|
|
69574
|
-
return {
|
|
69575
|
-
kind,
|
|
69576
|
-
type: wrapType({ type, wrappers: tail })
|
|
69577
|
-
};
|
|
69578
|
-
}
|
|
69579
|
-
var TypeWrapper = /* @__PURE__ */ ((TypeWrapper2) => {
|
|
69580
|
-
TypeWrapper2["Nullable"] = "Nullable";
|
|
69581
|
-
TypeWrapper2["List"] = "List";
|
|
69582
|
-
TypeWrapper2["NonNull"] = "NonNull";
|
|
69583
|
-
return TypeWrapper2;
|
|
69584
|
-
})(TypeWrapper || {});
|
|
69585
|
-
|
|
69586
69599
|
// src/codegen/utils/moduleExport.ts
|
|
69587
69600
|
var recast2 = __toESM(require_main2(), 1);
|
|
69588
69601
|
var AST2 = recast2.types.builders;
|
|
@@ -69669,7 +69682,7 @@ ${exportDefaultFrom(`./${doc.name}`, doc.name)}`,
|
|
|
69669
69682
|
}
|
|
69670
69683
|
|
|
69671
69684
|
// src/codegen/generators/artifacts/inputs.ts
|
|
69672
|
-
var
|
|
69685
|
+
var graphql5 = __toESM(require_graphql2(), 1);
|
|
69673
69686
|
var recast3 = __toESM(require_main2(), 1);
|
|
69674
69687
|
var AST3 = recast3.types.builders;
|
|
69675
69688
|
function inputObject(config4, inputs) {
|
|
@@ -69694,10 +69707,10 @@ function walkInputs(config4, visitedTypes, inputObj, rootType) {
|
|
|
69694
69707
|
if (visitedTypes.has(type.name)) {
|
|
69695
69708
|
return;
|
|
69696
69709
|
}
|
|
69697
|
-
if (
|
|
69710
|
+
if (graphql5.isEnumType(type) || graphql5.isScalarType(type)) {
|
|
69698
69711
|
return;
|
|
69699
69712
|
}
|
|
69700
|
-
if (
|
|
69713
|
+
if (graphql5.isUnionType(type)) {
|
|
69701
69714
|
return;
|
|
69702
69715
|
}
|
|
69703
69716
|
visitedTypes.add(type.name);
|
|
@@ -69715,10 +69728,10 @@ function walkInputs(config4, visitedTypes, inputObj, rootType) {
|
|
|
69715
69728
|
}
|
|
69716
69729
|
|
|
69717
69730
|
// src/codegen/generators/artifacts/operations.ts
|
|
69718
|
-
var
|
|
69731
|
+
var graphql7 = __toESM(require_graphql2(), 1);
|
|
69719
69732
|
|
|
69720
69733
|
// src/codegen/generators/artifacts/utils.ts
|
|
69721
|
-
var
|
|
69734
|
+
var graphql6 = __toESM(require_graphql2(), 1);
|
|
69722
69735
|
var recast4 = __toESM(require_main2(), 1);
|
|
69723
69736
|
var AST4 = recast4.types.builders;
|
|
69724
69737
|
function serializeValue(value) {
|
|
@@ -69770,19 +69783,19 @@ function deepMerge(filepath, ...targets) {
|
|
|
69770
69783
|
function convertValue(config4, val) {
|
|
69771
69784
|
let value;
|
|
69772
69785
|
let kind;
|
|
69773
|
-
if (val.kind ===
|
|
69786
|
+
if (val.kind === graphql6.Kind.INT) {
|
|
69774
69787
|
value = parseInt(val.value, 10);
|
|
69775
69788
|
kind = "Int";
|
|
69776
|
-
} else if (val.kind ===
|
|
69789
|
+
} else if (val.kind === graphql6.Kind.FLOAT) {
|
|
69777
69790
|
value = parseFloat(val.value);
|
|
69778
69791
|
kind = "Float";
|
|
69779
|
-
} else if (val.kind ===
|
|
69792
|
+
} else if (val.kind === graphql6.Kind.BOOLEAN) {
|
|
69780
69793
|
value = val.value;
|
|
69781
69794
|
kind = "Boolean";
|
|
69782
|
-
} else if (val.kind ===
|
|
69795
|
+
} else if (val.kind === graphql6.Kind.VARIABLE) {
|
|
69783
69796
|
value = val.name.value;
|
|
69784
69797
|
kind = "Variable";
|
|
69785
|
-
} else if (val.kind ===
|
|
69798
|
+
} else if (val.kind === graphql6.Kind.STRING) {
|
|
69786
69799
|
value = val.value;
|
|
69787
69800
|
kind = "String";
|
|
69788
69801
|
}
|
|
@@ -69795,7 +69808,7 @@ function operationsByPath(config4, filepath, definition, filterTypes) {
|
|
|
69795
69808
|
return {};
|
|
69796
69809
|
}
|
|
69797
69810
|
const pathOperations = {};
|
|
69798
|
-
|
|
69811
|
+
graphql7.visit(definition, {
|
|
69799
69812
|
FragmentSpread(node, _, __, ___, ancestors) {
|
|
69800
69813
|
if (!config4.isListFragment(node.name.value)) {
|
|
69801
69814
|
return;
|
|
@@ -69954,7 +69967,7 @@ function ancestorKey(ancestors) {
|
|
|
69954
69967
|
}
|
|
69955
69968
|
|
|
69956
69969
|
// src/codegen/generators/artifacts/selection.ts
|
|
69957
|
-
var
|
|
69970
|
+
var graphql12 = __toESM(require_graphql2(), 1);
|
|
69958
69971
|
|
|
69959
69972
|
// ../../node_modules/.pnpm/@kitql+helper@0.5.0/node_modules/@kitql/helper/index.mjs
|
|
69960
69973
|
var config2 = {
|
|
@@ -70000,16 +70013,16 @@ async function sleep2(ms) {
|
|
|
70000
70013
|
}
|
|
70001
70014
|
|
|
70002
70015
|
// src/codegen/transforms/list.ts
|
|
70003
|
-
var
|
|
70016
|
+
var graphql10 = __toESM(require_graphql2(), 1);
|
|
70004
70017
|
|
|
70005
70018
|
// src/codegen/utils/objectIdentificationSelection.ts
|
|
70006
|
-
var
|
|
70019
|
+
var graphql8 = __toESM(require_graphql2(), 1);
|
|
70007
70020
|
var objectIdentificationSelection = (config4, type) => {
|
|
70008
70021
|
return config4.keyFieldsForType(type.name).map((key) => {
|
|
70009
70022
|
return {
|
|
70010
|
-
kind:
|
|
70023
|
+
kind: graphql8.Kind.FIELD,
|
|
70011
70024
|
name: {
|
|
70012
|
-
kind:
|
|
70025
|
+
kind: graphql8.Kind.NAME,
|
|
70013
70026
|
value: key
|
|
70014
70027
|
}
|
|
70015
70028
|
};
|
|
@@ -70017,7 +70030,7 @@ var objectIdentificationSelection = (config4, type) => {
|
|
|
70017
70030
|
};
|
|
70018
70031
|
|
|
70019
70032
|
// src/codegen/transforms/paginate.ts
|
|
70020
|
-
var
|
|
70033
|
+
var graphql9 = __toESM(require_graphql2(), 1);
|
|
70021
70034
|
async function paginate(config4, documents) {
|
|
70022
70035
|
const newDocs = [];
|
|
70023
70036
|
for (const doc of documents) {
|
|
@@ -70050,7 +70063,7 @@ async function paginate(config4, documents) {
|
|
|
70050
70063
|
};
|
|
70051
70064
|
let cursorType = "String";
|
|
70052
70065
|
let paginationPath = [];
|
|
70053
|
-
doc.document =
|
|
70066
|
+
doc.document = graphql9.visit(doc.document, {
|
|
70054
70067
|
Field(node, _, __, ___, ancestors) {
|
|
70055
70068
|
const paginateDirective = node.directives?.find(
|
|
70056
70069
|
(directive) => directive.name.value === config4.paginateDirective
|
|
@@ -70077,7 +70090,7 @@ async function paginate(config4, documents) {
|
|
|
70077
70090
|
flags.offset.enabled = offsetPagination;
|
|
70078
70091
|
flags.limit.enabled = offsetPagination;
|
|
70079
70092
|
paginationPath = ancestors.filter(
|
|
70080
|
-
(ancestor) => !Array.isArray(ancestor) && ancestor.kind ===
|
|
70093
|
+
(ancestor) => !Array.isArray(ancestor) && ancestor.kind === graphql9.Kind.FIELD
|
|
70081
70094
|
).concat(node).map((field) => field.alias?.value || field.name.value);
|
|
70082
70095
|
return {
|
|
70083
70096
|
...node,
|
|
@@ -70098,7 +70111,7 @@ async function paginate(config4, documents) {
|
|
|
70098
70111
|
refetchUpdate = "prepend" /* prepend */;
|
|
70099
70112
|
}
|
|
70100
70113
|
let fragment = "";
|
|
70101
|
-
doc.document =
|
|
70114
|
+
doc.document = graphql9.visit(doc.document, {
|
|
70102
70115
|
OperationDefinition(node) {
|
|
70103
70116
|
if (node.operation !== "query") {
|
|
70104
70117
|
throw new HoudiniError({
|
|
@@ -70152,9 +70165,9 @@ async function paginate(config4, documents) {
|
|
|
70152
70165
|
directives: [
|
|
70153
70166
|
...node.directives || [],
|
|
70154
70167
|
{
|
|
70155
|
-
kind:
|
|
70168
|
+
kind: graphql9.Kind.DIRECTIVE,
|
|
70156
70169
|
name: {
|
|
70157
|
-
kind:
|
|
70170
|
+
kind: graphql9.Kind.NAME,
|
|
70158
70171
|
value: config4.argumentsDirective
|
|
70159
70172
|
}
|
|
70160
70173
|
}
|
|
@@ -70217,16 +70230,16 @@ async function paginate(config4, documents) {
|
|
|
70217
70230
|
const paginationArgs = Object.entries(flags).filter(([_, { enabled }]) => enabled).map(([key, value]) => ({ name: key, ...value }));
|
|
70218
70231
|
const fragmentSpreadSelection = [
|
|
70219
70232
|
{
|
|
70220
|
-
kind:
|
|
70233
|
+
kind: graphql9.Kind.FRAGMENT_SPREAD,
|
|
70221
70234
|
name: {
|
|
70222
|
-
kind:
|
|
70235
|
+
kind: graphql9.Kind.NAME,
|
|
70223
70236
|
value: fragmentName
|
|
70224
70237
|
},
|
|
70225
70238
|
directives: [
|
|
70226
70239
|
{
|
|
70227
|
-
kind:
|
|
70240
|
+
kind: graphql9.Kind.DIRECTIVE,
|
|
70228
70241
|
name: {
|
|
70229
|
-
kind:
|
|
70242
|
+
kind: graphql9.Kind.NAME,
|
|
70230
70243
|
value: config4.withDirective
|
|
70231
70244
|
},
|
|
70232
70245
|
["arguments"]: paginationArgs.map(
|
|
@@ -70254,29 +70267,29 @@ async function paginate(config4, documents) {
|
|
|
70254
70267
|
});
|
|
70255
70268
|
const typeConfig = config4.typeConfig?.[fragment];
|
|
70256
70269
|
const queryDoc = {
|
|
70257
|
-
kind:
|
|
70270
|
+
kind: graphql9.Kind.DOCUMENT,
|
|
70258
70271
|
definitions: [
|
|
70259
70272
|
{
|
|
70260
|
-
kind:
|
|
70273
|
+
kind: graphql9.Kind.OPERATION_DEFINITION,
|
|
70261
70274
|
name: {
|
|
70262
|
-
kind:
|
|
70275
|
+
kind: graphql9.Kind.NAME,
|
|
70263
70276
|
value: refetchQueryName
|
|
70264
70277
|
},
|
|
70265
70278
|
operation: "query",
|
|
70266
70279
|
variableDefinitions: paginationArgs.map(
|
|
70267
70280
|
(arg) => ({
|
|
70268
|
-
kind:
|
|
70281
|
+
kind: graphql9.Kind.VARIABLE_DEFINITION,
|
|
70269
70282
|
type: {
|
|
70270
|
-
kind:
|
|
70283
|
+
kind: graphql9.Kind.NAMED_TYPE,
|
|
70271
70284
|
name: {
|
|
70272
|
-
kind:
|
|
70285
|
+
kind: graphql9.Kind.NAME,
|
|
70273
70286
|
value: arg.type
|
|
70274
70287
|
}
|
|
70275
70288
|
},
|
|
70276
70289
|
variable: {
|
|
70277
|
-
kind:
|
|
70290
|
+
kind: graphql9.Kind.VARIABLE,
|
|
70278
70291
|
name: {
|
|
70279
|
-
kind:
|
|
70292
|
+
kind: graphql9.Kind.NAME,
|
|
70280
70293
|
value: arg.name
|
|
70281
70294
|
}
|
|
70282
70295
|
},
|
|
@@ -70288,12 +70301,12 @@ async function paginate(config4, documents) {
|
|
|
70288
70301
|
).concat(
|
|
70289
70302
|
!nodeQuery ? [] : keys.map(
|
|
70290
70303
|
(key) => ({
|
|
70291
|
-
kind:
|
|
70304
|
+
kind: graphql9.Kind.VARIABLE_DEFINITION,
|
|
70292
70305
|
type: key.type,
|
|
70293
70306
|
variable: {
|
|
70294
|
-
kind:
|
|
70307
|
+
kind: graphql9.Kind.VARIABLE,
|
|
70295
70308
|
name: {
|
|
70296
|
-
kind:
|
|
70309
|
+
kind: graphql9.Kind.NAME,
|
|
70297
70310
|
value: key.name
|
|
70298
70311
|
}
|
|
70299
70312
|
}
|
|
@@ -70301,42 +70314,42 @@ async function paginate(config4, documents) {
|
|
|
70301
70314
|
)
|
|
70302
70315
|
),
|
|
70303
70316
|
selectionSet: {
|
|
70304
|
-
kind:
|
|
70317
|
+
kind: graphql9.Kind.SELECTION_SET,
|
|
70305
70318
|
selections: !nodeQuery ? fragmentSpreadSelection : [
|
|
70306
70319
|
{
|
|
70307
|
-
kind:
|
|
70320
|
+
kind: graphql9.Kind.FIELD,
|
|
70308
70321
|
name: {
|
|
70309
|
-
kind:
|
|
70322
|
+
kind: graphql9.Kind.NAME,
|
|
70310
70323
|
value: typeConfig?.resolve?.queryField || "node"
|
|
70311
70324
|
},
|
|
70312
70325
|
["arguments"]: keys.map((key) => ({
|
|
70313
|
-
kind:
|
|
70326
|
+
kind: graphql9.Kind.ARGUMENT,
|
|
70314
70327
|
name: {
|
|
70315
|
-
kind:
|
|
70328
|
+
kind: graphql9.Kind.NAME,
|
|
70316
70329
|
value: key.name
|
|
70317
70330
|
},
|
|
70318
70331
|
value: {
|
|
70319
|
-
kind:
|
|
70332
|
+
kind: graphql9.Kind.VARIABLE,
|
|
70320
70333
|
name: {
|
|
70321
|
-
kind:
|
|
70334
|
+
kind: graphql9.Kind.NAME,
|
|
70322
70335
|
value: key.name
|
|
70323
70336
|
}
|
|
70324
70337
|
}
|
|
70325
70338
|
})),
|
|
70326
70339
|
selectionSet: {
|
|
70327
|
-
kind:
|
|
70340
|
+
kind: graphql9.Kind.SELECTION_SET,
|
|
70328
70341
|
selections: [
|
|
70329
70342
|
{
|
|
70330
|
-
kind:
|
|
70343
|
+
kind: graphql9.Kind.FIELD,
|
|
70331
70344
|
name: {
|
|
70332
|
-
kind:
|
|
70345
|
+
kind: graphql9.Kind.NAME,
|
|
70333
70346
|
value: "__typename"
|
|
70334
70347
|
}
|
|
70335
70348
|
},
|
|
70336
70349
|
...(typeConfig?.keys || ["id"]).map((key) => ({
|
|
70337
|
-
kind:
|
|
70350
|
+
kind: graphql9.Kind.FIELD,
|
|
70338
70351
|
name: {
|
|
70339
|
-
kind:
|
|
70352
|
+
kind: graphql9.Kind.NAME,
|
|
70340
70353
|
value: key
|
|
70341
70354
|
}
|
|
70342
70355
|
})),
|
|
@@ -70398,15 +70411,15 @@ function replaceArgumentsWithVariables(args, flags) {
|
|
|
70398
70411
|
}
|
|
70399
70412
|
function variableAsArgument(name2, variable) {
|
|
70400
70413
|
return {
|
|
70401
|
-
kind:
|
|
70414
|
+
kind: graphql9.Kind.ARGUMENT,
|
|
70402
70415
|
name: {
|
|
70403
|
-
kind:
|
|
70416
|
+
kind: graphql9.Kind.NAME,
|
|
70404
70417
|
value: name2
|
|
70405
70418
|
},
|
|
70406
70419
|
value: {
|
|
70407
|
-
kind:
|
|
70420
|
+
kind: graphql9.Kind.VARIABLE,
|
|
70408
70421
|
name: {
|
|
70409
|
-
kind:
|
|
70422
|
+
kind: graphql9.Kind.NAME,
|
|
70410
70423
|
value: variable ?? name2
|
|
70411
70424
|
}
|
|
70412
70425
|
}
|
|
@@ -70414,18 +70427,18 @@ function variableAsArgument(name2, variable) {
|
|
|
70414
70427
|
}
|
|
70415
70428
|
function staticVariableDefinition(name2, type, defaultValue, variableName) {
|
|
70416
70429
|
return {
|
|
70417
|
-
kind:
|
|
70430
|
+
kind: graphql9.Kind.VARIABLE_DEFINITION,
|
|
70418
70431
|
type: {
|
|
70419
|
-
kind:
|
|
70432
|
+
kind: graphql9.Kind.NAMED_TYPE,
|
|
70420
70433
|
name: {
|
|
70421
|
-
kind:
|
|
70434
|
+
kind: graphql9.Kind.NAME,
|
|
70422
70435
|
value: type
|
|
70423
70436
|
}
|
|
70424
70437
|
},
|
|
70425
70438
|
variable: {
|
|
70426
|
-
kind:
|
|
70439
|
+
kind: graphql9.Kind.VARIABLE,
|
|
70427
70440
|
name: {
|
|
70428
|
-
kind:
|
|
70441
|
+
kind: graphql9.Kind.NAME,
|
|
70429
70442
|
value: variableName ?? name2
|
|
70430
70443
|
}
|
|
70431
70444
|
},
|
|
@@ -70437,9 +70450,9 @@ function staticVariableDefinition(name2, type, defaultValue, variableName) {
|
|
|
70437
70450
|
}
|
|
70438
70451
|
function argumentNode(name2, value) {
|
|
70439
70452
|
return {
|
|
70440
|
-
kind:
|
|
70453
|
+
kind: graphql9.Kind.ARGUMENT,
|
|
70441
70454
|
name: {
|
|
70442
|
-
kind:
|
|
70455
|
+
kind: graphql9.Kind.NAME,
|
|
70443
70456
|
value: name2
|
|
70444
70457
|
},
|
|
70445
70458
|
value: objectNode(value)
|
|
@@ -70447,16 +70460,16 @@ function argumentNode(name2, value) {
|
|
|
70447
70460
|
}
|
|
70448
70461
|
function objectNode([type, defaultValue]) {
|
|
70449
70462
|
const node = {
|
|
70450
|
-
kind:
|
|
70463
|
+
kind: graphql9.Kind.OBJECT,
|
|
70451
70464
|
fields: [
|
|
70452
70465
|
{
|
|
70453
|
-
kind:
|
|
70466
|
+
kind: graphql9.Kind.OBJECT_FIELD,
|
|
70454
70467
|
name: {
|
|
70455
|
-
kind:
|
|
70468
|
+
kind: graphql9.Kind.NAME,
|
|
70456
70469
|
value: "type"
|
|
70457
70470
|
},
|
|
70458
70471
|
value: {
|
|
70459
|
-
kind:
|
|
70472
|
+
kind: graphql9.Kind.STRING,
|
|
70460
70473
|
value: type
|
|
70461
70474
|
}
|
|
70462
70475
|
}
|
|
@@ -70464,8 +70477,8 @@ function objectNode([type, defaultValue]) {
|
|
|
70464
70477
|
};
|
|
70465
70478
|
if (defaultValue) {
|
|
70466
70479
|
node.fields.push({
|
|
70467
|
-
kind:
|
|
70468
|
-
name: { kind:
|
|
70480
|
+
kind: graphql9.Kind.OBJECT_FIELD,
|
|
70481
|
+
name: { kind: graphql9.Kind.NAME, value: "default" },
|
|
70469
70482
|
value: {
|
|
70470
70483
|
kind: typeof defaultValue === "number" ? "IntValue" : "StringValue",
|
|
70471
70484
|
value: defaultValue.toString()
|
|
@@ -70476,34 +70489,34 @@ function objectNode([type, defaultValue]) {
|
|
|
70476
70489
|
}
|
|
70477
70490
|
var pageInfoSelection = [
|
|
70478
70491
|
{
|
|
70479
|
-
kind:
|
|
70492
|
+
kind: graphql9.Kind.FIELD,
|
|
70480
70493
|
name: {
|
|
70481
|
-
kind:
|
|
70494
|
+
kind: graphql9.Kind.NAME,
|
|
70482
70495
|
value: "edges"
|
|
70483
70496
|
},
|
|
70484
70497
|
selectionSet: {
|
|
70485
|
-
kind:
|
|
70498
|
+
kind: graphql9.Kind.SELECTION_SET,
|
|
70486
70499
|
selections: [
|
|
70487
70500
|
{
|
|
70488
|
-
kind:
|
|
70501
|
+
kind: graphql9.Kind.FIELD,
|
|
70489
70502
|
name: {
|
|
70490
|
-
kind:
|
|
70503
|
+
kind: graphql9.Kind.NAME,
|
|
70491
70504
|
value: "cursor"
|
|
70492
70505
|
}
|
|
70493
70506
|
},
|
|
70494
70507
|
{
|
|
70495
|
-
kind:
|
|
70508
|
+
kind: graphql9.Kind.FIELD,
|
|
70496
70509
|
name: {
|
|
70497
|
-
kind:
|
|
70510
|
+
kind: graphql9.Kind.NAME,
|
|
70498
70511
|
value: "node"
|
|
70499
70512
|
},
|
|
70500
70513
|
selectionSet: {
|
|
70501
|
-
kind:
|
|
70514
|
+
kind: graphql9.Kind.SELECTION_SET,
|
|
70502
70515
|
selections: [
|
|
70503
70516
|
{
|
|
70504
|
-
kind:
|
|
70517
|
+
kind: graphql9.Kind.FIELD,
|
|
70505
70518
|
name: {
|
|
70506
|
-
kind:
|
|
70519
|
+
kind: graphql9.Kind.NAME,
|
|
70507
70520
|
value: "__typename"
|
|
70508
70521
|
}
|
|
70509
70522
|
}
|
|
@@ -70514,39 +70527,39 @@ var pageInfoSelection = [
|
|
|
70514
70527
|
}
|
|
70515
70528
|
},
|
|
70516
70529
|
{
|
|
70517
|
-
kind:
|
|
70530
|
+
kind: graphql9.Kind.FIELD,
|
|
70518
70531
|
name: {
|
|
70519
|
-
kind:
|
|
70532
|
+
kind: graphql9.Kind.NAME,
|
|
70520
70533
|
value: "pageInfo"
|
|
70521
70534
|
},
|
|
70522
70535
|
selectionSet: {
|
|
70523
|
-
kind:
|
|
70536
|
+
kind: graphql9.Kind.SELECTION_SET,
|
|
70524
70537
|
selections: [
|
|
70525
70538
|
{
|
|
70526
|
-
kind:
|
|
70539
|
+
kind: graphql9.Kind.FIELD,
|
|
70527
70540
|
name: {
|
|
70528
|
-
kind:
|
|
70541
|
+
kind: graphql9.Kind.NAME,
|
|
70529
70542
|
value: "hasPreviousPage"
|
|
70530
70543
|
}
|
|
70531
70544
|
},
|
|
70532
70545
|
{
|
|
70533
|
-
kind:
|
|
70546
|
+
kind: graphql9.Kind.FIELD,
|
|
70534
70547
|
name: {
|
|
70535
|
-
kind:
|
|
70548
|
+
kind: graphql9.Kind.NAME,
|
|
70536
70549
|
value: "hasNextPage"
|
|
70537
70550
|
}
|
|
70538
70551
|
},
|
|
70539
70552
|
{
|
|
70540
|
-
kind:
|
|
70553
|
+
kind: graphql9.Kind.FIELD,
|
|
70541
70554
|
name: {
|
|
70542
|
-
kind:
|
|
70555
|
+
kind: graphql9.Kind.NAME,
|
|
70543
70556
|
value: "startCursor"
|
|
70544
70557
|
}
|
|
70545
70558
|
},
|
|
70546
70559
|
{
|
|
70547
|
-
kind:
|
|
70560
|
+
kind: graphql9.Kind.FIELD,
|
|
70548
70561
|
name: {
|
|
70549
|
-
kind:
|
|
70562
|
+
kind: graphql9.Kind.NAME,
|
|
70550
70563
|
value: "endCursor"
|
|
70551
70564
|
}
|
|
70552
70565
|
}
|
|
@@ -70560,15 +70573,15 @@ async function addListFragments(config4, documents) {
|
|
|
70560
70573
|
const lists = {};
|
|
70561
70574
|
const errors = [];
|
|
70562
70575
|
for (const doc of documents) {
|
|
70563
|
-
doc.document =
|
|
70576
|
+
doc.document = graphql10.visit(doc.document, {
|
|
70564
70577
|
Directive(node, key, parent, path2, ancestors) {
|
|
70565
70578
|
if ([config4.listDirective, config4.paginateDirective].includes(node.name.value)) {
|
|
70566
70579
|
const nameArg = node.arguments?.find((arg) => arg.name.value === "name");
|
|
70567
70580
|
let error = {
|
|
70568
|
-
...new
|
|
70581
|
+
...new graphql10.GraphQLError(
|
|
70569
70582
|
"",
|
|
70570
70583
|
node,
|
|
70571
|
-
new
|
|
70584
|
+
new graphql10.Source(""),
|
|
70572
70585
|
node.loc ? [node.loc.start, node.loc.end] : null,
|
|
70573
70586
|
path2
|
|
70574
70587
|
),
|
|
@@ -70620,7 +70633,7 @@ async function addListFragments(config4, documents) {
|
|
|
70620
70633
|
{
|
|
70621
70634
|
kind: "Argument",
|
|
70622
70635
|
name: {
|
|
70623
|
-
kind:
|
|
70636
|
+
kind: graphql10.Kind.NAME,
|
|
70624
70637
|
value: "connection"
|
|
70625
70638
|
},
|
|
70626
70639
|
value: {
|
|
@@ -70670,7 +70683,7 @@ async function addListFragments(config4, documents) {
|
|
|
70670
70683
|
const validDeletes = [
|
|
70671
70684
|
...new Set(
|
|
70672
70685
|
Object.values(lists).map(({ type }) => {
|
|
70673
|
-
if (!(type instanceof
|
|
70686
|
+
if (!(type instanceof graphql10.GraphQLObjectType)) {
|
|
70674
70687
|
return "";
|
|
70675
70688
|
}
|
|
70676
70689
|
if (config4.keyFieldsForType(type.name).length !== 1) {
|
|
@@ -70684,7 +70697,7 @@ async function addListFragments(config4, documents) {
|
|
|
70684
70697
|
return;
|
|
70685
70698
|
}
|
|
70686
70699
|
const generatedDoc = {
|
|
70687
|
-
kind:
|
|
70700
|
+
kind: graphql10.Kind.DOCUMENT,
|
|
70688
70701
|
definitions: Object.entries(lists).flatMap(
|
|
70689
70702
|
([name2, { selection: selection2, type }]) => {
|
|
70690
70703
|
const schemaType = config4.schema.getType(type.name);
|
|
@@ -70692,7 +70705,7 @@ async function addListFragments(config4, documents) {
|
|
|
70692
70705
|
throw new HoudiniError({ message: "Lists must have a selection" });
|
|
70693
70706
|
}
|
|
70694
70707
|
const fragmentSelection = {
|
|
70695
|
-
kind:
|
|
70708
|
+
kind: graphql10.Kind.SELECTION_SET,
|
|
70696
70709
|
selections: [...selection2.selections]
|
|
70697
70710
|
};
|
|
70698
70711
|
if (schemaType && fragmentSelection && !fragmentSelection?.selections.find(
|
|
@@ -70707,14 +70720,14 @@ async function addListFragments(config4, documents) {
|
|
|
70707
70720
|
{
|
|
70708
70721
|
name: {
|
|
70709
70722
|
value: config4.listInsertFragment(name2),
|
|
70710
|
-
kind:
|
|
70723
|
+
kind: graphql10.Kind.NAME
|
|
70711
70724
|
},
|
|
70712
|
-
kind:
|
|
70725
|
+
kind: graphql10.Kind.FRAGMENT_DEFINITION,
|
|
70713
70726
|
selectionSet: fragmentSelection,
|
|
70714
70727
|
typeCondition: {
|
|
70715
|
-
kind:
|
|
70728
|
+
kind: graphql10.Kind.NAMED_TYPE,
|
|
70716
70729
|
name: {
|
|
70717
|
-
kind:
|
|
70730
|
+
kind: graphql10.Kind.NAME,
|
|
70718
70731
|
value: type.name
|
|
70719
70732
|
}
|
|
70720
70733
|
}
|
|
@@ -70722,32 +70735,32 @@ async function addListFragments(config4, documents) {
|
|
|
70722
70735
|
{
|
|
70723
70736
|
name: {
|
|
70724
70737
|
value: config4.listToggleFragment(name2),
|
|
70725
|
-
kind:
|
|
70738
|
+
kind: graphql10.Kind.NAME
|
|
70726
70739
|
},
|
|
70727
|
-
kind:
|
|
70740
|
+
kind: graphql10.Kind.FRAGMENT_DEFINITION,
|
|
70728
70741
|
selectionSet: fragmentSelection,
|
|
70729
70742
|
typeCondition: {
|
|
70730
|
-
kind:
|
|
70743
|
+
kind: graphql10.Kind.NAMED_TYPE,
|
|
70731
70744
|
name: {
|
|
70732
|
-
kind:
|
|
70745
|
+
kind: graphql10.Kind.NAME,
|
|
70733
70746
|
value: type.name
|
|
70734
70747
|
}
|
|
70735
70748
|
}
|
|
70736
70749
|
},
|
|
70737
70750
|
{
|
|
70738
|
-
kind:
|
|
70751
|
+
kind: graphql10.Kind.FRAGMENT_DEFINITION,
|
|
70739
70752
|
name: {
|
|
70740
70753
|
value: config4.listRemoveFragment(name2),
|
|
70741
|
-
kind:
|
|
70754
|
+
kind: graphql10.Kind.NAME
|
|
70742
70755
|
},
|
|
70743
70756
|
selectionSet: {
|
|
70744
|
-
kind:
|
|
70757
|
+
kind: graphql10.Kind.SELECTION_SET,
|
|
70745
70758
|
selections: [...objectIdentificationSelection(config4, type)]
|
|
70746
70759
|
},
|
|
70747
70760
|
typeCondition: {
|
|
70748
|
-
kind:
|
|
70761
|
+
kind: graphql10.Kind.NAMED_TYPE,
|
|
70749
70762
|
name: {
|
|
70750
|
-
kind:
|
|
70763
|
+
kind: graphql10.Kind.NAME,
|
|
70751
70764
|
value: type.name
|
|
70752
70765
|
}
|
|
70753
70766
|
}
|
|
@@ -70756,14 +70769,14 @@ async function addListFragments(config4, documents) {
|
|
|
70756
70769
|
}
|
|
70757
70770
|
).concat(
|
|
70758
70771
|
...validDeletes.map((typeName) => ({
|
|
70759
|
-
kind:
|
|
70772
|
+
kind: graphql10.Kind.DIRECTIVE_DEFINITION,
|
|
70760
70773
|
name: {
|
|
70761
|
-
kind:
|
|
70774
|
+
kind: graphql10.Kind.NAME,
|
|
70762
70775
|
value: config4.listDeleteDirective(typeName)
|
|
70763
70776
|
},
|
|
70764
70777
|
locations: [
|
|
70765
70778
|
{
|
|
70766
|
-
kind:
|
|
70779
|
+
kind: graphql10.Kind.NAME,
|
|
70767
70780
|
value: "FIELD"
|
|
70768
70781
|
}
|
|
70769
70782
|
],
|
|
@@ -70771,8 +70784,8 @@ async function addListFragments(config4, documents) {
|
|
|
70771
70784
|
}))
|
|
70772
70785
|
)
|
|
70773
70786
|
};
|
|
70774
|
-
config4.newSchema += "\n" + generatedDoc.definitions.filter((c) => c.kind !== "FragmentDefinition").map(
|
|
70775
|
-
config4.newDocuments += "\n" + generatedDoc.definitions.filter((c) => c.kind === "FragmentDefinition").map(
|
|
70787
|
+
config4.newSchema += "\n" + generatedDoc.definitions.filter((c) => c.kind !== "FragmentDefinition").map(graphql10.print).join("\n\n");
|
|
70788
|
+
config4.newDocuments += "\n" + generatedDoc.definitions.filter((c) => c.kind === "FragmentDefinition").map(graphql10.print).join("\n\n");
|
|
70776
70789
|
documents.push({
|
|
70777
70790
|
name: "generated::lists",
|
|
70778
70791
|
kind: "HoudiniFragment" /* Fragment */,
|
|
@@ -70857,11 +70870,11 @@ var nodeNotDefinedMessage = (config4) => `Looks like you are trying to use the $
|
|
|
70857
70870
|
For more information, visit this link: ${siteURL}/guides/pagination`;
|
|
70858
70871
|
|
|
70859
70872
|
// src/codegen/generators/artifacts/fieldKey.ts
|
|
70860
|
-
var
|
|
70873
|
+
var graphql11 = __toESM(require_graphql2(), 1);
|
|
70861
70874
|
function fieldKey(config4, field) {
|
|
70862
70875
|
const attributeName = field.alias?.value || field.name.value;
|
|
70863
|
-
const printed =
|
|
70864
|
-
const secondParse =
|
|
70876
|
+
const printed = graphql11.print(field);
|
|
70877
|
+
const secondParse = graphql11.parse(`{${printed}}`).definitions[0].selectionSet.selections[0];
|
|
70865
70878
|
const paginated = !!field.directives?.find(
|
|
70866
70879
|
(directive) => directive.name.value === config4.paginateDirective
|
|
70867
70880
|
);
|
|
@@ -70956,8 +70969,8 @@ function selection({
|
|
|
70956
70969
|
const typeConditionName = field.typeCondition.name.value;
|
|
70957
70970
|
const typeCondition = config4.schema.getType(typeConditionName);
|
|
70958
70971
|
const possibleTypes = [];
|
|
70959
|
-
if (!
|
|
70960
|
-
} else if (
|
|
70972
|
+
if (!graphql12.isAbstractType(typeCondition)) {
|
|
70973
|
+
} else if (graphql12.isAbstractType(parentType)) {
|
|
70961
70974
|
const possibleParentTypes = config4.schema.getPossibleTypes(parentType).map((type) => type.name);
|
|
70962
70975
|
for (const possible of config4.schema.getPossibleTypes(typeCondition)) {
|
|
70963
70976
|
if (possibleParentTypes.includes(possible.name)) {
|
|
@@ -71005,7 +71018,7 @@ function selection({
|
|
|
71005
71018
|
} else {
|
|
71006
71019
|
let typeRef = type.getFields()[field.name.value].type;
|
|
71007
71020
|
fieldType = getRootType(typeRef);
|
|
71008
|
-
nullable = !
|
|
71021
|
+
nullable = !graphql12.isNonNullType(typeRef);
|
|
71009
71022
|
}
|
|
71010
71023
|
const typeName = fieldType.toString();
|
|
71011
71024
|
const pathSoFar = path2.concat(attributeName);
|
|
@@ -71070,7 +71083,7 @@ function selection({
|
|
|
71070
71083
|
{}
|
|
71071
71084
|
);
|
|
71072
71085
|
}
|
|
71073
|
-
if (
|
|
71086
|
+
if (graphql12.isInterfaceType(fieldType) || graphql12.isUnionType(fieldType)) {
|
|
71074
71087
|
fieldObj.abstract = true;
|
|
71075
71088
|
}
|
|
71076
71089
|
object.fields = {
|
|
@@ -71127,7 +71140,7 @@ function artifactGenerator(stats) {
|
|
|
71127
71140
|
return async function(config4, docs) {
|
|
71128
71141
|
const filterTypes = {};
|
|
71129
71142
|
for (const doc of docs) {
|
|
71130
|
-
|
|
71143
|
+
graphql13.visit(doc.document, {
|
|
71131
71144
|
Directive(node, _, __, ___, ancestors) {
|
|
71132
71145
|
if (node.name.value !== config4.listDirective) {
|
|
71133
71146
|
return;
|
|
@@ -71186,7 +71199,7 @@ function artifactGenerator(stats) {
|
|
|
71186
71199
|
return;
|
|
71187
71200
|
}
|
|
71188
71201
|
const usedVariableNames = /* @__PURE__ */ new Set();
|
|
71189
|
-
let documentWithoutInternalDirectives =
|
|
71202
|
+
let documentWithoutInternalDirectives = graphql13.visit(document, {
|
|
71190
71203
|
Directive(node) {
|
|
71191
71204
|
if (config4.isInternalDirective(node)) {
|
|
71192
71205
|
return null;
|
|
@@ -71199,7 +71212,7 @@ function artifactGenerator(stats) {
|
|
|
71199
71212
|
}
|
|
71200
71213
|
}
|
|
71201
71214
|
});
|
|
71202
|
-
let documentWithoutExtraVariables =
|
|
71215
|
+
let documentWithoutExtraVariables = graphql13.visit(
|
|
71203
71216
|
documentWithoutInternalDirectives,
|
|
71204
71217
|
{
|
|
71205
71218
|
VariableDefinition(variableDefinitionNode) {
|
|
@@ -71210,13 +71223,13 @@ function artifactGenerator(stats) {
|
|
|
71210
71223
|
}
|
|
71211
71224
|
}
|
|
71212
71225
|
);
|
|
71213
|
-
let rawString =
|
|
71226
|
+
let rawString = graphql13.print(documentWithoutExtraVariables);
|
|
71214
71227
|
let docKind = doc.kind;
|
|
71215
71228
|
const operations = document.definitions.filter(
|
|
71216
|
-
({ kind }) => kind ===
|
|
71229
|
+
({ kind }) => kind === graphql13.Kind.OPERATION_DEFINITION
|
|
71217
71230
|
);
|
|
71218
71231
|
const fragments = document.definitions.filter(
|
|
71219
|
-
({ kind }) => kind ===
|
|
71232
|
+
({ kind }) => kind === graphql13.Kind.FRAGMENT_DEFINITION
|
|
71220
71233
|
);
|
|
71221
71234
|
let rootType = "";
|
|
71222
71235
|
let selectionSet;
|
|
@@ -71458,15 +71471,15 @@ async function generatePluginRuntime(config4, plugin) {
|
|
|
71458
71471
|
var recast12 = __toESM(require_main2(), 1);
|
|
71459
71472
|
|
|
71460
71473
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
71461
|
-
var
|
|
71474
|
+
var graphql16 = __toESM(require_graphql2(), 1);
|
|
71462
71475
|
var recast9 = __toESM(require_main2(), 1);
|
|
71463
71476
|
|
|
71464
71477
|
// src/codegen/generators/typescript/typeReference.ts
|
|
71465
|
-
var
|
|
71478
|
+
var graphql15 = __toESM(require_graphql2(), 1);
|
|
71466
71479
|
var recast8 = __toESM(require_main2(), 1);
|
|
71467
71480
|
|
|
71468
71481
|
// src/codegen/generators/typescript/types.ts
|
|
71469
|
-
var
|
|
71482
|
+
var graphql14 = __toESM(require_graphql2(), 1);
|
|
71470
71483
|
var recast7 = __toESM(require_main2(), 1);
|
|
71471
71484
|
var AST7 = recast7.types.builders;
|
|
71472
71485
|
function readonlyProperty(prop, enable = true) {
|
|
@@ -71500,7 +71513,7 @@ function scalarPropertyValue(config4, missingScalars, target) {
|
|
|
71500
71513
|
return AST7.tsStringKeyword();
|
|
71501
71514
|
}
|
|
71502
71515
|
default: {
|
|
71503
|
-
if (
|
|
71516
|
+
if (graphql14.isNonNullType(target) && "ofType" in target) {
|
|
71504
71517
|
return scalarPropertyValue(
|
|
71505
71518
|
config4,
|
|
71506
71519
|
missingScalars,
|
|
@@ -71521,7 +71534,7 @@ var AST8 = recast8.types.builders;
|
|
|
71521
71534
|
function tsTypeReference(config4, missingScalars, definition) {
|
|
71522
71535
|
const { type, wrappers } = unwrapType(config4, definition.type);
|
|
71523
71536
|
let result;
|
|
71524
|
-
if (
|
|
71537
|
+
if (graphql15.isScalarType(type)) {
|
|
71525
71538
|
result = scalarPropertyValue(config4, missingScalars, type);
|
|
71526
71539
|
} else {
|
|
71527
71540
|
result = AST8.tsTypeReference(AST8.identifier(type.name));
|
|
@@ -71542,17 +71555,17 @@ function tsTypeReference(config4, missingScalars, definition) {
|
|
|
71542
71555
|
var AST9 = recast9.types.builders;
|
|
71543
71556
|
function addReferencedInputTypes(config4, filepath, body, visitedTypes, missingScalars, rootType) {
|
|
71544
71557
|
const { type } = unwrapType(config4, rootType);
|
|
71545
|
-
if (
|
|
71558
|
+
if (graphql16.isScalarType(type)) {
|
|
71546
71559
|
return;
|
|
71547
71560
|
}
|
|
71548
71561
|
if (visitedTypes.has(type.name)) {
|
|
71549
71562
|
return;
|
|
71550
71563
|
}
|
|
71551
|
-
if (
|
|
71564
|
+
if (graphql16.isUnionType(type)) {
|
|
71552
71565
|
throw new HoudiniError({ filepath, message: "Input Unions are not supported yet. Sorry!" });
|
|
71553
71566
|
}
|
|
71554
71567
|
visitedTypes.add(type.name);
|
|
71555
|
-
if (
|
|
71568
|
+
if (graphql16.isEnumType(type)) {
|
|
71556
71569
|
ensureImports({
|
|
71557
71570
|
config: config4,
|
|
71558
71571
|
body,
|
|
@@ -71569,7 +71582,7 @@ function addReferencedInputTypes(config4, filepath, body, visitedTypes, missingS
|
|
|
71569
71582
|
AST9.tsPropertySignature(
|
|
71570
71583
|
AST9.identifier(field.name),
|
|
71571
71584
|
AST9.tsTypeAnnotation(tsTypeReference(config4, missingScalars, field)),
|
|
71572
|
-
|
|
71585
|
+
graphql16.isNullableType(field.type)
|
|
71573
71586
|
)
|
|
71574
71587
|
);
|
|
71575
71588
|
}
|
|
@@ -71577,7 +71590,7 @@ function addReferencedInputTypes(config4, filepath, body, visitedTypes, missingS
|
|
|
71577
71590
|
}
|
|
71578
71591
|
|
|
71579
71592
|
// src/codegen/generators/typescript/imperativeCache.ts
|
|
71580
|
-
var
|
|
71593
|
+
var graphql17 = __toESM(require_graphql2(), 1);
|
|
71581
71594
|
var recast10 = __toESM(require_main2(), 1);
|
|
71582
71595
|
var AST10 = recast10.types.builders;
|
|
71583
71596
|
async function imperativeCacheTypef(config4, docs) {
|
|
@@ -71613,7 +71626,7 @@ function typeDefinitions(config4, body) {
|
|
|
71613
71626
|
const operationTypes = [config4.schema.getMutationType(), config4.schema.getSubscriptionType()].filter(Boolean).map((type) => type?.name);
|
|
71614
71627
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
71615
71628
|
const types17 = Object.values(config4.schema.getTypeMap()).filter(
|
|
71616
|
-
(type) => !
|
|
71629
|
+
(type) => !graphql17.isAbstractType(type) && !graphql17.isScalarType(type) && !graphql17.isEnumType(type) && !graphql17.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
|
|
71617
71630
|
);
|
|
71618
71631
|
return AST10.tsTypeLiteral(
|
|
71619
71632
|
types17.map((type) => {
|
|
@@ -71623,7 +71636,7 @@ function typeDefinitions(config4, body) {
|
|
|
71623
71636
|
}
|
|
71624
71637
|
let idFields = AST10.tsNeverKeyword();
|
|
71625
71638
|
const keys = keyFieldsForType(config4.configFile, type.name);
|
|
71626
|
-
if (
|
|
71639
|
+
if (graphql17.isObjectType(type) && keys.length > 0 && keys.every((key) => type.getFields()[key])) {
|
|
71627
71640
|
idFields = AST10.tsTypeLiteral(
|
|
71628
71641
|
keys.map((key) => {
|
|
71629
71642
|
const fieldType = type.getFields()[key];
|
|
@@ -71640,21 +71653,21 @@ function typeDefinitions(config4, body) {
|
|
|
71640
71653
|
idFields = AST10.tsTypeLiteral([]);
|
|
71641
71654
|
}
|
|
71642
71655
|
let fields = AST10.tsTypeLiteral([]);
|
|
71643
|
-
if (
|
|
71656
|
+
if (graphql17.isObjectType(type)) {
|
|
71644
71657
|
fields = AST10.tsTypeLiteral(
|
|
71645
71658
|
Object.entries(type.getFields()).map(
|
|
71646
71659
|
([key, fieldType]) => {
|
|
71647
71660
|
const unwrapped = unwrapType(config4, fieldType.type);
|
|
71648
71661
|
let typeOptions = AST10.tsUnionType([]);
|
|
71649
|
-
if (
|
|
71662
|
+
if (graphql17.isScalarType(unwrapped.type)) {
|
|
71650
71663
|
typeOptions.types.push(
|
|
71651
71664
|
scalarPropertyValue(config4, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
71652
71665
|
);
|
|
71653
|
-
} else if (
|
|
71666
|
+
} else if (graphql17.isEnumType(unwrapped.type)) {
|
|
71654
71667
|
typeOptions.types.push(
|
|
71655
71668
|
AST10.tsTypeReference(AST10.identifier(unwrapped.type.name))
|
|
71656
71669
|
);
|
|
71657
|
-
} else if (!
|
|
71670
|
+
} else if (!graphql17.isAbstractType(unwrapped.type)) {
|
|
71658
71671
|
typeOptions.types.push(record(unwrapped.type.name));
|
|
71659
71672
|
} else {
|
|
71660
71673
|
typeOptions.types.push(
|
|
@@ -71740,7 +71753,7 @@ function listDefinitions(config4, docs) {
|
|
|
71740
71753
|
const lists = [];
|
|
71741
71754
|
const visitedLists = /* @__PURE__ */ new Set();
|
|
71742
71755
|
for (const doc of docs) {
|
|
71743
|
-
|
|
71756
|
+
graphql17.visit(doc.document, {
|
|
71744
71757
|
Directive(node, key, parent, path2, ancestors) {
|
|
71745
71758
|
if (![config4.listDirective, config4.paginateDirective].includes(node.name.value)) {
|
|
71746
71759
|
return;
|
|
@@ -71760,7 +71773,7 @@ function listDefinitions(config4, docs) {
|
|
|
71760
71773
|
const targetFieldDefinition = parentType.getFields()[targetField.name.value];
|
|
71761
71774
|
const { type: listType } = unwrapType(config4, targetFieldDefinition.type);
|
|
71762
71775
|
const possibleTypes = [];
|
|
71763
|
-
if (
|
|
71776
|
+
if (graphql17.isAbstractType(listType)) {
|
|
71764
71777
|
possibleTypes.push(
|
|
71765
71778
|
...config4.schema.getPossibleTypes(listType).map((possible) => possible.name)
|
|
71766
71779
|
);
|
|
@@ -71824,7 +71837,7 @@ function record(name2) {
|
|
|
71824
71837
|
}
|
|
71825
71838
|
|
|
71826
71839
|
// src/codegen/generators/typescript/inlineType.ts
|
|
71827
|
-
var
|
|
71840
|
+
var graphql18 = __toESM(require_graphql2(), 1);
|
|
71828
71841
|
var recast11 = __toESM(require_main2(), 1);
|
|
71829
71842
|
var AST11 = recast11.types.builders;
|
|
71830
71843
|
var fragmentKey = "$fragments";
|
|
@@ -71843,9 +71856,9 @@ function inlineType({
|
|
|
71843
71856
|
}) {
|
|
71844
71857
|
const { type, wrappers } = unwrapType(config4, rootType);
|
|
71845
71858
|
let result;
|
|
71846
|
-
if (
|
|
71859
|
+
if (graphql18.isScalarType(type)) {
|
|
71847
71860
|
result = scalarPropertyValue(config4, missingScalars, type);
|
|
71848
|
-
} else if (
|
|
71861
|
+
} else if (graphql18.isEnumType(type)) {
|
|
71849
71862
|
if (!visitedTypes.has(type.name)) {
|
|
71850
71863
|
ensureImports({
|
|
71851
71864
|
config: config4,
|
|
@@ -71863,11 +71876,11 @@ function inlineType({
|
|
|
71863
71876
|
for (const selection2 of selections) {
|
|
71864
71877
|
if (selection2.kind === "InlineFragment" && selection2.typeCondition) {
|
|
71865
71878
|
const fragmentType = config4.schema.getType(selection2.typeCondition.name.value);
|
|
71866
|
-
if (!
|
|
71879
|
+
if (!graphql18.isInterfaceType(type) && !graphql18.isUnionType(type)) {
|
|
71867
71880
|
selectedFields.push(...selection2.selectionSet.selections);
|
|
71868
71881
|
continue;
|
|
71869
71882
|
}
|
|
71870
|
-
if (!
|
|
71883
|
+
if (!graphql18.isInterfaceType(fragmentType) && !graphql18.isUnionType(fragmentType)) {
|
|
71871
71884
|
if (!inlineFragments[fragmentType.name]) {
|
|
71872
71885
|
inlineFragments[fragmentType.name] = [];
|
|
71873
71886
|
}
|
|
@@ -71987,7 +72000,7 @@ function inlineType({
|
|
|
71987
72000
|
}
|
|
71988
72001
|
}
|
|
71989
72002
|
}
|
|
71990
|
-
if (objectType.type === "TSTypeLiteral" && !
|
|
72003
|
+
if (objectType.type === "TSTypeLiteral" && !graphql18.isInterfaceType(fragmentRootType) && !graphql18.isUnionType(fragmentRootType)) {
|
|
71991
72004
|
const existingTypenameIndex = objectType.members.findIndex(
|
|
71992
72005
|
(member) => member.type === "TSPropertySignature" && member.key.type === "Identifier" && member.key.name === "__typename"
|
|
71993
72006
|
);
|
|
@@ -72054,7 +72067,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection2) {
|
|
|
72054
72067
|
},
|
|
72055
72068
|
type: schema.getType("String")
|
|
72056
72069
|
};
|
|
72057
|
-
} else if (
|
|
72070
|
+
} else if (graphql18.isNonNullType(rootType) && "getFields" in rootType.ofType) {
|
|
72058
72071
|
fields = rootType.ofType.getFields();
|
|
72059
72072
|
} else {
|
|
72060
72073
|
fields = rootType.getFields();
|
|
@@ -72066,7 +72079,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection2) {
|
|
|
72066
72079
|
message: `Could not find type information for field ${rootType.toString()}.${selectionName} ${field}`
|
|
72067
72080
|
});
|
|
72068
72081
|
}
|
|
72069
|
-
const fieldType =
|
|
72082
|
+
const fieldType = graphql18.getNamedType(field.type);
|
|
72070
72083
|
if (!fieldType) {
|
|
72071
72084
|
throw new HoudiniError({
|
|
72072
72085
|
filepath,
|
|
@@ -72387,7 +72400,7 @@ async function generateFragmentTypeDefs(config4, filepath, body, selections, def
|
|
|
72387
72400
|
}
|
|
72388
72401
|
|
|
72389
72402
|
// src/codegen/generators/persistedQueries/index.ts
|
|
72390
|
-
var
|
|
72403
|
+
var graphql19 = __toESM(require_graphql2(), 1);
|
|
72391
72404
|
async function persistOutputGenerator(config4, docs) {
|
|
72392
72405
|
if (typeof config4.persistedQueryPath !== "string" || config4.persistedQueryPath.length === 0)
|
|
72393
72406
|
return;
|
|
@@ -72399,8 +72412,8 @@ async function persistOutputGenerator(config4, docs) {
|
|
|
72399
72412
|
if (!generateArtifact) {
|
|
72400
72413
|
return acc;
|
|
72401
72414
|
}
|
|
72402
|
-
let rawString =
|
|
72403
|
-
|
|
72415
|
+
let rawString = graphql19.print(
|
|
72416
|
+
graphql19.visit(document, {
|
|
72404
72417
|
Directive(node) {
|
|
72405
72418
|
if (config4.isInternalDirective(node)) {
|
|
72406
72419
|
return null;
|
|
@@ -72409,7 +72422,7 @@ async function persistOutputGenerator(config4, docs) {
|
|
|
72409
72422
|
})
|
|
72410
72423
|
);
|
|
72411
72424
|
const operations = document.definitions.filter(
|
|
72412
|
-
({ kind }) => kind ===
|
|
72425
|
+
({ kind }) => kind === graphql19.Kind.OPERATION_DEFINITION
|
|
72413
72426
|
);
|
|
72414
72427
|
if (operations.length > 0 && operations[0].kind === "OperationDefinition") {
|
|
72415
72428
|
acc[hashDocument(rawString)] = rawString;
|
|
@@ -72422,11 +72435,11 @@ async function persistOutputGenerator(config4, docs) {
|
|
|
72422
72435
|
}
|
|
72423
72436
|
|
|
72424
72437
|
// src/codegen/generators/definitions/enums.ts
|
|
72425
|
-
var
|
|
72438
|
+
var graphql20 = __toESM(require_graphql2(), 1);
|
|
72426
72439
|
var recast13 = __toESM(require_main2(), 1);
|
|
72427
72440
|
var AST13 = recast13.types.builders;
|
|
72428
72441
|
async function definitionsGenerator(config4) {
|
|
72429
|
-
const enums =
|
|
72442
|
+
const enums = graphql20.parse(graphql20.printSchema(config4.schema)).definitions.filter(
|
|
72430
72443
|
(definition) => definition.kind === "EnumTypeDefinition"
|
|
72431
72444
|
).filter((def) => !config4.isInternalEnum(def));
|
|
72432
72445
|
const runtimeDefinitions = recast13.print(
|
|
@@ -72599,7 +72612,7 @@ function flattenFragments(filepath, operation, fragments) {
|
|
|
72599
72612
|
}
|
|
72600
72613
|
|
|
72601
72614
|
// src/codegen/transforms/schema.ts
|
|
72602
|
-
var
|
|
72615
|
+
var graphql22 = __toESM(require_graphql2(), 1);
|
|
72603
72616
|
async function graphqlExtensions(config4, documents) {
|
|
72604
72617
|
const internalSchema = `
|
|
72605
72618
|
enum CachePolicy {
|
|
@@ -72677,19 +72690,19 @@ directive @${config4.maskEnableDirective} on FRAGMENT_SPREAD
|
|
|
72677
72690
|
"""
|
|
72678
72691
|
directive @${config4.maskDisableDirective} on FRAGMENT_SPREAD
|
|
72679
72692
|
`;
|
|
72680
|
-
let currentSchema =
|
|
72693
|
+
let currentSchema = graphql22.printSchema(config4.schema);
|
|
72681
72694
|
if (!currentSchema.includes(`directive @${config4.listDirective}`)) {
|
|
72682
72695
|
currentSchema += internalSchema;
|
|
72683
72696
|
}
|
|
72684
72697
|
config4.newSchema += internalSchema;
|
|
72685
|
-
config4.schema =
|
|
72698
|
+
config4.schema = graphql22.buildSchema(currentSchema);
|
|
72686
72699
|
}
|
|
72687
72700
|
|
|
72688
72701
|
// src/codegen/transforms/typename.ts
|
|
72689
|
-
var
|
|
72702
|
+
var graphql23 = __toESM(require_graphql2(), 1);
|
|
72690
72703
|
async function addTypename(config4, documents) {
|
|
72691
72704
|
for (const doc of documents) {
|
|
72692
|
-
doc.document =
|
|
72705
|
+
doc.document = graphql23.visit(doc.document, {
|
|
72693
72706
|
Field(node, key, parent, path2, ancestors) {
|
|
72694
72707
|
if (!node.selectionSet) {
|
|
72695
72708
|
return;
|
|
@@ -72701,7 +72714,7 @@ async function addTypename(config4, documents) {
|
|
|
72701
72714
|
);
|
|
72702
72715
|
const field = type.getFields()[node.name.value];
|
|
72703
72716
|
const fieldType = unwrapType(config4, field.type).type;
|
|
72704
|
-
if (
|
|
72717
|
+
if (graphql23.isInterfaceType(fieldType) || graphql23.isUnionType(fieldType)) {
|
|
72705
72718
|
return {
|
|
72706
72719
|
...node,
|
|
72707
72720
|
selectionSet: {
|
|
@@ -72709,9 +72722,9 @@ async function addTypename(config4, documents) {
|
|
|
72709
72722
|
selections: [
|
|
72710
72723
|
...node.selectionSet.selections,
|
|
72711
72724
|
{
|
|
72712
|
-
kind:
|
|
72725
|
+
kind: graphql23.Kind.FIELD,
|
|
72713
72726
|
name: {
|
|
72714
|
-
kind:
|
|
72727
|
+
kind: graphql23.Kind.NAME,
|
|
72715
72728
|
value: "__typename"
|
|
72716
72729
|
}
|
|
72717
72730
|
}
|
|
@@ -72725,10 +72738,10 @@ async function addTypename(config4, documents) {
|
|
|
72725
72738
|
}
|
|
72726
72739
|
|
|
72727
72740
|
// src/codegen/transforms/addID.ts
|
|
72728
|
-
var
|
|
72741
|
+
var graphql24 = __toESM(require_graphql2(), 1);
|
|
72729
72742
|
async function addID(config4, documents) {
|
|
72730
72743
|
for (const doc of documents) {
|
|
72731
|
-
doc.document =
|
|
72744
|
+
doc.document = graphql24.visit(doc.document, {
|
|
72732
72745
|
Field(node, key, parent, path2, ancestors) {
|
|
72733
72746
|
if (!node.selectionSet) {
|
|
72734
72747
|
return;
|
|
@@ -72741,7 +72754,7 @@ async function addID(config4, documents) {
|
|
|
72741
72754
|
const field = type.getFields()[node.name.value];
|
|
72742
72755
|
const fieldType = unwrapType(config4, field.type).type;
|
|
72743
72756
|
if (node.selectionSet?.selections.length > 0) {
|
|
72744
|
-
if (!
|
|
72757
|
+
if (!graphql24.isObjectType(fieldType) && !graphql24.isInterfaceType(fieldType)) {
|
|
72745
72758
|
return;
|
|
72746
72759
|
}
|
|
72747
72760
|
const keyFields = config4.keyFieldsForType(fieldType.name);
|
|
@@ -72756,9 +72769,9 @@ async function addID(config4, documents) {
|
|
|
72756
72769
|
continue;
|
|
72757
72770
|
}
|
|
72758
72771
|
selections.push({
|
|
72759
|
-
kind:
|
|
72772
|
+
kind: graphql24.Kind.FIELD,
|
|
72760
72773
|
name: {
|
|
72761
|
-
kind:
|
|
72774
|
+
kind: graphql24.Kind.NAME,
|
|
72762
72775
|
value: keyField
|
|
72763
72776
|
}
|
|
72764
72777
|
});
|
|
@@ -72777,8 +72790,8 @@ async function addID(config4, documents) {
|
|
|
72777
72790
|
}
|
|
72778
72791
|
|
|
72779
72792
|
// src/codegen/transforms/fragmentVariables.ts
|
|
72780
|
-
var
|
|
72781
|
-
var GraphqlKinds2 =
|
|
72793
|
+
var graphql25 = __toESM(require_graphql2(), 1);
|
|
72794
|
+
var GraphqlKinds2 = graphql25.Kind;
|
|
72782
72795
|
async function fragmentVariables(config4, documents) {
|
|
72783
72796
|
const fragments = collectFragments(config4, documents);
|
|
72784
72797
|
const generatedFragments = {};
|
|
@@ -72801,7 +72814,7 @@ async function fragmentVariables(config4, documents) {
|
|
|
72801
72814
|
});
|
|
72802
72815
|
}
|
|
72803
72816
|
const doc = {
|
|
72804
|
-
kind:
|
|
72817
|
+
kind: graphql25.Kind.DOCUMENT,
|
|
72805
72818
|
definitions: Object.values(generatedFragments)
|
|
72806
72819
|
};
|
|
72807
72820
|
documents.push({
|
|
@@ -72837,7 +72850,7 @@ function inlineFragmentArgs({
|
|
|
72837
72850
|
filepath,
|
|
72838
72851
|
document
|
|
72839
72852
|
).reduce((acc, arg) => ({ ...acc, [arg.name]: arg }), {});
|
|
72840
|
-
const result =
|
|
72853
|
+
const result = graphql25.visit(document, {
|
|
72841
72854
|
FragmentSpread(node) {
|
|
72842
72855
|
const { definition } = fragmentDefinitions[node.name.value];
|
|
72843
72856
|
let { args, hash } = collectWithArguments(config4, filepath, node, scope);
|
|
@@ -72925,7 +72938,7 @@ function inlineFragmentArgs({
|
|
|
72925
72938
|
});
|
|
72926
72939
|
if (newName) {
|
|
72927
72940
|
result.name = {
|
|
72928
|
-
kind:
|
|
72941
|
+
kind: graphql25.Kind.NAME,
|
|
72929
72942
|
value: newName
|
|
72930
72943
|
};
|
|
72931
72944
|
}
|
|
@@ -73037,7 +73050,7 @@ function operationScope(operation) {
|
|
|
73037
73050
|
}
|
|
73038
73051
|
|
|
73039
73052
|
// src/codegen/validators/typeCheck.ts
|
|
73040
|
-
var
|
|
73053
|
+
var graphql26 = __toESM(require_graphql2(), 1);
|
|
73041
73054
|
async function typeCheck(config4, docs) {
|
|
73042
73055
|
const errors = [];
|
|
73043
73056
|
const freeLists = [];
|
|
@@ -73045,11 +73058,11 @@ async function typeCheck(config4, docs) {
|
|
|
73045
73058
|
const listTypes = [];
|
|
73046
73059
|
const fragments = {};
|
|
73047
73060
|
for (const { document: parsed, filename } of docs) {
|
|
73048
|
-
|
|
73049
|
-
[
|
|
73061
|
+
graphql26.visit(parsed, {
|
|
73062
|
+
[graphql26.Kind.FRAGMENT_DEFINITION](definition) {
|
|
73050
73063
|
fragments[definition.name.value] = definition;
|
|
73051
73064
|
},
|
|
73052
|
-
[
|
|
73065
|
+
[graphql26.Kind.DIRECTIVE](directive, _, parent, __, ancestors) {
|
|
73053
73066
|
if (![config4.listDirective, config4.paginateDirective].includes(directive.name.value)) {
|
|
73054
73067
|
return;
|
|
73055
73068
|
}
|
|
@@ -73095,14 +73108,14 @@ async function typeCheck(config4, docs) {
|
|
|
73095
73108
|
);
|
|
73096
73109
|
return;
|
|
73097
73110
|
}
|
|
73098
|
-
if (
|
|
73111
|
+
if (graphql26.isListType(rootType) || graphql26.isNonNullType(rootType) && graphql26.isListType(rootType.ofType)) {
|
|
73099
73112
|
needsParent = true;
|
|
73100
73113
|
break;
|
|
73101
73114
|
}
|
|
73102
|
-
if (
|
|
73115
|
+
if (graphql26.isNonNullType(rootType) && "ofType" in rootType) {
|
|
73103
73116
|
rootType = rootType.ofType;
|
|
73104
73117
|
}
|
|
73105
|
-
if (
|
|
73118
|
+
if (graphql26.isScalarType(rootType)) {
|
|
73106
73119
|
break;
|
|
73107
73120
|
}
|
|
73108
73121
|
rootType = rootType?.getFields()[parent2.name.value]?.type;
|
|
@@ -73178,9 +73191,9 @@ async function typeCheck(config4, docs) {
|
|
|
73178
73191
|
);
|
|
73179
73192
|
}
|
|
73180
73193
|
let targetTypes = [type];
|
|
73181
|
-
if (
|
|
73194
|
+
if (graphql26.isUnionType(type)) {
|
|
73182
73195
|
targetTypes = config4.schema.getPossibleTypes(type);
|
|
73183
|
-
} else if (
|
|
73196
|
+
} else if (graphql26.isInterfaceType(type)) {
|
|
73184
73197
|
try {
|
|
73185
73198
|
for (const key of config4.keyFieldsForType(type.name)) {
|
|
73186
73199
|
if (!type.getFields()[key]) {
|
|
@@ -73218,13 +73231,13 @@ async function typeCheck(config4, docs) {
|
|
|
73218
73231
|
if (errors.length > 0) {
|
|
73219
73232
|
throw errors;
|
|
73220
73233
|
}
|
|
73221
|
-
const rules = (filepath) => [...
|
|
73234
|
+
const rules = (filepath) => [...graphql26.specifiedRules].filter(
|
|
73222
73235
|
(rule) => ![
|
|
73223
|
-
|
|
73224
|
-
|
|
73225
|
-
|
|
73226
|
-
|
|
73227
|
-
|
|
73236
|
+
graphql26.NoUnusedFragmentsRule,
|
|
73237
|
+
graphql26.KnownFragmentNamesRule,
|
|
73238
|
+
graphql26.ExecutableDefinitionsRule,
|
|
73239
|
+
graphql26.KnownDirectivesRule,
|
|
73240
|
+
graphql26.KnownArgumentNamesRule
|
|
73228
73241
|
].includes(rule)
|
|
73229
73242
|
).concat(
|
|
73230
73243
|
validateLists({
|
|
@@ -73243,7 +73256,7 @@ async function typeCheck(config4, docs) {
|
|
|
73243
73256
|
noUnusedFragmentArguments(config4)
|
|
73244
73257
|
);
|
|
73245
73258
|
for (const { filename, document: parsed } of docs) {
|
|
73246
|
-
for (const error of
|
|
73259
|
+
for (const error of graphql26.validate(config4.schema, parsed, rules(filename))) {
|
|
73247
73260
|
errors.push(
|
|
73248
73261
|
new HoudiniError({
|
|
73249
73262
|
filepath: filename,
|
|
@@ -73269,7 +73282,7 @@ var validateLists = ({
|
|
|
73269
73282
|
if (!config4.isListFragment(node.name.value)) {
|
|
73270
73283
|
if (!fragments[node.name.value]) {
|
|
73271
73284
|
ctx.reportError(
|
|
73272
|
-
new
|
|
73285
|
+
new graphql26.GraphQLError(
|
|
73273
73286
|
"Encountered unknown fragment: " + node.name.value
|
|
73274
73287
|
)
|
|
73275
73288
|
);
|
|
@@ -73279,7 +73292,7 @@ var validateLists = ({
|
|
|
73279
73292
|
const listName = config4.listNameFromFragment(node.name.value);
|
|
73280
73293
|
if (!lists.includes(listName)) {
|
|
73281
73294
|
ctx.reportError(
|
|
73282
|
-
new
|
|
73295
|
+
new graphql26.GraphQLError(
|
|
73283
73296
|
"Encountered fragment referencing unknown list: " + listName
|
|
73284
73297
|
)
|
|
73285
73298
|
);
|
|
@@ -73304,7 +73317,7 @@ var validateLists = ({
|
|
|
73304
73317
|
);
|
|
73305
73318
|
if (parentArg) {
|
|
73306
73319
|
ctx.reportError(
|
|
73307
|
-
new
|
|
73320
|
+
new graphql26.GraphQLError(
|
|
73308
73321
|
`@${config4.deprecatedlistDirectiveParentIDArg} should be defined only in it's own directive now`
|
|
73309
73322
|
)
|
|
73310
73323
|
);
|
|
@@ -73320,7 +73333,7 @@ var validateLists = ({
|
|
|
73320
73333
|
return;
|
|
73321
73334
|
}
|
|
73322
73335
|
ctx.reportError(
|
|
73323
|
-
new
|
|
73336
|
+
new graphql26.GraphQLError(
|
|
73324
73337
|
`For this list fragment, you need to add or @${config4.listParentDirective} or @${config4.listAllListsDirective} directive to specify the behavior`
|
|
73325
73338
|
)
|
|
73326
73339
|
);
|
|
@@ -73330,7 +73343,7 @@ var validateLists = ({
|
|
|
73330
73343
|
const directiveName = node.name.value;
|
|
73331
73344
|
if (directiveName === "connection") {
|
|
73332
73345
|
ctx.reportError(
|
|
73333
|
-
new
|
|
73346
|
+
new graphql26.GraphQLError(
|
|
73334
73347
|
"@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."
|
|
73335
73348
|
)
|
|
73336
73349
|
);
|
|
@@ -73339,7 +73352,7 @@ var validateLists = ({
|
|
|
73339
73352
|
if (!config4.isInternalDirective(node)) {
|
|
73340
73353
|
if (!config4.schema.getDirective(directiveName)) {
|
|
73341
73354
|
ctx.reportError(
|
|
73342
|
-
new
|
|
73355
|
+
new graphql26.GraphQLError(
|
|
73343
73356
|
"Encountered unknown directive: " + directiveName
|
|
73344
73357
|
)
|
|
73345
73358
|
);
|
|
@@ -73348,7 +73361,7 @@ var validateLists = ({
|
|
|
73348
73361
|
}
|
|
73349
73362
|
if (config4.isListOperationDirective(directiveName) && !listTypes.includes(config4.listNameFromDirective(directiveName))) {
|
|
73350
73363
|
ctx.reportError(
|
|
73351
|
-
new
|
|
73364
|
+
new graphql26.GraphQLError(
|
|
73352
73365
|
"Encountered directive referencing unknown list: " + directiveName
|
|
73353
73366
|
)
|
|
73354
73367
|
);
|
|
@@ -73359,7 +73372,7 @@ var validateLists = ({
|
|
|
73359
73372
|
};
|
|
73360
73373
|
function knownArguments(config4) {
|
|
73361
73374
|
return function(ctx) {
|
|
73362
|
-
const nativeValidator =
|
|
73375
|
+
const nativeValidator = graphql26.KnownArgumentNamesRule(ctx);
|
|
73363
73376
|
return {
|
|
73364
73377
|
...nativeValidator,
|
|
73365
73378
|
Directive(directiveNode) {
|
|
@@ -73392,7 +73405,7 @@ function validateFragmentArguments(config4, filepath, fragments) {
|
|
|
73392
73405
|
for (const arg of node.arguments || []) {
|
|
73393
73406
|
if (arg.value.kind !== "ObjectValue") {
|
|
73394
73407
|
ctx.reportError(
|
|
73395
|
-
new
|
|
73408
|
+
new graphql26.GraphQLError("values in @arguments must be an object")
|
|
73396
73409
|
);
|
|
73397
73410
|
return;
|
|
73398
73411
|
}
|
|
@@ -73402,13 +73415,13 @@ function validateFragmentArguments(config4, filepath, fragments) {
|
|
|
73402
73415
|
);
|
|
73403
73416
|
if (!typeArg) {
|
|
73404
73417
|
ctx.reportError(
|
|
73405
|
-
new
|
|
73418
|
+
new graphql26.GraphQLError("missing type field for @arguments directive")
|
|
73406
73419
|
);
|
|
73407
73420
|
return;
|
|
73408
73421
|
}
|
|
73409
|
-
if (typeArg.value.kind !==
|
|
73422
|
+
if (typeArg.value.kind !== graphql26.Kind.STRING) {
|
|
73410
73423
|
ctx.reportError(
|
|
73411
|
-
new
|
|
73424
|
+
new graphql26.GraphQLError("type field to @arguments must be a string")
|
|
73412
73425
|
);
|
|
73413
73426
|
return;
|
|
73414
73427
|
}
|
|
@@ -73421,7 +73434,7 @@ function validateFragmentArguments(config4, filepath, fragments) {
|
|
|
73421
73434
|
);
|
|
73422
73435
|
if (typeArg.value.value !== defaultValueType) {
|
|
73423
73436
|
ctx.reportError(
|
|
73424
|
-
new
|
|
73437
|
+
new graphql26.GraphQLError(
|
|
73425
73438
|
`Invalid default value provided for ${arg.name.value}. Expected ${typeArg.value.value}, found ${defaultValueType}`
|
|
73426
73439
|
)
|
|
73427
73440
|
);
|
|
@@ -73439,7 +73452,7 @@ function validateFragmentArguments(config4, filepath, fragments) {
|
|
|
73439
73452
|
try {
|
|
73440
73453
|
args = fragmentArguments(config4, filepath, fragments[fragmentName]);
|
|
73441
73454
|
} catch (e2) {
|
|
73442
|
-
ctx.reportError(new
|
|
73455
|
+
ctx.reportError(new graphql26.GraphQLError(e2.message));
|
|
73443
73456
|
return;
|
|
73444
73457
|
}
|
|
73445
73458
|
fragmentArguments2[fragmentName] = args;
|
|
@@ -73462,7 +73475,7 @@ function validateFragmentArguments(config4, filepath, fragments) {
|
|
|
73462
73475
|
);
|
|
73463
73476
|
if (missing.length > 0) {
|
|
73464
73477
|
ctx.reportError(
|
|
73465
|
-
new
|
|
73478
|
+
new graphql26.GraphQLError(
|
|
73466
73479
|
"The following arguments are missing from this fragment: " + JSON.stringify(missing)
|
|
73467
73480
|
)
|
|
73468
73481
|
);
|
|
@@ -73473,7 +73486,7 @@ function validateFragmentArguments(config4, filepath, fragments) {
|
|
|
73473
73486
|
);
|
|
73474
73487
|
if (unknown.length > 0) {
|
|
73475
73488
|
ctx.reportError(
|
|
73476
|
-
new
|
|
73489
|
+
new graphql26.GraphQLError(
|
|
73477
73490
|
"Encountered unknown arguments: " + JSON.stringify(unknown)
|
|
73478
73491
|
)
|
|
73479
73492
|
);
|
|
@@ -73485,7 +73498,7 @@ function validateFragmentArguments(config4, filepath, fragments) {
|
|
|
73485
73498
|
]
|
|
73486
73499
|
);
|
|
73487
73500
|
for (const [applied, target] of zipped) {
|
|
73488
|
-
if (applied.value.kind ===
|
|
73501
|
+
if (applied.value.kind === graphql26.Kind.VARIABLE || applied.value.kind === graphql26.Kind.LIST || applied.value.kind === graphql26.Kind.OBJECT) {
|
|
73489
73502
|
continue;
|
|
73490
73503
|
}
|
|
73491
73504
|
const appliedType = applied.value.kind.substring(
|
|
@@ -73494,7 +73507,7 @@ function validateFragmentArguments(config4, filepath, fragments) {
|
|
|
73494
73507
|
);
|
|
73495
73508
|
if (appliedType !== target) {
|
|
73496
73509
|
ctx.reportError(
|
|
73497
|
-
new
|
|
73510
|
+
new graphql26.GraphQLError(
|
|
73498
73511
|
`Invalid argument type. Expected ${target}, found ${appliedType}`
|
|
73499
73512
|
)
|
|
73500
73513
|
);
|
|
@@ -73515,7 +73528,7 @@ function paginateArgs(config4, filepath) {
|
|
|
73515
73528
|
}
|
|
73516
73529
|
if (alreadyPaginated) {
|
|
73517
73530
|
ctx.reportError(
|
|
73518
|
-
new
|
|
73531
|
+
new graphql26.GraphQLError(
|
|
73519
73532
|
`@${config4.paginateDirective} can only appear in a document once.`
|
|
73520
73533
|
)
|
|
73521
73534
|
);
|
|
@@ -73530,7 +73543,7 @@ function paginateArgs(config4, filepath) {
|
|
|
73530
73543
|
const hasRequiredArgs = definitionArgs.find((arg) => arg.required);
|
|
73531
73544
|
if (hasRequiredArgs) {
|
|
73532
73545
|
ctx.reportError(
|
|
73533
|
-
new
|
|
73546
|
+
new graphql26.GraphQLError(
|
|
73534
73547
|
"@paginate cannot appear on a document with required args"
|
|
73535
73548
|
)
|
|
73536
73549
|
);
|
|
@@ -73562,14 +73575,14 @@ function paginateArgs(config4, filepath) {
|
|
|
73562
73575
|
const backwards = appliedArgs.has("last");
|
|
73563
73576
|
if (!forward && !backwards) {
|
|
73564
73577
|
ctx.reportError(
|
|
73565
|
-
new
|
|
73578
|
+
new graphql26.GraphQLError(
|
|
73566
73579
|
"A field with cursor-based pagination must have a first or last argument"
|
|
73567
73580
|
)
|
|
73568
73581
|
);
|
|
73569
73582
|
}
|
|
73570
73583
|
if (forward && backwards) {
|
|
73571
73584
|
ctx.reportError(
|
|
73572
|
-
new
|
|
73585
|
+
new graphql26.GraphQLError(
|
|
73573
73586
|
`A field with cursor pagination cannot go forwards an backwards simultaneously`
|
|
73574
73587
|
)
|
|
73575
73588
|
);
|
|
@@ -73583,7 +73596,7 @@ function paginateArgs(config4, filepath) {
|
|
|
73583
73596
|
);
|
|
73584
73597
|
if (!appliedLimitArg) {
|
|
73585
73598
|
ctx.reportError(
|
|
73586
|
-
new
|
|
73599
|
+
new graphql26.GraphQLError(
|
|
73587
73600
|
"A field with offset-based pagination must have a limit argument"
|
|
73588
73601
|
)
|
|
73589
73602
|
);
|
|
@@ -73599,20 +73612,20 @@ function noUnusedFragmentArguments(config4) {
|
|
|
73599
73612
|
const args = /* @__PURE__ */ new Set();
|
|
73600
73613
|
return {
|
|
73601
73614
|
enter(node) {
|
|
73602
|
-
if (node.kind ===
|
|
73615
|
+
if (node.kind === graphql26.Kind.FRAGMENT_DEFINITION) {
|
|
73603
73616
|
const definitionArguments = node.directives?.filter((directive) => directive.name.value === config4.argumentsDirective).flatMap((directive) => directive.arguments);
|
|
73604
73617
|
for (const arg of definitionArguments?.map((arg2) => arg2?.name.value) || []) {
|
|
73605
73618
|
args.add(arg);
|
|
73606
73619
|
}
|
|
73607
|
-
} else if (node.kind ===
|
|
73620
|
+
} else if (node.kind === graphql26.Kind.VARIABLE) {
|
|
73608
73621
|
args.delete(node.name.value);
|
|
73609
73622
|
}
|
|
73610
73623
|
},
|
|
73611
73624
|
leave(node) {
|
|
73612
|
-
if (node.kind ===
|
|
73625
|
+
if (node.kind === graphql26.Kind.FRAGMENT_DEFINITION) {
|
|
73613
73626
|
if (args.size > 0) {
|
|
73614
73627
|
ctx.reportError(
|
|
73615
|
-
new
|
|
73628
|
+
new graphql26.GraphQLError(
|
|
73616
73629
|
"Encountered unused fragment arguments: " + [...args].join(",")
|
|
73617
73630
|
)
|
|
73618
73631
|
);
|
|
@@ -73648,7 +73661,7 @@ function nodeDirectives(config4, directives) {
|
|
|
73648
73661
|
if (definition.kind === "OperationDefinition") {
|
|
73649
73662
|
if (definition.operation !== "query") {
|
|
73650
73663
|
ctx.reportError(
|
|
73651
|
-
new
|
|
73664
|
+
new graphql26.GraphQLError(
|
|
73652
73665
|
`@${node.name.value} must fall on a fragment or query document`
|
|
73653
73666
|
)
|
|
73654
73667
|
);
|
|
@@ -73660,7 +73673,7 @@ function nodeDirectives(config4, directives) {
|
|
|
73660
73673
|
}
|
|
73661
73674
|
if (!possibleNodes.includes(definitionType)) {
|
|
73662
73675
|
ctx.reportError(
|
|
73663
|
-
new
|
|
73676
|
+
new graphql26.GraphQLError(paginateOnNonNodeMessage(config4, node.name.value))
|
|
73664
73677
|
);
|
|
73665
73678
|
}
|
|
73666
73679
|
}
|
|
@@ -73679,7 +73692,7 @@ function checkMutationOperation(config4) {
|
|
|
73679
73692
|
);
|
|
73680
73693
|
if (append && prepend) {
|
|
73681
73694
|
ctx.reportError(
|
|
73682
|
-
new
|
|
73695
|
+
new graphql26.GraphQLError(
|
|
73683
73696
|
`You can't apply both @${config4.listPrependDirective} and @${config4.listAppendDirective} at the same time`
|
|
73684
73697
|
)
|
|
73685
73698
|
);
|
|
@@ -73693,7 +73706,7 @@ function checkMutationOperation(config4) {
|
|
|
73693
73706
|
);
|
|
73694
73707
|
if (parentId && allLists) {
|
|
73695
73708
|
ctx.reportError(
|
|
73696
|
-
new
|
|
73709
|
+
new graphql26.GraphQLError(
|
|
73697
73710
|
`You can't apply both @${config4.listParentDirective} and @${config4.listAllListsDirective} at the same time`
|
|
73698
73711
|
)
|
|
73699
73712
|
);
|
|
@@ -73715,7 +73728,7 @@ function checkMaskDirective(config4) {
|
|
|
73715
73728
|
);
|
|
73716
73729
|
if (maskEnableDirective && maskDisableDirective) {
|
|
73717
73730
|
ctx.reportError(
|
|
73718
|
-
new
|
|
73731
|
+
new graphql26.GraphQLError(
|
|
73719
73732
|
`You can't apply both @${config4.maskEnableDirective} and @${config4.maskDisableDirective} at the same time`
|
|
73720
73733
|
)
|
|
73721
73734
|
);
|
|
@@ -73731,7 +73744,7 @@ function getAndVerifyNodeInterface(config4) {
|
|
|
73731
73744
|
if (!nodeInterface) {
|
|
73732
73745
|
return null;
|
|
73733
73746
|
}
|
|
73734
|
-
if (!
|
|
73747
|
+
if (!graphql26.isInterfaceType(nodeInterface)) {
|
|
73735
73748
|
displayInvalidNodeFieldMessage(config4.logLevel);
|
|
73736
73749
|
return null;
|
|
73737
73750
|
}
|
|
@@ -73829,11 +73842,11 @@ async function uniqueDocumentNames(config4, docs) {
|
|
|
73829
73842
|
}
|
|
73830
73843
|
|
|
73831
73844
|
// src/codegen/validators/noIDAlias.ts
|
|
73832
|
-
var
|
|
73845
|
+
var graphql27 = __toESM(require_graphql2(), 1);
|
|
73833
73846
|
async function noIDAlias(config4, docs) {
|
|
73834
73847
|
const errors = [];
|
|
73835
73848
|
for (const { filename, document } of docs) {
|
|
73836
|
-
|
|
73849
|
+
graphql27.visit(document, {
|
|
73837
73850
|
Field(node, _, __, ___, ancestors) {
|
|
73838
73851
|
const fieldType = parentTypeFromAncestors(config4.schema, filename, ancestors).name;
|
|
73839
73852
|
if (config4.keyFieldsForType(fieldType).includes(node.alias?.value || "")) {
|
|
@@ -74031,12 +74044,12 @@ async function processJSFile(config4, contents) {
|
|
|
74031
74044
|
return documents;
|
|
74032
74045
|
}
|
|
74033
74046
|
async function processGraphQLDocument(config4, filepath, document) {
|
|
74034
|
-
const parsedDoc =
|
|
74047
|
+
const parsedDoc = graphql28.parse(document);
|
|
74035
74048
|
const operations = parsedDoc.definitions.filter(
|
|
74036
|
-
({ kind: kind2 }) => kind2 ===
|
|
74049
|
+
({ kind: kind2 }) => kind2 === graphql28.Kind.OPERATION_DEFINITION
|
|
74037
74050
|
);
|
|
74038
74051
|
const fragments = parsedDoc.definitions.filter(
|
|
74039
|
-
({ kind: kind2 }) => kind2 ===
|
|
74052
|
+
({ kind: kind2 }) => kind2 === graphql28.Kind.FRAGMENT_DEFINITION
|
|
74040
74053
|
);
|
|
74041
74054
|
if (operations.length > 1) {
|
|
74042
74055
|
throw new HoudiniError({
|