houdini 0.19.3 → 1.0.0-next.0
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 +326 -313
- package/build/cmd-esm/index.js +326 -313
- 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 -313
- package/build/vite-esm/index.js +324 -313
- package/package.json +1 -1
- package/build/codegen/utils/graphql.d.ts +0 -15
package/build/test-cjs/index.js
CHANGED
|
@@ -9754,7 +9754,7 @@ var require_graphql = __commonJS({
|
|
|
9754
9754
|
Object.defineProperty(exports, "__esModule", {
|
|
9755
9755
|
value: true
|
|
9756
9756
|
});
|
|
9757
|
-
exports.graphql =
|
|
9757
|
+
exports.graphql = graphql27;
|
|
9758
9758
|
exports.graphqlSync = graphqlSync;
|
|
9759
9759
|
var _isPromise = _interopRequireDefault(require_isPromise());
|
|
9760
9760
|
var _parser = require_parser();
|
|
@@ -9764,7 +9764,7 @@ var require_graphql = __commonJS({
|
|
|
9764
9764
|
function _interopRequireDefault(obj) {
|
|
9765
9765
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
9766
9766
|
}
|
|
9767
|
-
function
|
|
9767
|
+
function graphql27(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) {
|
|
9768
9768
|
var _arguments = arguments;
|
|
9769
9769
|
return new Promise(function(resolve2) {
|
|
9770
9770
|
return resolve2(
|
|
@@ -18212,9 +18212,9 @@ var require_lib = __commonJS({
|
|
|
18212
18212
|
}
|
|
18213
18213
|
});
|
|
18214
18214
|
|
|
18215
|
-
// ../../node_modules/.pnpm/minimatch@5.1.
|
|
18215
|
+
// ../../node_modules/.pnpm/minimatch@5.1.2/node_modules/minimatch/lib/path.js
|
|
18216
18216
|
var require_path = __commonJS({
|
|
18217
|
-
"../../node_modules/.pnpm/minimatch@5.1.
|
|
18217
|
+
"../../node_modules/.pnpm/minimatch@5.1.2/node_modules/minimatch/lib/path.js"(exports, module2) {
|
|
18218
18218
|
var isWindows = typeof process === "object" && process && process.platform === "win32";
|
|
18219
18219
|
module2.exports = isWindows ? { sep: "\\" } : { sep: "/" };
|
|
18220
18220
|
}
|
|
@@ -18431,9 +18431,9 @@ var require_brace_expansion = __commonJS({
|
|
|
18431
18431
|
}
|
|
18432
18432
|
});
|
|
18433
18433
|
|
|
18434
|
-
// ../../node_modules/.pnpm/minimatch@5.1.
|
|
18434
|
+
// ../../node_modules/.pnpm/minimatch@5.1.2/node_modules/minimatch/minimatch.js
|
|
18435
18435
|
var require_minimatch = __commonJS({
|
|
18436
|
-
"../../node_modules/.pnpm/minimatch@5.1.
|
|
18436
|
+
"../../node_modules/.pnpm/minimatch@5.1.2/node_modules/minimatch/minimatch.js"(exports, module2) {
|
|
18437
18437
|
var minimatch2 = module2.exports = (p, pattern, options = {}) => {
|
|
18438
18438
|
assertValidPattern(pattern);
|
|
18439
18439
|
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
@@ -18519,7 +18519,9 @@ var require_minimatch = __commonJS({
|
|
|
18519
18519
|
return list;
|
|
18520
18520
|
};
|
|
18521
18521
|
var globUnescape = (s) => s.replace(/\\(.)/g, "$1");
|
|
18522
|
+
var charUnescape = (s) => s.replace(/\\([^-\]])/g, "$1");
|
|
18522
18523
|
var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
18524
|
+
var braExpEscape = (s) => s.replace(/[[\]\\]/g, "\\$&");
|
|
18523
18525
|
var Minimatch = class {
|
|
18524
18526
|
constructor(pattern, options) {
|
|
18525
18527
|
assertValidPattern(pattern);
|
|
@@ -18711,6 +18713,10 @@ var require_minimatch = __commonJS({
|
|
|
18711
18713
|
return false;
|
|
18712
18714
|
}
|
|
18713
18715
|
case "\\":
|
|
18716
|
+
if (inClass && pattern.charAt(i + 1) === "-") {
|
|
18717
|
+
re += c;
|
|
18718
|
+
continue;
|
|
18719
|
+
}
|
|
18714
18720
|
clearStateChar();
|
|
18715
18721
|
escaping = true;
|
|
18716
18722
|
continue;
|
|
@@ -18793,17 +18799,13 @@ var require_minimatch = __commonJS({
|
|
|
18793
18799
|
}
|
|
18794
18800
|
cs = pattern.substring(classStart + 1, i);
|
|
18795
18801
|
try {
|
|
18796
|
-
RegExp("[" + cs + "]");
|
|
18802
|
+
RegExp("[" + braExpEscape(charUnescape(cs)) + "]");
|
|
18803
|
+
re += c;
|
|
18797
18804
|
} catch (er) {
|
|
18798
|
-
|
|
18799
|
-
re = re.substring(0, reClassStart) + "\\[" + sp[0] + "\\]";
|
|
18800
|
-
hasMagic = hasMagic || sp[1];
|
|
18801
|
-
inClass = false;
|
|
18802
|
-
continue;
|
|
18805
|
+
re = re.substring(0, reClassStart) + "(?:$.)";
|
|
18803
18806
|
}
|
|
18804
18807
|
hasMagic = true;
|
|
18805
18808
|
inClass = false;
|
|
18806
|
-
re += c;
|
|
18807
18809
|
continue;
|
|
18808
18810
|
default:
|
|
18809
18811
|
clearStateChar();
|
|
@@ -23127,9 +23129,9 @@ var require_glob = __commonJS({
|
|
|
23127
23129
|
}
|
|
23128
23130
|
});
|
|
23129
23131
|
|
|
23130
|
-
// ../../node_modules/.pnpm/@babel+parser@7.20.
|
|
23132
|
+
// ../../node_modules/.pnpm/@babel+parser@7.20.7/node_modules/@babel/parser/lib/index.js
|
|
23131
23133
|
var require_lib3 = __commonJS({
|
|
23132
|
-
"../../node_modules/.pnpm/@babel+parser@7.20.
|
|
23134
|
+
"../../node_modules/.pnpm/@babel+parser@7.20.7/node_modules/@babel/parser/lib/index.js"(exports) {
|
|
23133
23135
|
"use strict";
|
|
23134
23136
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23135
23137
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
@@ -23245,9 +23247,9 @@ var require_lib3 = __commonJS({
|
|
|
23245
23247
|
AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.",
|
|
23246
23248
|
AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.",
|
|
23247
23249
|
AwaitNotInAsyncFunction: "'await' is only allowed within async functions.",
|
|
23248
|
-
BadGetterArity: "A 'get'
|
|
23249
|
-
BadSetterArity: "A 'set'
|
|
23250
|
-
BadSetterRestParameter: "A 'set'
|
|
23250
|
+
BadGetterArity: "A 'get' accessor must not have any formal parameters.",
|
|
23251
|
+
BadSetterArity: "A 'set' accessor must have exactly one formal parameter.",
|
|
23252
|
+
BadSetterRestParameter: "A 'set' accessor function argument must not be a rest parameter.",
|
|
23251
23253
|
ConstructorClassField: "Classes may not have a field named 'constructor'.",
|
|
23252
23254
|
ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.",
|
|
23253
23255
|
ConstructorIsAccessor: "Class constructor may not be an accessor.",
|
|
@@ -26681,7 +26683,7 @@ var require_lib3 = __commonJS({
|
|
|
26681
26683
|
}
|
|
26682
26684
|
this.parser.raise(toParseError, origin);
|
|
26683
26685
|
}
|
|
26684
|
-
|
|
26686
|
+
recordArrowParameterBindingError(error, {
|
|
26685
26687
|
at: node
|
|
26686
26688
|
}) {
|
|
26687
26689
|
const {
|
|
@@ -30440,6 +30442,7 @@ var require_lib3 = __commonJS({
|
|
|
30440
30442
|
}) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`,
|
|
30441
30443
|
AccesorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.",
|
|
30442
30444
|
AccesorCannotHaveTypeParameters: "An accessor cannot have type parameters.",
|
|
30445
|
+
AccessorCannotBeOptional: "An 'accessor' property cannot be declared optional.",
|
|
30443
30446
|
ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.",
|
|
30444
30447
|
ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.",
|
|
30445
30448
|
ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",
|
|
@@ -32402,8 +32405,12 @@ var require_lib3 = __commonJS({
|
|
|
32402
32405
|
node.typeParameters = typeParameters;
|
|
32403
32406
|
}
|
|
32404
32407
|
parseClassPropertyAnnotation(node) {
|
|
32405
|
-
if (!node.optional
|
|
32406
|
-
|
|
32408
|
+
if (!node.optional) {
|
|
32409
|
+
if (this.eat(35)) {
|
|
32410
|
+
node.definite = true;
|
|
32411
|
+
} else if (this.eat(17)) {
|
|
32412
|
+
node.optional = true;
|
|
32413
|
+
}
|
|
32407
32414
|
}
|
|
32408
32415
|
const type = this.tsTryParseTypeAnnotation();
|
|
32409
32416
|
if (type)
|
|
@@ -32442,6 +32449,15 @@ var require_lib3 = __commonJS({
|
|
|
32442
32449
|
this.parseClassPropertyAnnotation(node);
|
|
32443
32450
|
return super.parseClassPrivateProperty(node);
|
|
32444
32451
|
}
|
|
32452
|
+
parseClassAccessorProperty(node) {
|
|
32453
|
+
this.parseClassPropertyAnnotation(node);
|
|
32454
|
+
if (node.optional) {
|
|
32455
|
+
this.raise(TSErrors.AccessorCannotBeOptional, {
|
|
32456
|
+
at: node
|
|
32457
|
+
});
|
|
32458
|
+
}
|
|
32459
|
+
return super.parseClassAccessorProperty(node);
|
|
32460
|
+
}
|
|
32445
32461
|
pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
|
|
32446
32462
|
const typeParameters = this.tsTryParseTypeParameters();
|
|
32447
32463
|
if (typeParameters && isConstructor) {
|
|
@@ -32652,7 +32668,7 @@ var require_lib3 = __commonJS({
|
|
|
32652
32668
|
case "TSNonNullExpression":
|
|
32653
32669
|
case "TSTypeAssertion":
|
|
32654
32670
|
if (isLHS) {
|
|
32655
|
-
this.expressionScope.
|
|
32671
|
+
this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter, {
|
|
32656
32672
|
at: node
|
|
32657
32673
|
});
|
|
32658
32674
|
} else {
|
|
@@ -33359,7 +33375,7 @@ var require_lib3 = __commonJS({
|
|
|
33359
33375
|
parenthesized = unwrapParenthesizedExpression(node);
|
|
33360
33376
|
if (isLHS) {
|
|
33361
33377
|
if (parenthesized.type === "Identifier") {
|
|
33362
|
-
this.expressionScope.
|
|
33378
|
+
this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment, {
|
|
33363
33379
|
at: node
|
|
33364
33380
|
});
|
|
33365
33381
|
} else if (parenthesized.type !== "MemberExpression") {
|
|
@@ -53926,7 +53942,7 @@ __export(test_exports, {
|
|
|
53926
53942
|
testConfigFile: () => testConfigFile
|
|
53927
53943
|
});
|
|
53928
53944
|
module.exports = __toCommonJS(test_exports);
|
|
53929
|
-
var
|
|
53945
|
+
var graphql26 = __toESM(require_graphql2(), 1);
|
|
53930
53946
|
var import_memfs2 = __toESM(require_lib(), 1);
|
|
53931
53947
|
|
|
53932
53948
|
// src/lib/pipeline.ts
|
|
@@ -56571,6 +56587,60 @@ function definitionFromAncestors(ancestors) {
|
|
|
56571
56587
|
}
|
|
56572
56588
|
return definition;
|
|
56573
56589
|
}
|
|
56590
|
+
function unwrapType(config2, type, wrappers = []) {
|
|
56591
|
+
if (type.kind === "NonNullType") {
|
|
56592
|
+
return unwrapType(config2, type.type, [TypeWrapper.NonNull, ...wrappers]);
|
|
56593
|
+
}
|
|
56594
|
+
if (type instanceof graphql2.GraphQLNonNull) {
|
|
56595
|
+
return unwrapType(config2, type.ofType, [TypeWrapper.NonNull, ...wrappers]);
|
|
56596
|
+
}
|
|
56597
|
+
if (wrappers[0] !== TypeWrapper.NonNull) {
|
|
56598
|
+
wrappers.unshift(TypeWrapper.Nullable);
|
|
56599
|
+
}
|
|
56600
|
+
if (type.kind === "ListType") {
|
|
56601
|
+
return unwrapType(config2, type.type, [TypeWrapper.List, ...wrappers]);
|
|
56602
|
+
}
|
|
56603
|
+
if (type instanceof graphql2.GraphQLList) {
|
|
56604
|
+
return unwrapType(config2, type.ofType, [TypeWrapper.List, ...wrappers]);
|
|
56605
|
+
}
|
|
56606
|
+
const namedType = config2.schema.getType(type.name.value || type.name);
|
|
56607
|
+
if (!namedType) {
|
|
56608
|
+
throw new Error("Could not unwrap type: " + JSON.stringify(type));
|
|
56609
|
+
}
|
|
56610
|
+
return { type: namedType, wrappers };
|
|
56611
|
+
}
|
|
56612
|
+
function wrapType({
|
|
56613
|
+
type,
|
|
56614
|
+
wrappers
|
|
56615
|
+
}) {
|
|
56616
|
+
const head = wrappers[0];
|
|
56617
|
+
const tail = wrappers.slice(1);
|
|
56618
|
+
let kind = graphql2.Kind.NAMED_TYPE;
|
|
56619
|
+
if (head === TypeWrapper.List) {
|
|
56620
|
+
kind = graphql2.Kind.LIST_TYPE;
|
|
56621
|
+
} else if (head === TypeWrapper.NonNull) {
|
|
56622
|
+
kind = graphql2.Kind.NON_NULL_TYPE;
|
|
56623
|
+
}
|
|
56624
|
+
if (kind === "NamedType") {
|
|
56625
|
+
return {
|
|
56626
|
+
kind,
|
|
56627
|
+
name: {
|
|
56628
|
+
kind: graphql2.Kind.NAME,
|
|
56629
|
+
value: type.name
|
|
56630
|
+
}
|
|
56631
|
+
};
|
|
56632
|
+
}
|
|
56633
|
+
return {
|
|
56634
|
+
kind,
|
|
56635
|
+
type: wrapType({ type, wrappers: tail })
|
|
56636
|
+
};
|
|
56637
|
+
}
|
|
56638
|
+
var TypeWrapper = /* @__PURE__ */ ((TypeWrapper2) => {
|
|
56639
|
+
TypeWrapper2["Nullable"] = "Nullable";
|
|
56640
|
+
TypeWrapper2["List"] = "List";
|
|
56641
|
+
TypeWrapper2["NonNull"] = "NonNull";
|
|
56642
|
+
return TypeWrapper2;
|
|
56643
|
+
})(TypeWrapper || {});
|
|
56574
56644
|
|
|
56575
56645
|
// src/lib/parse.ts
|
|
56576
56646
|
var import_parser = __toESM(require_lib3(), 1);
|
|
@@ -56631,7 +56701,7 @@ async function cleanupFiles(pathFolder, listOfObj) {
|
|
|
56631
56701
|
}
|
|
56632
56702
|
|
|
56633
56703
|
// src/codegen/generators/artifacts/index.ts
|
|
56634
|
-
var
|
|
56704
|
+
var graphql11 = __toESM(require_graphql2(), 1);
|
|
56635
56705
|
var recast5 = __toESM(require_main2(), 1);
|
|
56636
56706
|
|
|
56637
56707
|
// src/codegen/utils/commonjs.ts
|
|
@@ -56807,63 +56877,6 @@ var FieldCollection = class {
|
|
|
56807
56877
|
}
|
|
56808
56878
|
};
|
|
56809
56879
|
|
|
56810
|
-
// src/codegen/utils/graphql.ts
|
|
56811
|
-
var graphql3 = __toESM(require_graphql2(), 1);
|
|
56812
|
-
function unwrapType(config2, type, wrappers = []) {
|
|
56813
|
-
if (type.kind === "NonNullType") {
|
|
56814
|
-
return unwrapType(config2, type.type, [TypeWrapper.NonNull, ...wrappers]);
|
|
56815
|
-
}
|
|
56816
|
-
if (type instanceof graphql3.GraphQLNonNull) {
|
|
56817
|
-
return unwrapType(config2, type.ofType, [TypeWrapper.NonNull, ...wrappers]);
|
|
56818
|
-
}
|
|
56819
|
-
if (wrappers[0] !== TypeWrapper.NonNull) {
|
|
56820
|
-
wrappers.unshift(TypeWrapper.Nullable);
|
|
56821
|
-
}
|
|
56822
|
-
if (type.kind === "ListType") {
|
|
56823
|
-
return unwrapType(config2, type.type, [TypeWrapper.List, ...wrappers]);
|
|
56824
|
-
}
|
|
56825
|
-
if (type instanceof graphql3.GraphQLList) {
|
|
56826
|
-
return unwrapType(config2, type.ofType, [TypeWrapper.List, ...wrappers]);
|
|
56827
|
-
}
|
|
56828
|
-
const namedType = config2.schema.getType(type.name.value || type.name);
|
|
56829
|
-
if (!namedType) {
|
|
56830
|
-
throw new Error("Could not unwrap type: " + JSON.stringify(type));
|
|
56831
|
-
}
|
|
56832
|
-
return { type: namedType, wrappers };
|
|
56833
|
-
}
|
|
56834
|
-
function wrapType({
|
|
56835
|
-
type,
|
|
56836
|
-
wrappers
|
|
56837
|
-
}) {
|
|
56838
|
-
const head = wrappers[0];
|
|
56839
|
-
const tail = wrappers.slice(1);
|
|
56840
|
-
let kind = graphql3.Kind.NAMED_TYPE;
|
|
56841
|
-
if (head === TypeWrapper.List) {
|
|
56842
|
-
kind = graphql3.Kind.LIST_TYPE;
|
|
56843
|
-
} else if (head === TypeWrapper.NonNull) {
|
|
56844
|
-
kind = graphql3.Kind.NON_NULL_TYPE;
|
|
56845
|
-
}
|
|
56846
|
-
if (kind === "NamedType") {
|
|
56847
|
-
return {
|
|
56848
|
-
kind,
|
|
56849
|
-
name: {
|
|
56850
|
-
kind: graphql3.Kind.NAME,
|
|
56851
|
-
value: type.name
|
|
56852
|
-
}
|
|
56853
|
-
};
|
|
56854
|
-
}
|
|
56855
|
-
return {
|
|
56856
|
-
kind,
|
|
56857
|
-
type: wrapType({ type, wrappers: tail })
|
|
56858
|
-
};
|
|
56859
|
-
}
|
|
56860
|
-
var TypeWrapper = /* @__PURE__ */ ((TypeWrapper2) => {
|
|
56861
|
-
TypeWrapper2["Nullable"] = "Nullable";
|
|
56862
|
-
TypeWrapper2["List"] = "List";
|
|
56863
|
-
TypeWrapper2["NonNull"] = "NonNull";
|
|
56864
|
-
return TypeWrapper2;
|
|
56865
|
-
})(TypeWrapper || {});
|
|
56866
|
-
|
|
56867
56880
|
// src/codegen/utils/moduleExport.ts
|
|
56868
56881
|
var recast2 = __toESM(require_main2(), 1);
|
|
56869
56882
|
var AST2 = recast2.types.builders;
|
|
@@ -56950,7 +56963,7 @@ ${exportDefaultFrom(`./${doc.name}`, doc.name)}`,
|
|
|
56950
56963
|
}
|
|
56951
56964
|
|
|
56952
56965
|
// src/codegen/generators/artifacts/inputs.ts
|
|
56953
|
-
var
|
|
56966
|
+
var graphql3 = __toESM(require_graphql2(), 1);
|
|
56954
56967
|
var recast3 = __toESM(require_main2(), 1);
|
|
56955
56968
|
var AST3 = recast3.types.builders;
|
|
56956
56969
|
function inputObject(config2, inputs) {
|
|
@@ -56975,10 +56988,10 @@ function walkInputs(config2, visitedTypes, inputObj, rootType) {
|
|
|
56975
56988
|
if (visitedTypes.has(type.name)) {
|
|
56976
56989
|
return;
|
|
56977
56990
|
}
|
|
56978
|
-
if (
|
|
56991
|
+
if (graphql3.isEnumType(type) || graphql3.isScalarType(type)) {
|
|
56979
56992
|
return;
|
|
56980
56993
|
}
|
|
56981
|
-
if (
|
|
56994
|
+
if (graphql3.isUnionType(type)) {
|
|
56982
56995
|
return;
|
|
56983
56996
|
}
|
|
56984
56997
|
visitedTypes.add(type.name);
|
|
@@ -56996,10 +57009,10 @@ function walkInputs(config2, visitedTypes, inputObj, rootType) {
|
|
|
56996
57009
|
}
|
|
56997
57010
|
|
|
56998
57011
|
// src/codegen/generators/artifacts/operations.ts
|
|
56999
|
-
var
|
|
57012
|
+
var graphql5 = __toESM(require_graphql2(), 1);
|
|
57000
57013
|
|
|
57001
57014
|
// src/codegen/generators/artifacts/utils.ts
|
|
57002
|
-
var
|
|
57015
|
+
var graphql4 = __toESM(require_graphql2(), 1);
|
|
57003
57016
|
var recast4 = __toESM(require_main2(), 1);
|
|
57004
57017
|
var AST4 = recast4.types.builders;
|
|
57005
57018
|
function serializeValue(value) {
|
|
@@ -57051,19 +57064,19 @@ function deepMerge(filepath, ...targets) {
|
|
|
57051
57064
|
function convertValue(config2, val) {
|
|
57052
57065
|
let value;
|
|
57053
57066
|
let kind;
|
|
57054
|
-
if (val.kind ===
|
|
57067
|
+
if (val.kind === graphql4.Kind.INT) {
|
|
57055
57068
|
value = parseInt(val.value, 10);
|
|
57056
57069
|
kind = "Int";
|
|
57057
|
-
} else if (val.kind ===
|
|
57070
|
+
} else if (val.kind === graphql4.Kind.FLOAT) {
|
|
57058
57071
|
value = parseFloat(val.value);
|
|
57059
57072
|
kind = "Float";
|
|
57060
|
-
} else if (val.kind ===
|
|
57073
|
+
} else if (val.kind === graphql4.Kind.BOOLEAN) {
|
|
57061
57074
|
value = val.value;
|
|
57062
57075
|
kind = "Boolean";
|
|
57063
|
-
} else if (val.kind ===
|
|
57076
|
+
} else if (val.kind === graphql4.Kind.VARIABLE) {
|
|
57064
57077
|
value = val.name.value;
|
|
57065
57078
|
kind = "Variable";
|
|
57066
|
-
} else if (val.kind ===
|
|
57079
|
+
} else if (val.kind === graphql4.Kind.STRING) {
|
|
57067
57080
|
value = val.value;
|
|
57068
57081
|
kind = "String";
|
|
57069
57082
|
}
|
|
@@ -57076,7 +57089,7 @@ function operationsByPath(config2, filepath, definition, filterTypes) {
|
|
|
57076
57089
|
return {};
|
|
57077
57090
|
}
|
|
57078
57091
|
const pathOperations = {};
|
|
57079
|
-
|
|
57092
|
+
graphql5.visit(definition, {
|
|
57080
57093
|
FragmentSpread(node, _, __, ___, ancestors) {
|
|
57081
57094
|
if (!config2.isListFragment(node.name.value)) {
|
|
57082
57095
|
return;
|
|
@@ -57235,7 +57248,7 @@ function ancestorKey(ancestors) {
|
|
|
57235
57248
|
}
|
|
57236
57249
|
|
|
57237
57250
|
// src/codegen/generators/artifacts/selection.ts
|
|
57238
|
-
var
|
|
57251
|
+
var graphql10 = __toESM(require_graphql2(), 1);
|
|
57239
57252
|
|
|
57240
57253
|
// ../../node_modules/.pnpm/@kitql+helper@0.5.0/node_modules/@kitql/helper/index.mjs
|
|
57241
57254
|
var config = {
|
|
@@ -57275,16 +57288,16 @@ function logYellow(str) {
|
|
|
57275
57288
|
}
|
|
57276
57289
|
|
|
57277
57290
|
// src/codegen/transforms/list.ts
|
|
57278
|
-
var
|
|
57291
|
+
var graphql8 = __toESM(require_graphql2(), 1);
|
|
57279
57292
|
|
|
57280
57293
|
// src/codegen/utils/objectIdentificationSelection.ts
|
|
57281
|
-
var
|
|
57294
|
+
var graphql6 = __toESM(require_graphql2(), 1);
|
|
57282
57295
|
var objectIdentificationSelection = (config2, type) => {
|
|
57283
57296
|
return config2.keyFieldsForType(type.name).map((key) => {
|
|
57284
57297
|
return {
|
|
57285
|
-
kind:
|
|
57298
|
+
kind: graphql6.Kind.FIELD,
|
|
57286
57299
|
name: {
|
|
57287
|
-
kind:
|
|
57300
|
+
kind: graphql6.Kind.NAME,
|
|
57288
57301
|
value: key
|
|
57289
57302
|
}
|
|
57290
57303
|
};
|
|
@@ -57292,7 +57305,7 @@ var objectIdentificationSelection = (config2, type) => {
|
|
|
57292
57305
|
};
|
|
57293
57306
|
|
|
57294
57307
|
// src/codegen/transforms/paginate.ts
|
|
57295
|
-
var
|
|
57308
|
+
var graphql7 = __toESM(require_graphql2(), 1);
|
|
57296
57309
|
async function paginate(config2, documents) {
|
|
57297
57310
|
const newDocs = [];
|
|
57298
57311
|
for (const doc of documents) {
|
|
@@ -57325,7 +57338,7 @@ async function paginate(config2, documents) {
|
|
|
57325
57338
|
};
|
|
57326
57339
|
let cursorType = "String";
|
|
57327
57340
|
let paginationPath = [];
|
|
57328
|
-
doc.document =
|
|
57341
|
+
doc.document = graphql7.visit(doc.document, {
|
|
57329
57342
|
Field(node, _, __, ___, ancestors) {
|
|
57330
57343
|
const paginateDirective = node.directives?.find(
|
|
57331
57344
|
(directive) => directive.name.value === config2.paginateDirective
|
|
@@ -57352,7 +57365,7 @@ async function paginate(config2, documents) {
|
|
|
57352
57365
|
flags.offset.enabled = offsetPagination;
|
|
57353
57366
|
flags.limit.enabled = offsetPagination;
|
|
57354
57367
|
paginationPath = ancestors.filter(
|
|
57355
|
-
(ancestor) => !Array.isArray(ancestor) && ancestor.kind ===
|
|
57368
|
+
(ancestor) => !Array.isArray(ancestor) && ancestor.kind === graphql7.Kind.FIELD
|
|
57356
57369
|
).concat(node).map((field) => field.alias?.value || field.name.value);
|
|
57357
57370
|
return {
|
|
57358
57371
|
...node,
|
|
@@ -57373,7 +57386,7 @@ async function paginate(config2, documents) {
|
|
|
57373
57386
|
refetchUpdate = "prepend" /* prepend */;
|
|
57374
57387
|
}
|
|
57375
57388
|
let fragment = "";
|
|
57376
|
-
doc.document =
|
|
57389
|
+
doc.document = graphql7.visit(doc.document, {
|
|
57377
57390
|
OperationDefinition(node) {
|
|
57378
57391
|
if (node.operation !== "query") {
|
|
57379
57392
|
throw new HoudiniError({
|
|
@@ -57427,9 +57440,9 @@ async function paginate(config2, documents) {
|
|
|
57427
57440
|
directives: [
|
|
57428
57441
|
...node.directives || [],
|
|
57429
57442
|
{
|
|
57430
|
-
kind:
|
|
57443
|
+
kind: graphql7.Kind.DIRECTIVE,
|
|
57431
57444
|
name: {
|
|
57432
|
-
kind:
|
|
57445
|
+
kind: graphql7.Kind.NAME,
|
|
57433
57446
|
value: config2.argumentsDirective
|
|
57434
57447
|
}
|
|
57435
57448
|
}
|
|
@@ -57492,16 +57505,16 @@ async function paginate(config2, documents) {
|
|
|
57492
57505
|
const paginationArgs = Object.entries(flags).filter(([_, { enabled }]) => enabled).map(([key, value]) => ({ name: key, ...value }));
|
|
57493
57506
|
const fragmentSpreadSelection = [
|
|
57494
57507
|
{
|
|
57495
|
-
kind:
|
|
57508
|
+
kind: graphql7.Kind.FRAGMENT_SPREAD,
|
|
57496
57509
|
name: {
|
|
57497
|
-
kind:
|
|
57510
|
+
kind: graphql7.Kind.NAME,
|
|
57498
57511
|
value: fragmentName
|
|
57499
57512
|
},
|
|
57500
57513
|
directives: [
|
|
57501
57514
|
{
|
|
57502
|
-
kind:
|
|
57515
|
+
kind: graphql7.Kind.DIRECTIVE,
|
|
57503
57516
|
name: {
|
|
57504
|
-
kind:
|
|
57517
|
+
kind: graphql7.Kind.NAME,
|
|
57505
57518
|
value: config2.withDirective
|
|
57506
57519
|
},
|
|
57507
57520
|
["arguments"]: paginationArgs.map(
|
|
@@ -57529,29 +57542,29 @@ async function paginate(config2, documents) {
|
|
|
57529
57542
|
});
|
|
57530
57543
|
const typeConfig = config2.typeConfig?.[fragment];
|
|
57531
57544
|
const queryDoc = {
|
|
57532
|
-
kind:
|
|
57545
|
+
kind: graphql7.Kind.DOCUMENT,
|
|
57533
57546
|
definitions: [
|
|
57534
57547
|
{
|
|
57535
|
-
kind:
|
|
57548
|
+
kind: graphql7.Kind.OPERATION_DEFINITION,
|
|
57536
57549
|
name: {
|
|
57537
|
-
kind:
|
|
57550
|
+
kind: graphql7.Kind.NAME,
|
|
57538
57551
|
value: refetchQueryName
|
|
57539
57552
|
},
|
|
57540
57553
|
operation: "query",
|
|
57541
57554
|
variableDefinitions: paginationArgs.map(
|
|
57542
57555
|
(arg) => ({
|
|
57543
|
-
kind:
|
|
57556
|
+
kind: graphql7.Kind.VARIABLE_DEFINITION,
|
|
57544
57557
|
type: {
|
|
57545
|
-
kind:
|
|
57558
|
+
kind: graphql7.Kind.NAMED_TYPE,
|
|
57546
57559
|
name: {
|
|
57547
|
-
kind:
|
|
57560
|
+
kind: graphql7.Kind.NAME,
|
|
57548
57561
|
value: arg.type
|
|
57549
57562
|
}
|
|
57550
57563
|
},
|
|
57551
57564
|
variable: {
|
|
57552
|
-
kind:
|
|
57565
|
+
kind: graphql7.Kind.VARIABLE,
|
|
57553
57566
|
name: {
|
|
57554
|
-
kind:
|
|
57567
|
+
kind: graphql7.Kind.NAME,
|
|
57555
57568
|
value: arg.name
|
|
57556
57569
|
}
|
|
57557
57570
|
},
|
|
@@ -57563,12 +57576,12 @@ async function paginate(config2, documents) {
|
|
|
57563
57576
|
).concat(
|
|
57564
57577
|
!nodeQuery ? [] : keys.map(
|
|
57565
57578
|
(key) => ({
|
|
57566
|
-
kind:
|
|
57579
|
+
kind: graphql7.Kind.VARIABLE_DEFINITION,
|
|
57567
57580
|
type: key.type,
|
|
57568
57581
|
variable: {
|
|
57569
|
-
kind:
|
|
57582
|
+
kind: graphql7.Kind.VARIABLE,
|
|
57570
57583
|
name: {
|
|
57571
|
-
kind:
|
|
57584
|
+
kind: graphql7.Kind.NAME,
|
|
57572
57585
|
value: key.name
|
|
57573
57586
|
}
|
|
57574
57587
|
}
|
|
@@ -57576,42 +57589,42 @@ async function paginate(config2, documents) {
|
|
|
57576
57589
|
)
|
|
57577
57590
|
),
|
|
57578
57591
|
selectionSet: {
|
|
57579
|
-
kind:
|
|
57592
|
+
kind: graphql7.Kind.SELECTION_SET,
|
|
57580
57593
|
selections: !nodeQuery ? fragmentSpreadSelection : [
|
|
57581
57594
|
{
|
|
57582
|
-
kind:
|
|
57595
|
+
kind: graphql7.Kind.FIELD,
|
|
57583
57596
|
name: {
|
|
57584
|
-
kind:
|
|
57597
|
+
kind: graphql7.Kind.NAME,
|
|
57585
57598
|
value: typeConfig?.resolve?.queryField || "node"
|
|
57586
57599
|
},
|
|
57587
57600
|
["arguments"]: keys.map((key) => ({
|
|
57588
|
-
kind:
|
|
57601
|
+
kind: graphql7.Kind.ARGUMENT,
|
|
57589
57602
|
name: {
|
|
57590
|
-
kind:
|
|
57603
|
+
kind: graphql7.Kind.NAME,
|
|
57591
57604
|
value: key.name
|
|
57592
57605
|
},
|
|
57593
57606
|
value: {
|
|
57594
|
-
kind:
|
|
57607
|
+
kind: graphql7.Kind.VARIABLE,
|
|
57595
57608
|
name: {
|
|
57596
|
-
kind:
|
|
57609
|
+
kind: graphql7.Kind.NAME,
|
|
57597
57610
|
value: key.name
|
|
57598
57611
|
}
|
|
57599
57612
|
}
|
|
57600
57613
|
})),
|
|
57601
57614
|
selectionSet: {
|
|
57602
|
-
kind:
|
|
57615
|
+
kind: graphql7.Kind.SELECTION_SET,
|
|
57603
57616
|
selections: [
|
|
57604
57617
|
{
|
|
57605
|
-
kind:
|
|
57618
|
+
kind: graphql7.Kind.FIELD,
|
|
57606
57619
|
name: {
|
|
57607
|
-
kind:
|
|
57620
|
+
kind: graphql7.Kind.NAME,
|
|
57608
57621
|
value: "__typename"
|
|
57609
57622
|
}
|
|
57610
57623
|
},
|
|
57611
57624
|
...(typeConfig?.keys || ["id"]).map((key) => ({
|
|
57612
|
-
kind:
|
|
57625
|
+
kind: graphql7.Kind.FIELD,
|
|
57613
57626
|
name: {
|
|
57614
|
-
kind:
|
|
57627
|
+
kind: graphql7.Kind.NAME,
|
|
57615
57628
|
value: key
|
|
57616
57629
|
}
|
|
57617
57630
|
})),
|
|
@@ -57673,15 +57686,15 @@ function replaceArgumentsWithVariables(args, flags) {
|
|
|
57673
57686
|
}
|
|
57674
57687
|
function variableAsArgument(name2, variable) {
|
|
57675
57688
|
return {
|
|
57676
|
-
kind:
|
|
57689
|
+
kind: graphql7.Kind.ARGUMENT,
|
|
57677
57690
|
name: {
|
|
57678
|
-
kind:
|
|
57691
|
+
kind: graphql7.Kind.NAME,
|
|
57679
57692
|
value: name2
|
|
57680
57693
|
},
|
|
57681
57694
|
value: {
|
|
57682
|
-
kind:
|
|
57695
|
+
kind: graphql7.Kind.VARIABLE,
|
|
57683
57696
|
name: {
|
|
57684
|
-
kind:
|
|
57697
|
+
kind: graphql7.Kind.NAME,
|
|
57685
57698
|
value: variable ?? name2
|
|
57686
57699
|
}
|
|
57687
57700
|
}
|
|
@@ -57689,18 +57702,18 @@ function variableAsArgument(name2, variable) {
|
|
|
57689
57702
|
}
|
|
57690
57703
|
function staticVariableDefinition(name2, type, defaultValue, variableName) {
|
|
57691
57704
|
return {
|
|
57692
|
-
kind:
|
|
57705
|
+
kind: graphql7.Kind.VARIABLE_DEFINITION,
|
|
57693
57706
|
type: {
|
|
57694
|
-
kind:
|
|
57707
|
+
kind: graphql7.Kind.NAMED_TYPE,
|
|
57695
57708
|
name: {
|
|
57696
|
-
kind:
|
|
57709
|
+
kind: graphql7.Kind.NAME,
|
|
57697
57710
|
value: type
|
|
57698
57711
|
}
|
|
57699
57712
|
},
|
|
57700
57713
|
variable: {
|
|
57701
|
-
kind:
|
|
57714
|
+
kind: graphql7.Kind.VARIABLE,
|
|
57702
57715
|
name: {
|
|
57703
|
-
kind:
|
|
57716
|
+
kind: graphql7.Kind.NAME,
|
|
57704
57717
|
value: variableName ?? name2
|
|
57705
57718
|
}
|
|
57706
57719
|
},
|
|
@@ -57712,9 +57725,9 @@ function staticVariableDefinition(name2, type, defaultValue, variableName) {
|
|
|
57712
57725
|
}
|
|
57713
57726
|
function argumentNode(name2, value) {
|
|
57714
57727
|
return {
|
|
57715
|
-
kind:
|
|
57728
|
+
kind: graphql7.Kind.ARGUMENT,
|
|
57716
57729
|
name: {
|
|
57717
|
-
kind:
|
|
57730
|
+
kind: graphql7.Kind.NAME,
|
|
57718
57731
|
value: name2
|
|
57719
57732
|
},
|
|
57720
57733
|
value: objectNode(value)
|
|
@@ -57722,16 +57735,16 @@ function argumentNode(name2, value) {
|
|
|
57722
57735
|
}
|
|
57723
57736
|
function objectNode([type, defaultValue]) {
|
|
57724
57737
|
const node = {
|
|
57725
|
-
kind:
|
|
57738
|
+
kind: graphql7.Kind.OBJECT,
|
|
57726
57739
|
fields: [
|
|
57727
57740
|
{
|
|
57728
|
-
kind:
|
|
57741
|
+
kind: graphql7.Kind.OBJECT_FIELD,
|
|
57729
57742
|
name: {
|
|
57730
|
-
kind:
|
|
57743
|
+
kind: graphql7.Kind.NAME,
|
|
57731
57744
|
value: "type"
|
|
57732
57745
|
},
|
|
57733
57746
|
value: {
|
|
57734
|
-
kind:
|
|
57747
|
+
kind: graphql7.Kind.STRING,
|
|
57735
57748
|
value: type
|
|
57736
57749
|
}
|
|
57737
57750
|
}
|
|
@@ -57739,8 +57752,8 @@ function objectNode([type, defaultValue]) {
|
|
|
57739
57752
|
};
|
|
57740
57753
|
if (defaultValue) {
|
|
57741
57754
|
node.fields.push({
|
|
57742
|
-
kind:
|
|
57743
|
-
name: { kind:
|
|
57755
|
+
kind: graphql7.Kind.OBJECT_FIELD,
|
|
57756
|
+
name: { kind: graphql7.Kind.NAME, value: "default" },
|
|
57744
57757
|
value: {
|
|
57745
57758
|
kind: typeof defaultValue === "number" ? "IntValue" : "StringValue",
|
|
57746
57759
|
value: defaultValue.toString()
|
|
@@ -57751,34 +57764,34 @@ function objectNode([type, defaultValue]) {
|
|
|
57751
57764
|
}
|
|
57752
57765
|
var pageInfoSelection = [
|
|
57753
57766
|
{
|
|
57754
|
-
kind:
|
|
57767
|
+
kind: graphql7.Kind.FIELD,
|
|
57755
57768
|
name: {
|
|
57756
|
-
kind:
|
|
57769
|
+
kind: graphql7.Kind.NAME,
|
|
57757
57770
|
value: "edges"
|
|
57758
57771
|
},
|
|
57759
57772
|
selectionSet: {
|
|
57760
|
-
kind:
|
|
57773
|
+
kind: graphql7.Kind.SELECTION_SET,
|
|
57761
57774
|
selections: [
|
|
57762
57775
|
{
|
|
57763
|
-
kind:
|
|
57776
|
+
kind: graphql7.Kind.FIELD,
|
|
57764
57777
|
name: {
|
|
57765
|
-
kind:
|
|
57778
|
+
kind: graphql7.Kind.NAME,
|
|
57766
57779
|
value: "cursor"
|
|
57767
57780
|
}
|
|
57768
57781
|
},
|
|
57769
57782
|
{
|
|
57770
|
-
kind:
|
|
57783
|
+
kind: graphql7.Kind.FIELD,
|
|
57771
57784
|
name: {
|
|
57772
|
-
kind:
|
|
57785
|
+
kind: graphql7.Kind.NAME,
|
|
57773
57786
|
value: "node"
|
|
57774
57787
|
},
|
|
57775
57788
|
selectionSet: {
|
|
57776
|
-
kind:
|
|
57789
|
+
kind: graphql7.Kind.SELECTION_SET,
|
|
57777
57790
|
selections: [
|
|
57778
57791
|
{
|
|
57779
|
-
kind:
|
|
57792
|
+
kind: graphql7.Kind.FIELD,
|
|
57780
57793
|
name: {
|
|
57781
|
-
kind:
|
|
57794
|
+
kind: graphql7.Kind.NAME,
|
|
57782
57795
|
value: "__typename"
|
|
57783
57796
|
}
|
|
57784
57797
|
}
|
|
@@ -57789,39 +57802,39 @@ var pageInfoSelection = [
|
|
|
57789
57802
|
}
|
|
57790
57803
|
},
|
|
57791
57804
|
{
|
|
57792
|
-
kind:
|
|
57805
|
+
kind: graphql7.Kind.FIELD,
|
|
57793
57806
|
name: {
|
|
57794
|
-
kind:
|
|
57807
|
+
kind: graphql7.Kind.NAME,
|
|
57795
57808
|
value: "pageInfo"
|
|
57796
57809
|
},
|
|
57797
57810
|
selectionSet: {
|
|
57798
|
-
kind:
|
|
57811
|
+
kind: graphql7.Kind.SELECTION_SET,
|
|
57799
57812
|
selections: [
|
|
57800
57813
|
{
|
|
57801
|
-
kind:
|
|
57814
|
+
kind: graphql7.Kind.FIELD,
|
|
57802
57815
|
name: {
|
|
57803
|
-
kind:
|
|
57816
|
+
kind: graphql7.Kind.NAME,
|
|
57804
57817
|
value: "hasPreviousPage"
|
|
57805
57818
|
}
|
|
57806
57819
|
},
|
|
57807
57820
|
{
|
|
57808
|
-
kind:
|
|
57821
|
+
kind: graphql7.Kind.FIELD,
|
|
57809
57822
|
name: {
|
|
57810
|
-
kind:
|
|
57823
|
+
kind: graphql7.Kind.NAME,
|
|
57811
57824
|
value: "hasNextPage"
|
|
57812
57825
|
}
|
|
57813
57826
|
},
|
|
57814
57827
|
{
|
|
57815
|
-
kind:
|
|
57828
|
+
kind: graphql7.Kind.FIELD,
|
|
57816
57829
|
name: {
|
|
57817
|
-
kind:
|
|
57830
|
+
kind: graphql7.Kind.NAME,
|
|
57818
57831
|
value: "startCursor"
|
|
57819
57832
|
}
|
|
57820
57833
|
},
|
|
57821
57834
|
{
|
|
57822
|
-
kind:
|
|
57835
|
+
kind: graphql7.Kind.FIELD,
|
|
57823
57836
|
name: {
|
|
57824
|
-
kind:
|
|
57837
|
+
kind: graphql7.Kind.NAME,
|
|
57825
57838
|
value: "endCursor"
|
|
57826
57839
|
}
|
|
57827
57840
|
}
|
|
@@ -57835,15 +57848,15 @@ async function addListFragments(config2, documents) {
|
|
|
57835
57848
|
const lists = {};
|
|
57836
57849
|
const errors = [];
|
|
57837
57850
|
for (const doc of documents) {
|
|
57838
|
-
doc.document =
|
|
57851
|
+
doc.document = graphql8.visit(doc.document, {
|
|
57839
57852
|
Directive(node, key, parent, path2, ancestors) {
|
|
57840
57853
|
if ([config2.listDirective, config2.paginateDirective].includes(node.name.value)) {
|
|
57841
57854
|
const nameArg = node.arguments?.find((arg) => arg.name.value === "name");
|
|
57842
57855
|
let error = {
|
|
57843
|
-
...new
|
|
57856
|
+
...new graphql8.GraphQLError(
|
|
57844
57857
|
"",
|
|
57845
57858
|
node,
|
|
57846
|
-
new
|
|
57859
|
+
new graphql8.Source(""),
|
|
57847
57860
|
node.loc ? [node.loc.start, node.loc.end] : null,
|
|
57848
57861
|
path2
|
|
57849
57862
|
),
|
|
@@ -57895,7 +57908,7 @@ async function addListFragments(config2, documents) {
|
|
|
57895
57908
|
{
|
|
57896
57909
|
kind: "Argument",
|
|
57897
57910
|
name: {
|
|
57898
|
-
kind:
|
|
57911
|
+
kind: graphql8.Kind.NAME,
|
|
57899
57912
|
value: "connection"
|
|
57900
57913
|
},
|
|
57901
57914
|
value: {
|
|
@@ -57945,7 +57958,7 @@ async function addListFragments(config2, documents) {
|
|
|
57945
57958
|
const validDeletes = [
|
|
57946
57959
|
...new Set(
|
|
57947
57960
|
Object.values(lists).map(({ type }) => {
|
|
57948
|
-
if (!(type instanceof
|
|
57961
|
+
if (!(type instanceof graphql8.GraphQLObjectType)) {
|
|
57949
57962
|
return "";
|
|
57950
57963
|
}
|
|
57951
57964
|
if (config2.keyFieldsForType(type.name).length !== 1) {
|
|
@@ -57959,7 +57972,7 @@ async function addListFragments(config2, documents) {
|
|
|
57959
57972
|
return;
|
|
57960
57973
|
}
|
|
57961
57974
|
const generatedDoc = {
|
|
57962
|
-
kind:
|
|
57975
|
+
kind: graphql8.Kind.DOCUMENT,
|
|
57963
57976
|
definitions: Object.entries(lists).flatMap(
|
|
57964
57977
|
([name2, { selection: selection2, type }]) => {
|
|
57965
57978
|
const schemaType = config2.schema.getType(type.name);
|
|
@@ -57967,7 +57980,7 @@ async function addListFragments(config2, documents) {
|
|
|
57967
57980
|
throw new HoudiniError({ message: "Lists must have a selection" });
|
|
57968
57981
|
}
|
|
57969
57982
|
const fragmentSelection = {
|
|
57970
|
-
kind:
|
|
57983
|
+
kind: graphql8.Kind.SELECTION_SET,
|
|
57971
57984
|
selections: [...selection2.selections]
|
|
57972
57985
|
};
|
|
57973
57986
|
if (schemaType && fragmentSelection && !fragmentSelection?.selections.find(
|
|
@@ -57982,14 +57995,14 @@ async function addListFragments(config2, documents) {
|
|
|
57982
57995
|
{
|
|
57983
57996
|
name: {
|
|
57984
57997
|
value: config2.listInsertFragment(name2),
|
|
57985
|
-
kind:
|
|
57998
|
+
kind: graphql8.Kind.NAME
|
|
57986
57999
|
},
|
|
57987
|
-
kind:
|
|
58000
|
+
kind: graphql8.Kind.FRAGMENT_DEFINITION,
|
|
57988
58001
|
selectionSet: fragmentSelection,
|
|
57989
58002
|
typeCondition: {
|
|
57990
|
-
kind:
|
|
58003
|
+
kind: graphql8.Kind.NAMED_TYPE,
|
|
57991
58004
|
name: {
|
|
57992
|
-
kind:
|
|
58005
|
+
kind: graphql8.Kind.NAME,
|
|
57993
58006
|
value: type.name
|
|
57994
58007
|
}
|
|
57995
58008
|
}
|
|
@@ -57997,32 +58010,32 @@ async function addListFragments(config2, documents) {
|
|
|
57997
58010
|
{
|
|
57998
58011
|
name: {
|
|
57999
58012
|
value: config2.listToggleFragment(name2),
|
|
58000
|
-
kind:
|
|
58013
|
+
kind: graphql8.Kind.NAME
|
|
58001
58014
|
},
|
|
58002
|
-
kind:
|
|
58015
|
+
kind: graphql8.Kind.FRAGMENT_DEFINITION,
|
|
58003
58016
|
selectionSet: fragmentSelection,
|
|
58004
58017
|
typeCondition: {
|
|
58005
|
-
kind:
|
|
58018
|
+
kind: graphql8.Kind.NAMED_TYPE,
|
|
58006
58019
|
name: {
|
|
58007
|
-
kind:
|
|
58020
|
+
kind: graphql8.Kind.NAME,
|
|
58008
58021
|
value: type.name
|
|
58009
58022
|
}
|
|
58010
58023
|
}
|
|
58011
58024
|
},
|
|
58012
58025
|
{
|
|
58013
|
-
kind:
|
|
58026
|
+
kind: graphql8.Kind.FRAGMENT_DEFINITION,
|
|
58014
58027
|
name: {
|
|
58015
58028
|
value: config2.listRemoveFragment(name2),
|
|
58016
|
-
kind:
|
|
58029
|
+
kind: graphql8.Kind.NAME
|
|
58017
58030
|
},
|
|
58018
58031
|
selectionSet: {
|
|
58019
|
-
kind:
|
|
58032
|
+
kind: graphql8.Kind.SELECTION_SET,
|
|
58020
58033
|
selections: [...objectIdentificationSelection(config2, type)]
|
|
58021
58034
|
},
|
|
58022
58035
|
typeCondition: {
|
|
58023
|
-
kind:
|
|
58036
|
+
kind: graphql8.Kind.NAMED_TYPE,
|
|
58024
58037
|
name: {
|
|
58025
|
-
kind:
|
|
58038
|
+
kind: graphql8.Kind.NAME,
|
|
58026
58039
|
value: type.name
|
|
58027
58040
|
}
|
|
58028
58041
|
}
|
|
@@ -58031,14 +58044,14 @@ async function addListFragments(config2, documents) {
|
|
|
58031
58044
|
}
|
|
58032
58045
|
).concat(
|
|
58033
58046
|
...validDeletes.map((typeName) => ({
|
|
58034
|
-
kind:
|
|
58047
|
+
kind: graphql8.Kind.DIRECTIVE_DEFINITION,
|
|
58035
58048
|
name: {
|
|
58036
|
-
kind:
|
|
58049
|
+
kind: graphql8.Kind.NAME,
|
|
58037
58050
|
value: config2.listDeleteDirective(typeName)
|
|
58038
58051
|
},
|
|
58039
58052
|
locations: [
|
|
58040
58053
|
{
|
|
58041
|
-
kind:
|
|
58054
|
+
kind: graphql8.Kind.NAME,
|
|
58042
58055
|
value: "FIELD"
|
|
58043
58056
|
}
|
|
58044
58057
|
],
|
|
@@ -58046,8 +58059,8 @@ async function addListFragments(config2, documents) {
|
|
|
58046
58059
|
}))
|
|
58047
58060
|
)
|
|
58048
58061
|
};
|
|
58049
|
-
config2.newSchema += "\n" + generatedDoc.definitions.filter((c) => c.kind !== "FragmentDefinition").map(
|
|
58050
|
-
config2.newDocuments += "\n" + generatedDoc.definitions.filter((c) => c.kind === "FragmentDefinition").map(
|
|
58062
|
+
config2.newSchema += "\n" + generatedDoc.definitions.filter((c) => c.kind !== "FragmentDefinition").map(graphql8.print).join("\n\n");
|
|
58063
|
+
config2.newDocuments += "\n" + generatedDoc.definitions.filter((c) => c.kind === "FragmentDefinition").map(graphql8.print).join("\n\n");
|
|
58051
58064
|
documents.push({
|
|
58052
58065
|
name: "generated::lists",
|
|
58053
58066
|
kind: "HoudiniFragment" /* Fragment */,
|
|
@@ -58132,11 +58145,11 @@ var nodeNotDefinedMessage = (config2) => `Looks like you are trying to use the $
|
|
|
58132
58145
|
For more information, visit this link: ${siteURL}/guides/pagination`;
|
|
58133
58146
|
|
|
58134
58147
|
// src/codegen/generators/artifacts/fieldKey.ts
|
|
58135
|
-
var
|
|
58148
|
+
var graphql9 = __toESM(require_graphql2(), 1);
|
|
58136
58149
|
function fieldKey(config2, field) {
|
|
58137
58150
|
const attributeName = field.alias?.value || field.name.value;
|
|
58138
|
-
const printed =
|
|
58139
|
-
const secondParse =
|
|
58151
|
+
const printed = graphql9.print(field);
|
|
58152
|
+
const secondParse = graphql9.parse(`{${printed}}`).definitions[0].selectionSet.selections[0];
|
|
58140
58153
|
const paginated = !!field.directives?.find(
|
|
58141
58154
|
(directive) => directive.name.value === config2.paginateDirective
|
|
58142
58155
|
);
|
|
@@ -58231,8 +58244,8 @@ function selection({
|
|
|
58231
58244
|
const typeConditionName = field.typeCondition.name.value;
|
|
58232
58245
|
const typeCondition = config2.schema.getType(typeConditionName);
|
|
58233
58246
|
const possibleTypes = [];
|
|
58234
|
-
if (!
|
|
58235
|
-
} else if (
|
|
58247
|
+
if (!graphql10.isAbstractType(typeCondition)) {
|
|
58248
|
+
} else if (graphql10.isAbstractType(parentType)) {
|
|
58236
58249
|
const possibleParentTypes = config2.schema.getPossibleTypes(parentType).map((type) => type.name);
|
|
58237
58250
|
for (const possible of config2.schema.getPossibleTypes(typeCondition)) {
|
|
58238
58251
|
if (possibleParentTypes.includes(possible.name)) {
|
|
@@ -58280,7 +58293,7 @@ function selection({
|
|
|
58280
58293
|
} else {
|
|
58281
58294
|
let typeRef = type.getFields()[field.name.value].type;
|
|
58282
58295
|
fieldType = getRootType(typeRef);
|
|
58283
|
-
nullable = !
|
|
58296
|
+
nullable = !graphql10.isNonNullType(typeRef);
|
|
58284
58297
|
}
|
|
58285
58298
|
const typeName = fieldType.toString();
|
|
58286
58299
|
const pathSoFar = path2.concat(attributeName);
|
|
@@ -58345,7 +58358,7 @@ function selection({
|
|
|
58345
58358
|
{}
|
|
58346
58359
|
);
|
|
58347
58360
|
}
|
|
58348
|
-
if (
|
|
58361
|
+
if (graphql10.isInterfaceType(fieldType) || graphql10.isUnionType(fieldType)) {
|
|
58349
58362
|
fieldObj.abstract = true;
|
|
58350
58363
|
}
|
|
58351
58364
|
object.fields = {
|
|
@@ -58402,7 +58415,7 @@ function artifactGenerator(stats) {
|
|
|
58402
58415
|
return async function(config2, docs) {
|
|
58403
58416
|
const filterTypes = {};
|
|
58404
58417
|
for (const doc of docs) {
|
|
58405
|
-
|
|
58418
|
+
graphql11.visit(doc.document, {
|
|
58406
58419
|
Directive(node, _, __, ___, ancestors) {
|
|
58407
58420
|
if (node.name.value !== config2.listDirective) {
|
|
58408
58421
|
return;
|
|
@@ -58461,7 +58474,7 @@ function artifactGenerator(stats) {
|
|
|
58461
58474
|
return;
|
|
58462
58475
|
}
|
|
58463
58476
|
const usedVariableNames = /* @__PURE__ */ new Set();
|
|
58464
|
-
let documentWithoutInternalDirectives =
|
|
58477
|
+
let documentWithoutInternalDirectives = graphql11.visit(document, {
|
|
58465
58478
|
Directive(node) {
|
|
58466
58479
|
if (config2.isInternalDirective(node)) {
|
|
58467
58480
|
return null;
|
|
@@ -58474,7 +58487,7 @@ function artifactGenerator(stats) {
|
|
|
58474
58487
|
}
|
|
58475
58488
|
}
|
|
58476
58489
|
});
|
|
58477
|
-
let documentWithoutExtraVariables =
|
|
58490
|
+
let documentWithoutExtraVariables = graphql11.visit(
|
|
58478
58491
|
documentWithoutInternalDirectives,
|
|
58479
58492
|
{
|
|
58480
58493
|
VariableDefinition(variableDefinitionNode) {
|
|
@@ -58485,13 +58498,13 @@ function artifactGenerator(stats) {
|
|
|
58485
58498
|
}
|
|
58486
58499
|
}
|
|
58487
58500
|
);
|
|
58488
|
-
let rawString =
|
|
58501
|
+
let rawString = graphql11.print(documentWithoutExtraVariables);
|
|
58489
58502
|
let docKind = doc.kind;
|
|
58490
58503
|
const operations = document.definitions.filter(
|
|
58491
|
-
({ kind }) => kind ===
|
|
58504
|
+
({ kind }) => kind === graphql11.Kind.OPERATION_DEFINITION
|
|
58492
58505
|
);
|
|
58493
58506
|
const fragments = document.definitions.filter(
|
|
58494
|
-
({ kind }) => kind ===
|
|
58507
|
+
({ kind }) => kind === graphql11.Kind.FRAGMENT_DEFINITION
|
|
58495
58508
|
);
|
|
58496
58509
|
let rootType = "";
|
|
58497
58510
|
let selectionSet;
|
|
@@ -58733,15 +58746,15 @@ async function generatePluginRuntime(config2, plugin) {
|
|
|
58733
58746
|
var recast12 = __toESM(require_main2(), 1);
|
|
58734
58747
|
|
|
58735
58748
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
58736
|
-
var
|
|
58749
|
+
var graphql14 = __toESM(require_graphql2(), 1);
|
|
58737
58750
|
var recast9 = __toESM(require_main2(), 1);
|
|
58738
58751
|
|
|
58739
58752
|
// src/codegen/generators/typescript/typeReference.ts
|
|
58740
|
-
var
|
|
58753
|
+
var graphql13 = __toESM(require_graphql2(), 1);
|
|
58741
58754
|
var recast8 = __toESM(require_main2(), 1);
|
|
58742
58755
|
|
|
58743
58756
|
// src/codegen/generators/typescript/types.ts
|
|
58744
|
-
var
|
|
58757
|
+
var graphql12 = __toESM(require_graphql2(), 1);
|
|
58745
58758
|
var recast7 = __toESM(require_main2(), 1);
|
|
58746
58759
|
var AST7 = recast7.types.builders;
|
|
58747
58760
|
function readonlyProperty(prop, enable = true) {
|
|
@@ -58775,7 +58788,7 @@ function scalarPropertyValue(config2, missingScalars, target) {
|
|
|
58775
58788
|
return AST7.tsStringKeyword();
|
|
58776
58789
|
}
|
|
58777
58790
|
default: {
|
|
58778
|
-
if (
|
|
58791
|
+
if (graphql12.isNonNullType(target) && "ofType" in target) {
|
|
58779
58792
|
return scalarPropertyValue(
|
|
58780
58793
|
config2,
|
|
58781
58794
|
missingScalars,
|
|
@@ -58796,7 +58809,7 @@ var AST8 = recast8.types.builders;
|
|
|
58796
58809
|
function tsTypeReference(config2, missingScalars, definition) {
|
|
58797
58810
|
const { type, wrappers } = unwrapType(config2, definition.type);
|
|
58798
58811
|
let result;
|
|
58799
|
-
if (
|
|
58812
|
+
if (graphql13.isScalarType(type)) {
|
|
58800
58813
|
result = scalarPropertyValue(config2, missingScalars, type);
|
|
58801
58814
|
} else {
|
|
58802
58815
|
result = AST8.tsTypeReference(AST8.identifier(type.name));
|
|
@@ -58817,17 +58830,17 @@ function tsTypeReference(config2, missingScalars, definition) {
|
|
|
58817
58830
|
var AST9 = recast9.types.builders;
|
|
58818
58831
|
function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingScalars, rootType) {
|
|
58819
58832
|
const { type } = unwrapType(config2, rootType);
|
|
58820
|
-
if (
|
|
58833
|
+
if (graphql14.isScalarType(type)) {
|
|
58821
58834
|
return;
|
|
58822
58835
|
}
|
|
58823
58836
|
if (visitedTypes.has(type.name)) {
|
|
58824
58837
|
return;
|
|
58825
58838
|
}
|
|
58826
|
-
if (
|
|
58839
|
+
if (graphql14.isUnionType(type)) {
|
|
58827
58840
|
throw new HoudiniError({ filepath, message: "Input Unions are not supported yet. Sorry!" });
|
|
58828
58841
|
}
|
|
58829
58842
|
visitedTypes.add(type.name);
|
|
58830
|
-
if (
|
|
58843
|
+
if (graphql14.isEnumType(type)) {
|
|
58831
58844
|
ensureImports({
|
|
58832
58845
|
config: config2,
|
|
58833
58846
|
body,
|
|
@@ -58844,7 +58857,7 @@ function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingS
|
|
|
58844
58857
|
AST9.tsPropertySignature(
|
|
58845
58858
|
AST9.identifier(field.name),
|
|
58846
58859
|
AST9.tsTypeAnnotation(tsTypeReference(config2, missingScalars, field)),
|
|
58847
|
-
|
|
58860
|
+
graphql14.isNullableType(field.type)
|
|
58848
58861
|
)
|
|
58849
58862
|
);
|
|
58850
58863
|
}
|
|
@@ -58852,7 +58865,7 @@ function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingS
|
|
|
58852
58865
|
}
|
|
58853
58866
|
|
|
58854
58867
|
// src/codegen/generators/typescript/imperativeCache.ts
|
|
58855
|
-
var
|
|
58868
|
+
var graphql15 = __toESM(require_graphql2(), 1);
|
|
58856
58869
|
var recast10 = __toESM(require_main2(), 1);
|
|
58857
58870
|
var AST10 = recast10.types.builders;
|
|
58858
58871
|
async function imperativeCacheTypef(config2, docs) {
|
|
@@ -58888,7 +58901,7 @@ function typeDefinitions(config2, body) {
|
|
|
58888
58901
|
const operationTypes = [config2.schema.getMutationType(), config2.schema.getSubscriptionType()].filter(Boolean).map((type) => type?.name);
|
|
58889
58902
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
58890
58903
|
const types14 = Object.values(config2.schema.getTypeMap()).filter(
|
|
58891
|
-
(type) => !
|
|
58904
|
+
(type) => !graphql15.isAbstractType(type) && !graphql15.isScalarType(type) && !graphql15.isEnumType(type) && !graphql15.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
|
|
58892
58905
|
);
|
|
58893
58906
|
return AST10.tsTypeLiteral(
|
|
58894
58907
|
types14.map((type) => {
|
|
@@ -58898,7 +58911,7 @@ function typeDefinitions(config2, body) {
|
|
|
58898
58911
|
}
|
|
58899
58912
|
let idFields = AST10.tsNeverKeyword();
|
|
58900
58913
|
const keys = keyFieldsForType(config2.configFile, type.name);
|
|
58901
|
-
if (
|
|
58914
|
+
if (graphql15.isObjectType(type) && keys.length > 0 && keys.every((key) => type.getFields()[key])) {
|
|
58902
58915
|
idFields = AST10.tsTypeLiteral(
|
|
58903
58916
|
keys.map((key) => {
|
|
58904
58917
|
const fieldType = type.getFields()[key];
|
|
@@ -58915,21 +58928,21 @@ function typeDefinitions(config2, body) {
|
|
|
58915
58928
|
idFields = AST10.tsTypeLiteral([]);
|
|
58916
58929
|
}
|
|
58917
58930
|
let fields = AST10.tsTypeLiteral([]);
|
|
58918
|
-
if (
|
|
58931
|
+
if (graphql15.isObjectType(type)) {
|
|
58919
58932
|
fields = AST10.tsTypeLiteral(
|
|
58920
58933
|
Object.entries(type.getFields()).map(
|
|
58921
58934
|
([key, fieldType]) => {
|
|
58922
58935
|
const unwrapped = unwrapType(config2, fieldType.type);
|
|
58923
58936
|
let typeOptions = AST10.tsUnionType([]);
|
|
58924
|
-
if (
|
|
58937
|
+
if (graphql15.isScalarType(unwrapped.type)) {
|
|
58925
58938
|
typeOptions.types.push(
|
|
58926
58939
|
scalarPropertyValue(config2, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
58927
58940
|
);
|
|
58928
|
-
} else if (
|
|
58941
|
+
} else if (graphql15.isEnumType(unwrapped.type)) {
|
|
58929
58942
|
typeOptions.types.push(
|
|
58930
58943
|
AST10.tsTypeReference(AST10.identifier(unwrapped.type.name))
|
|
58931
58944
|
);
|
|
58932
|
-
} else if (!
|
|
58945
|
+
} else if (!graphql15.isAbstractType(unwrapped.type)) {
|
|
58933
58946
|
typeOptions.types.push(record(unwrapped.type.name));
|
|
58934
58947
|
} else {
|
|
58935
58948
|
typeOptions.types.push(
|
|
@@ -59015,7 +59028,7 @@ function listDefinitions(config2, docs) {
|
|
|
59015
59028
|
const lists = [];
|
|
59016
59029
|
const visitedLists = /* @__PURE__ */ new Set();
|
|
59017
59030
|
for (const doc of docs) {
|
|
59018
|
-
|
|
59031
|
+
graphql15.visit(doc.document, {
|
|
59019
59032
|
Directive(node, key, parent, path2, ancestors) {
|
|
59020
59033
|
if (![config2.listDirective, config2.paginateDirective].includes(node.name.value)) {
|
|
59021
59034
|
return;
|
|
@@ -59035,7 +59048,7 @@ function listDefinitions(config2, docs) {
|
|
|
59035
59048
|
const targetFieldDefinition = parentType.getFields()[targetField.name.value];
|
|
59036
59049
|
const { type: listType } = unwrapType(config2, targetFieldDefinition.type);
|
|
59037
59050
|
const possibleTypes = [];
|
|
59038
|
-
if (
|
|
59051
|
+
if (graphql15.isAbstractType(listType)) {
|
|
59039
59052
|
possibleTypes.push(
|
|
59040
59053
|
...config2.schema.getPossibleTypes(listType).map((possible) => possible.name)
|
|
59041
59054
|
);
|
|
@@ -59099,7 +59112,7 @@ function record(name2) {
|
|
|
59099
59112
|
}
|
|
59100
59113
|
|
|
59101
59114
|
// src/codegen/generators/typescript/inlineType.ts
|
|
59102
|
-
var
|
|
59115
|
+
var graphql16 = __toESM(require_graphql2(), 1);
|
|
59103
59116
|
var recast11 = __toESM(require_main2(), 1);
|
|
59104
59117
|
var AST11 = recast11.types.builders;
|
|
59105
59118
|
var fragmentKey = "$fragments";
|
|
@@ -59118,9 +59131,9 @@ function inlineType({
|
|
|
59118
59131
|
}) {
|
|
59119
59132
|
const { type, wrappers } = unwrapType(config2, rootType);
|
|
59120
59133
|
let result;
|
|
59121
|
-
if (
|
|
59134
|
+
if (graphql16.isScalarType(type)) {
|
|
59122
59135
|
result = scalarPropertyValue(config2, missingScalars, type);
|
|
59123
|
-
} else if (
|
|
59136
|
+
} else if (graphql16.isEnumType(type)) {
|
|
59124
59137
|
if (!visitedTypes.has(type.name)) {
|
|
59125
59138
|
ensureImports({
|
|
59126
59139
|
config: config2,
|
|
@@ -59138,11 +59151,11 @@ function inlineType({
|
|
|
59138
59151
|
for (const selection2 of selections) {
|
|
59139
59152
|
if (selection2.kind === "InlineFragment" && selection2.typeCondition) {
|
|
59140
59153
|
const fragmentType = config2.schema.getType(selection2.typeCondition.name.value);
|
|
59141
|
-
if (!
|
|
59154
|
+
if (!graphql16.isInterfaceType(type) && !graphql16.isUnionType(type)) {
|
|
59142
59155
|
selectedFields.push(...selection2.selectionSet.selections);
|
|
59143
59156
|
continue;
|
|
59144
59157
|
}
|
|
59145
|
-
if (!
|
|
59158
|
+
if (!graphql16.isInterfaceType(fragmentType) && !graphql16.isUnionType(fragmentType)) {
|
|
59146
59159
|
if (!inlineFragments[fragmentType.name]) {
|
|
59147
59160
|
inlineFragments[fragmentType.name] = [];
|
|
59148
59161
|
}
|
|
@@ -59262,7 +59275,7 @@ function inlineType({
|
|
|
59262
59275
|
}
|
|
59263
59276
|
}
|
|
59264
59277
|
}
|
|
59265
|
-
if (objectType.type === "TSTypeLiteral" && !
|
|
59278
|
+
if (objectType.type === "TSTypeLiteral" && !graphql16.isInterfaceType(fragmentRootType) && !graphql16.isUnionType(fragmentRootType)) {
|
|
59266
59279
|
const existingTypenameIndex = objectType.members.findIndex(
|
|
59267
59280
|
(member) => member.type === "TSPropertySignature" && member.key.type === "Identifier" && member.key.name === "__typename"
|
|
59268
59281
|
);
|
|
@@ -59329,7 +59342,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection2) {
|
|
|
59329
59342
|
},
|
|
59330
59343
|
type: schema.getType("String")
|
|
59331
59344
|
};
|
|
59332
|
-
} else if (
|
|
59345
|
+
} else if (graphql16.isNonNullType(rootType) && "getFields" in rootType.ofType) {
|
|
59333
59346
|
fields = rootType.ofType.getFields();
|
|
59334
59347
|
} else {
|
|
59335
59348
|
fields = rootType.getFields();
|
|
@@ -59341,7 +59354,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection2) {
|
|
|
59341
59354
|
message: `Could not find type information for field ${rootType.toString()}.${selectionName} ${field}`
|
|
59342
59355
|
});
|
|
59343
59356
|
}
|
|
59344
|
-
const fieldType =
|
|
59357
|
+
const fieldType = graphql16.getNamedType(field.type);
|
|
59345
59358
|
if (!fieldType) {
|
|
59346
59359
|
throw new HoudiniError({
|
|
59347
59360
|
filepath,
|
|
@@ -59662,7 +59675,7 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
59662
59675
|
}
|
|
59663
59676
|
|
|
59664
59677
|
// src/codegen/generators/persistedQueries/index.ts
|
|
59665
|
-
var
|
|
59678
|
+
var graphql17 = __toESM(require_graphql2(), 1);
|
|
59666
59679
|
async function persistOutputGenerator(config2, docs) {
|
|
59667
59680
|
if (typeof config2.persistedQueryPath !== "string" || config2.persistedQueryPath.length === 0)
|
|
59668
59681
|
return;
|
|
@@ -59674,8 +59687,8 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
59674
59687
|
if (!generateArtifact) {
|
|
59675
59688
|
return acc;
|
|
59676
59689
|
}
|
|
59677
|
-
let rawString =
|
|
59678
|
-
|
|
59690
|
+
let rawString = graphql17.print(
|
|
59691
|
+
graphql17.visit(document, {
|
|
59679
59692
|
Directive(node) {
|
|
59680
59693
|
if (config2.isInternalDirective(node)) {
|
|
59681
59694
|
return null;
|
|
@@ -59684,7 +59697,7 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
59684
59697
|
})
|
|
59685
59698
|
);
|
|
59686
59699
|
const operations = document.definitions.filter(
|
|
59687
|
-
({ kind }) => kind ===
|
|
59700
|
+
({ kind }) => kind === graphql17.Kind.OPERATION_DEFINITION
|
|
59688
59701
|
);
|
|
59689
59702
|
if (operations.length > 0 && operations[0].kind === "OperationDefinition") {
|
|
59690
59703
|
acc[hashDocument(rawString)] = rawString;
|
|
@@ -59697,11 +59710,11 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
59697
59710
|
}
|
|
59698
59711
|
|
|
59699
59712
|
// src/codegen/generators/definitions/enums.ts
|
|
59700
|
-
var
|
|
59713
|
+
var graphql18 = __toESM(require_graphql2(), 1);
|
|
59701
59714
|
var recast13 = __toESM(require_main2(), 1);
|
|
59702
59715
|
var AST13 = recast13.types.builders;
|
|
59703
59716
|
async function definitionsGenerator(config2) {
|
|
59704
|
-
const enums =
|
|
59717
|
+
const enums = graphql18.parse(graphql18.printSchema(config2.schema)).definitions.filter(
|
|
59705
59718
|
(definition) => definition.kind === "EnumTypeDefinition"
|
|
59706
59719
|
).filter((def) => !config2.isInternalEnum(def));
|
|
59707
59720
|
const runtimeDefinitions = recast13.print(
|
|
@@ -59874,7 +59887,7 @@ function flattenFragments(filepath, operation, fragments) {
|
|
|
59874
59887
|
}
|
|
59875
59888
|
|
|
59876
59889
|
// src/codegen/transforms/schema.ts
|
|
59877
|
-
var
|
|
59890
|
+
var graphql20 = __toESM(require_graphql2(), 1);
|
|
59878
59891
|
async function graphqlExtensions(config2, documents) {
|
|
59879
59892
|
const internalSchema = `
|
|
59880
59893
|
enum CachePolicy {
|
|
@@ -59952,19 +59965,19 @@ directive @${config2.maskEnableDirective} on FRAGMENT_SPREAD
|
|
|
59952
59965
|
"""
|
|
59953
59966
|
directive @${config2.maskDisableDirective} on FRAGMENT_SPREAD
|
|
59954
59967
|
`;
|
|
59955
|
-
let currentSchema =
|
|
59968
|
+
let currentSchema = graphql20.printSchema(config2.schema);
|
|
59956
59969
|
if (!currentSchema.includes(`directive @${config2.listDirective}`)) {
|
|
59957
59970
|
currentSchema += internalSchema;
|
|
59958
59971
|
}
|
|
59959
59972
|
config2.newSchema += internalSchema;
|
|
59960
|
-
config2.schema =
|
|
59973
|
+
config2.schema = graphql20.buildSchema(currentSchema);
|
|
59961
59974
|
}
|
|
59962
59975
|
|
|
59963
59976
|
// src/codegen/transforms/typename.ts
|
|
59964
|
-
var
|
|
59977
|
+
var graphql21 = __toESM(require_graphql2(), 1);
|
|
59965
59978
|
async function addTypename(config2, documents) {
|
|
59966
59979
|
for (const doc of documents) {
|
|
59967
|
-
doc.document =
|
|
59980
|
+
doc.document = graphql21.visit(doc.document, {
|
|
59968
59981
|
Field(node, key, parent, path2, ancestors) {
|
|
59969
59982
|
if (!node.selectionSet) {
|
|
59970
59983
|
return;
|
|
@@ -59976,7 +59989,7 @@ async function addTypename(config2, documents) {
|
|
|
59976
59989
|
);
|
|
59977
59990
|
const field = type.getFields()[node.name.value];
|
|
59978
59991
|
const fieldType = unwrapType(config2, field.type).type;
|
|
59979
|
-
if (
|
|
59992
|
+
if (graphql21.isInterfaceType(fieldType) || graphql21.isUnionType(fieldType)) {
|
|
59980
59993
|
return {
|
|
59981
59994
|
...node,
|
|
59982
59995
|
selectionSet: {
|
|
@@ -59984,9 +59997,9 @@ async function addTypename(config2, documents) {
|
|
|
59984
59997
|
selections: [
|
|
59985
59998
|
...node.selectionSet.selections,
|
|
59986
59999
|
{
|
|
59987
|
-
kind:
|
|
60000
|
+
kind: graphql21.Kind.FIELD,
|
|
59988
60001
|
name: {
|
|
59989
|
-
kind:
|
|
60002
|
+
kind: graphql21.Kind.NAME,
|
|
59990
60003
|
value: "__typename"
|
|
59991
60004
|
}
|
|
59992
60005
|
}
|
|
@@ -60000,10 +60013,10 @@ async function addTypename(config2, documents) {
|
|
|
60000
60013
|
}
|
|
60001
60014
|
|
|
60002
60015
|
// src/codegen/transforms/addID.ts
|
|
60003
|
-
var
|
|
60016
|
+
var graphql22 = __toESM(require_graphql2(), 1);
|
|
60004
60017
|
async function addID(config2, documents) {
|
|
60005
60018
|
for (const doc of documents) {
|
|
60006
|
-
doc.document =
|
|
60019
|
+
doc.document = graphql22.visit(doc.document, {
|
|
60007
60020
|
Field(node, key, parent, path2, ancestors) {
|
|
60008
60021
|
if (!node.selectionSet) {
|
|
60009
60022
|
return;
|
|
@@ -60016,7 +60029,7 @@ async function addID(config2, documents) {
|
|
|
60016
60029
|
const field = type.getFields()[node.name.value];
|
|
60017
60030
|
const fieldType = unwrapType(config2, field.type).type;
|
|
60018
60031
|
if (node.selectionSet?.selections.length > 0) {
|
|
60019
|
-
if (!
|
|
60032
|
+
if (!graphql22.isObjectType(fieldType) && !graphql22.isInterfaceType(fieldType)) {
|
|
60020
60033
|
return;
|
|
60021
60034
|
}
|
|
60022
60035
|
const keyFields = config2.keyFieldsForType(fieldType.name);
|
|
@@ -60031,9 +60044,9 @@ async function addID(config2, documents) {
|
|
|
60031
60044
|
continue;
|
|
60032
60045
|
}
|
|
60033
60046
|
selections.push({
|
|
60034
|
-
kind:
|
|
60047
|
+
kind: graphql22.Kind.FIELD,
|
|
60035
60048
|
name: {
|
|
60036
|
-
kind:
|
|
60049
|
+
kind: graphql22.Kind.NAME,
|
|
60037
60050
|
value: keyField
|
|
60038
60051
|
}
|
|
60039
60052
|
});
|
|
@@ -60052,8 +60065,8 @@ async function addID(config2, documents) {
|
|
|
60052
60065
|
}
|
|
60053
60066
|
|
|
60054
60067
|
// src/codegen/transforms/fragmentVariables.ts
|
|
60055
|
-
var
|
|
60056
|
-
var GraphqlKinds2 =
|
|
60068
|
+
var graphql23 = __toESM(require_graphql2(), 1);
|
|
60069
|
+
var GraphqlKinds2 = graphql23.Kind;
|
|
60057
60070
|
async function fragmentVariables(config2, documents) {
|
|
60058
60071
|
const fragments = collectFragments(config2, documents);
|
|
60059
60072
|
const generatedFragments = {};
|
|
@@ -60076,7 +60089,7 @@ async function fragmentVariables(config2, documents) {
|
|
|
60076
60089
|
});
|
|
60077
60090
|
}
|
|
60078
60091
|
const doc = {
|
|
60079
|
-
kind:
|
|
60092
|
+
kind: graphql23.Kind.DOCUMENT,
|
|
60080
60093
|
definitions: Object.values(generatedFragments)
|
|
60081
60094
|
};
|
|
60082
60095
|
documents.push({
|
|
@@ -60112,7 +60125,7 @@ function inlineFragmentArgs({
|
|
|
60112
60125
|
filepath,
|
|
60113
60126
|
document
|
|
60114
60127
|
).reduce((acc, arg) => ({ ...acc, [arg.name]: arg }), {});
|
|
60115
|
-
const result =
|
|
60128
|
+
const result = graphql23.visit(document, {
|
|
60116
60129
|
FragmentSpread(node) {
|
|
60117
60130
|
const { definition } = fragmentDefinitions[node.name.value];
|
|
60118
60131
|
let { args, hash } = collectWithArguments(config2, filepath, node, scope);
|
|
@@ -60200,7 +60213,7 @@ function inlineFragmentArgs({
|
|
|
60200
60213
|
});
|
|
60201
60214
|
if (newName) {
|
|
60202
60215
|
result.name = {
|
|
60203
|
-
kind:
|
|
60216
|
+
kind: graphql23.Kind.NAME,
|
|
60204
60217
|
value: newName
|
|
60205
60218
|
};
|
|
60206
60219
|
}
|
|
@@ -60312,7 +60325,7 @@ function operationScope(operation) {
|
|
|
60312
60325
|
}
|
|
60313
60326
|
|
|
60314
60327
|
// src/codegen/validators/typeCheck.ts
|
|
60315
|
-
var
|
|
60328
|
+
var graphql24 = __toESM(require_graphql2(), 1);
|
|
60316
60329
|
async function typeCheck(config2, docs) {
|
|
60317
60330
|
const errors = [];
|
|
60318
60331
|
const freeLists = [];
|
|
@@ -60320,11 +60333,11 @@ async function typeCheck(config2, docs) {
|
|
|
60320
60333
|
const listTypes = [];
|
|
60321
60334
|
const fragments = {};
|
|
60322
60335
|
for (const { document: parsed, filename } of docs) {
|
|
60323
|
-
|
|
60324
|
-
[
|
|
60336
|
+
graphql24.visit(parsed, {
|
|
60337
|
+
[graphql24.Kind.FRAGMENT_DEFINITION](definition) {
|
|
60325
60338
|
fragments[definition.name.value] = definition;
|
|
60326
60339
|
},
|
|
60327
|
-
[
|
|
60340
|
+
[graphql24.Kind.DIRECTIVE](directive, _, parent, __, ancestors) {
|
|
60328
60341
|
if (![config2.listDirective, config2.paginateDirective].includes(directive.name.value)) {
|
|
60329
60342
|
return;
|
|
60330
60343
|
}
|
|
@@ -60370,14 +60383,14 @@ async function typeCheck(config2, docs) {
|
|
|
60370
60383
|
);
|
|
60371
60384
|
return;
|
|
60372
60385
|
}
|
|
60373
|
-
if (
|
|
60386
|
+
if (graphql24.isListType(rootType) || graphql24.isNonNullType(rootType) && graphql24.isListType(rootType.ofType)) {
|
|
60374
60387
|
needsParent = true;
|
|
60375
60388
|
break;
|
|
60376
60389
|
}
|
|
60377
|
-
if (
|
|
60390
|
+
if (graphql24.isNonNullType(rootType) && "ofType" in rootType) {
|
|
60378
60391
|
rootType = rootType.ofType;
|
|
60379
60392
|
}
|
|
60380
|
-
if (
|
|
60393
|
+
if (graphql24.isScalarType(rootType)) {
|
|
60381
60394
|
break;
|
|
60382
60395
|
}
|
|
60383
60396
|
rootType = rootType?.getFields()[parent2.name.value]?.type;
|
|
@@ -60453,9 +60466,9 @@ async function typeCheck(config2, docs) {
|
|
|
60453
60466
|
);
|
|
60454
60467
|
}
|
|
60455
60468
|
let targetTypes = [type];
|
|
60456
|
-
if (
|
|
60469
|
+
if (graphql24.isUnionType(type)) {
|
|
60457
60470
|
targetTypes = config2.schema.getPossibleTypes(type);
|
|
60458
|
-
} else if (
|
|
60471
|
+
} else if (graphql24.isInterfaceType(type)) {
|
|
60459
60472
|
try {
|
|
60460
60473
|
for (const key of config2.keyFieldsForType(type.name)) {
|
|
60461
60474
|
if (!type.getFields()[key]) {
|
|
@@ -60493,13 +60506,13 @@ async function typeCheck(config2, docs) {
|
|
|
60493
60506
|
if (errors.length > 0) {
|
|
60494
60507
|
throw errors;
|
|
60495
60508
|
}
|
|
60496
|
-
const rules = (filepath) => [...
|
|
60509
|
+
const rules = (filepath) => [...graphql24.specifiedRules].filter(
|
|
60497
60510
|
(rule) => ![
|
|
60498
|
-
|
|
60499
|
-
|
|
60500
|
-
|
|
60501
|
-
|
|
60502
|
-
|
|
60511
|
+
graphql24.NoUnusedFragmentsRule,
|
|
60512
|
+
graphql24.KnownFragmentNamesRule,
|
|
60513
|
+
graphql24.ExecutableDefinitionsRule,
|
|
60514
|
+
graphql24.KnownDirectivesRule,
|
|
60515
|
+
graphql24.KnownArgumentNamesRule
|
|
60503
60516
|
].includes(rule)
|
|
60504
60517
|
).concat(
|
|
60505
60518
|
validateLists({
|
|
@@ -60518,7 +60531,7 @@ async function typeCheck(config2, docs) {
|
|
|
60518
60531
|
noUnusedFragmentArguments(config2)
|
|
60519
60532
|
);
|
|
60520
60533
|
for (const { filename, document: parsed } of docs) {
|
|
60521
|
-
for (const error of
|
|
60534
|
+
for (const error of graphql24.validate(config2.schema, parsed, rules(filename))) {
|
|
60522
60535
|
errors.push(
|
|
60523
60536
|
new HoudiniError({
|
|
60524
60537
|
filepath: filename,
|
|
@@ -60544,7 +60557,7 @@ var validateLists = ({
|
|
|
60544
60557
|
if (!config2.isListFragment(node.name.value)) {
|
|
60545
60558
|
if (!fragments[node.name.value]) {
|
|
60546
60559
|
ctx.reportError(
|
|
60547
|
-
new
|
|
60560
|
+
new graphql24.GraphQLError(
|
|
60548
60561
|
"Encountered unknown fragment: " + node.name.value
|
|
60549
60562
|
)
|
|
60550
60563
|
);
|
|
@@ -60554,7 +60567,7 @@ var validateLists = ({
|
|
|
60554
60567
|
const listName = config2.listNameFromFragment(node.name.value);
|
|
60555
60568
|
if (!lists.includes(listName)) {
|
|
60556
60569
|
ctx.reportError(
|
|
60557
|
-
new
|
|
60570
|
+
new graphql24.GraphQLError(
|
|
60558
60571
|
"Encountered fragment referencing unknown list: " + listName
|
|
60559
60572
|
)
|
|
60560
60573
|
);
|
|
@@ -60579,7 +60592,7 @@ var validateLists = ({
|
|
|
60579
60592
|
);
|
|
60580
60593
|
if (parentArg) {
|
|
60581
60594
|
ctx.reportError(
|
|
60582
|
-
new
|
|
60595
|
+
new graphql24.GraphQLError(
|
|
60583
60596
|
`@${config2.deprecatedlistDirectiveParentIDArg} should be defined only in it's own directive now`
|
|
60584
60597
|
)
|
|
60585
60598
|
);
|
|
@@ -60595,7 +60608,7 @@ var validateLists = ({
|
|
|
60595
60608
|
return;
|
|
60596
60609
|
}
|
|
60597
60610
|
ctx.reportError(
|
|
60598
|
-
new
|
|
60611
|
+
new graphql24.GraphQLError(
|
|
60599
60612
|
`For this list fragment, you need to add or @${config2.listParentDirective} or @${config2.listAllListsDirective} directive to specify the behavior`
|
|
60600
60613
|
)
|
|
60601
60614
|
);
|
|
@@ -60605,7 +60618,7 @@ var validateLists = ({
|
|
|
60605
60618
|
const directiveName = node.name.value;
|
|
60606
60619
|
if (directiveName === "connection") {
|
|
60607
60620
|
ctx.reportError(
|
|
60608
|
-
new
|
|
60621
|
+
new graphql24.GraphQLError(
|
|
60609
60622
|
"@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."
|
|
60610
60623
|
)
|
|
60611
60624
|
);
|
|
@@ -60614,7 +60627,7 @@ var validateLists = ({
|
|
|
60614
60627
|
if (!config2.isInternalDirective(node)) {
|
|
60615
60628
|
if (!config2.schema.getDirective(directiveName)) {
|
|
60616
60629
|
ctx.reportError(
|
|
60617
|
-
new
|
|
60630
|
+
new graphql24.GraphQLError(
|
|
60618
60631
|
"Encountered unknown directive: " + directiveName
|
|
60619
60632
|
)
|
|
60620
60633
|
);
|
|
@@ -60623,7 +60636,7 @@ var validateLists = ({
|
|
|
60623
60636
|
}
|
|
60624
60637
|
if (config2.isListOperationDirective(directiveName) && !listTypes.includes(config2.listNameFromDirective(directiveName))) {
|
|
60625
60638
|
ctx.reportError(
|
|
60626
|
-
new
|
|
60639
|
+
new graphql24.GraphQLError(
|
|
60627
60640
|
"Encountered directive referencing unknown list: " + directiveName
|
|
60628
60641
|
)
|
|
60629
60642
|
);
|
|
@@ -60634,7 +60647,7 @@ var validateLists = ({
|
|
|
60634
60647
|
};
|
|
60635
60648
|
function knownArguments(config2) {
|
|
60636
60649
|
return function(ctx) {
|
|
60637
|
-
const nativeValidator =
|
|
60650
|
+
const nativeValidator = graphql24.KnownArgumentNamesRule(ctx);
|
|
60638
60651
|
return {
|
|
60639
60652
|
...nativeValidator,
|
|
60640
60653
|
Directive(directiveNode) {
|
|
@@ -60667,7 +60680,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60667
60680
|
for (const arg of node.arguments || []) {
|
|
60668
60681
|
if (arg.value.kind !== "ObjectValue") {
|
|
60669
60682
|
ctx.reportError(
|
|
60670
|
-
new
|
|
60683
|
+
new graphql24.GraphQLError("values in @arguments must be an object")
|
|
60671
60684
|
);
|
|
60672
60685
|
return;
|
|
60673
60686
|
}
|
|
@@ -60677,13 +60690,13 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60677
60690
|
);
|
|
60678
60691
|
if (!typeArg) {
|
|
60679
60692
|
ctx.reportError(
|
|
60680
|
-
new
|
|
60693
|
+
new graphql24.GraphQLError("missing type field for @arguments directive")
|
|
60681
60694
|
);
|
|
60682
60695
|
return;
|
|
60683
60696
|
}
|
|
60684
|
-
if (typeArg.value.kind !==
|
|
60697
|
+
if (typeArg.value.kind !== graphql24.Kind.STRING) {
|
|
60685
60698
|
ctx.reportError(
|
|
60686
|
-
new
|
|
60699
|
+
new graphql24.GraphQLError("type field to @arguments must be a string")
|
|
60687
60700
|
);
|
|
60688
60701
|
return;
|
|
60689
60702
|
}
|
|
@@ -60696,7 +60709,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60696
60709
|
);
|
|
60697
60710
|
if (typeArg.value.value !== defaultValueType) {
|
|
60698
60711
|
ctx.reportError(
|
|
60699
|
-
new
|
|
60712
|
+
new graphql24.GraphQLError(
|
|
60700
60713
|
`Invalid default value provided for ${arg.name.value}. Expected ${typeArg.value.value}, found ${defaultValueType}`
|
|
60701
60714
|
)
|
|
60702
60715
|
);
|
|
@@ -60714,7 +60727,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60714
60727
|
try {
|
|
60715
60728
|
args = fragmentArguments(config2, filepath, fragments[fragmentName]);
|
|
60716
60729
|
} catch (e) {
|
|
60717
|
-
ctx.reportError(new
|
|
60730
|
+
ctx.reportError(new graphql24.GraphQLError(e.message));
|
|
60718
60731
|
return;
|
|
60719
60732
|
}
|
|
60720
60733
|
fragmentArguments2[fragmentName] = args;
|
|
@@ -60737,7 +60750,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60737
60750
|
);
|
|
60738
60751
|
if (missing.length > 0) {
|
|
60739
60752
|
ctx.reportError(
|
|
60740
|
-
new
|
|
60753
|
+
new graphql24.GraphQLError(
|
|
60741
60754
|
"The following arguments are missing from this fragment: " + JSON.stringify(missing)
|
|
60742
60755
|
)
|
|
60743
60756
|
);
|
|
@@ -60748,7 +60761,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60748
60761
|
);
|
|
60749
60762
|
if (unknown.length > 0) {
|
|
60750
60763
|
ctx.reportError(
|
|
60751
|
-
new
|
|
60764
|
+
new graphql24.GraphQLError(
|
|
60752
60765
|
"Encountered unknown arguments: " + JSON.stringify(unknown)
|
|
60753
60766
|
)
|
|
60754
60767
|
);
|
|
@@ -60760,7 +60773,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60760
60773
|
]
|
|
60761
60774
|
);
|
|
60762
60775
|
for (const [applied, target] of zipped) {
|
|
60763
|
-
if (applied.value.kind ===
|
|
60776
|
+
if (applied.value.kind === graphql24.Kind.VARIABLE || applied.value.kind === graphql24.Kind.LIST || applied.value.kind === graphql24.Kind.OBJECT) {
|
|
60764
60777
|
continue;
|
|
60765
60778
|
}
|
|
60766
60779
|
const appliedType = applied.value.kind.substring(
|
|
@@ -60769,7 +60782,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60769
60782
|
);
|
|
60770
60783
|
if (appliedType !== target) {
|
|
60771
60784
|
ctx.reportError(
|
|
60772
|
-
new
|
|
60785
|
+
new graphql24.GraphQLError(
|
|
60773
60786
|
`Invalid argument type. Expected ${target}, found ${appliedType}`
|
|
60774
60787
|
)
|
|
60775
60788
|
);
|
|
@@ -60790,7 +60803,7 @@ function paginateArgs(config2, filepath) {
|
|
|
60790
60803
|
}
|
|
60791
60804
|
if (alreadyPaginated) {
|
|
60792
60805
|
ctx.reportError(
|
|
60793
|
-
new
|
|
60806
|
+
new graphql24.GraphQLError(
|
|
60794
60807
|
`@${config2.paginateDirective} can only appear in a document once.`
|
|
60795
60808
|
)
|
|
60796
60809
|
);
|
|
@@ -60805,7 +60818,7 @@ function paginateArgs(config2, filepath) {
|
|
|
60805
60818
|
const hasRequiredArgs = definitionArgs.find((arg) => arg.required);
|
|
60806
60819
|
if (hasRequiredArgs) {
|
|
60807
60820
|
ctx.reportError(
|
|
60808
|
-
new
|
|
60821
|
+
new graphql24.GraphQLError(
|
|
60809
60822
|
"@paginate cannot appear on a document with required args"
|
|
60810
60823
|
)
|
|
60811
60824
|
);
|
|
@@ -60837,14 +60850,14 @@ function paginateArgs(config2, filepath) {
|
|
|
60837
60850
|
const backwards = appliedArgs.has("last");
|
|
60838
60851
|
if (!forward && !backwards) {
|
|
60839
60852
|
ctx.reportError(
|
|
60840
|
-
new
|
|
60853
|
+
new graphql24.GraphQLError(
|
|
60841
60854
|
"A field with cursor-based pagination must have a first or last argument"
|
|
60842
60855
|
)
|
|
60843
60856
|
);
|
|
60844
60857
|
}
|
|
60845
60858
|
if (forward && backwards) {
|
|
60846
60859
|
ctx.reportError(
|
|
60847
|
-
new
|
|
60860
|
+
new graphql24.GraphQLError(
|
|
60848
60861
|
`A field with cursor pagination cannot go forwards an backwards simultaneously`
|
|
60849
60862
|
)
|
|
60850
60863
|
);
|
|
@@ -60858,7 +60871,7 @@ function paginateArgs(config2, filepath) {
|
|
|
60858
60871
|
);
|
|
60859
60872
|
if (!appliedLimitArg) {
|
|
60860
60873
|
ctx.reportError(
|
|
60861
|
-
new
|
|
60874
|
+
new graphql24.GraphQLError(
|
|
60862
60875
|
"A field with offset-based pagination must have a limit argument"
|
|
60863
60876
|
)
|
|
60864
60877
|
);
|
|
@@ -60874,20 +60887,20 @@ function noUnusedFragmentArguments(config2) {
|
|
|
60874
60887
|
const args = /* @__PURE__ */ new Set();
|
|
60875
60888
|
return {
|
|
60876
60889
|
enter(node) {
|
|
60877
|
-
if (node.kind ===
|
|
60890
|
+
if (node.kind === graphql24.Kind.FRAGMENT_DEFINITION) {
|
|
60878
60891
|
const definitionArguments = node.directives?.filter((directive) => directive.name.value === config2.argumentsDirective).flatMap((directive) => directive.arguments);
|
|
60879
60892
|
for (const arg of definitionArguments?.map((arg2) => arg2?.name.value) || []) {
|
|
60880
60893
|
args.add(arg);
|
|
60881
60894
|
}
|
|
60882
|
-
} else if (node.kind ===
|
|
60895
|
+
} else if (node.kind === graphql24.Kind.VARIABLE) {
|
|
60883
60896
|
args.delete(node.name.value);
|
|
60884
60897
|
}
|
|
60885
60898
|
},
|
|
60886
60899
|
leave(node) {
|
|
60887
|
-
if (node.kind ===
|
|
60900
|
+
if (node.kind === graphql24.Kind.FRAGMENT_DEFINITION) {
|
|
60888
60901
|
if (args.size > 0) {
|
|
60889
60902
|
ctx.reportError(
|
|
60890
|
-
new
|
|
60903
|
+
new graphql24.GraphQLError(
|
|
60891
60904
|
"Encountered unused fragment arguments: " + [...args].join(",")
|
|
60892
60905
|
)
|
|
60893
60906
|
);
|
|
@@ -60923,7 +60936,7 @@ function nodeDirectives(config2, directives) {
|
|
|
60923
60936
|
if (definition.kind === "OperationDefinition") {
|
|
60924
60937
|
if (definition.operation !== "query") {
|
|
60925
60938
|
ctx.reportError(
|
|
60926
|
-
new
|
|
60939
|
+
new graphql24.GraphQLError(
|
|
60927
60940
|
`@${node.name.value} must fall on a fragment or query document`
|
|
60928
60941
|
)
|
|
60929
60942
|
);
|
|
@@ -60935,7 +60948,7 @@ function nodeDirectives(config2, directives) {
|
|
|
60935
60948
|
}
|
|
60936
60949
|
if (!possibleNodes.includes(definitionType)) {
|
|
60937
60950
|
ctx.reportError(
|
|
60938
|
-
new
|
|
60951
|
+
new graphql24.GraphQLError(paginateOnNonNodeMessage(config2, node.name.value))
|
|
60939
60952
|
);
|
|
60940
60953
|
}
|
|
60941
60954
|
}
|
|
@@ -60954,7 +60967,7 @@ function checkMutationOperation(config2) {
|
|
|
60954
60967
|
);
|
|
60955
60968
|
if (append && prepend) {
|
|
60956
60969
|
ctx.reportError(
|
|
60957
|
-
new
|
|
60970
|
+
new graphql24.GraphQLError(
|
|
60958
60971
|
`You can't apply both @${config2.listPrependDirective} and @${config2.listAppendDirective} at the same time`
|
|
60959
60972
|
)
|
|
60960
60973
|
);
|
|
@@ -60968,7 +60981,7 @@ function checkMutationOperation(config2) {
|
|
|
60968
60981
|
);
|
|
60969
60982
|
if (parentId && allLists) {
|
|
60970
60983
|
ctx.reportError(
|
|
60971
|
-
new
|
|
60984
|
+
new graphql24.GraphQLError(
|
|
60972
60985
|
`You can't apply both @${config2.listParentDirective} and @${config2.listAllListsDirective} at the same time`
|
|
60973
60986
|
)
|
|
60974
60987
|
);
|
|
@@ -60990,7 +61003,7 @@ function checkMaskDirective(config2) {
|
|
|
60990
61003
|
);
|
|
60991
61004
|
if (maskEnableDirective && maskDisableDirective) {
|
|
60992
61005
|
ctx.reportError(
|
|
60993
|
-
new
|
|
61006
|
+
new graphql24.GraphQLError(
|
|
60994
61007
|
`You can't apply both @${config2.maskEnableDirective} and @${config2.maskDisableDirective} at the same time`
|
|
60995
61008
|
)
|
|
60996
61009
|
);
|
|
@@ -61006,7 +61019,7 @@ function getAndVerifyNodeInterface(config2) {
|
|
|
61006
61019
|
if (!nodeInterface) {
|
|
61007
61020
|
return null;
|
|
61008
61021
|
}
|
|
61009
|
-
if (!
|
|
61022
|
+
if (!graphql24.isInterfaceType(nodeInterface)) {
|
|
61010
61023
|
displayInvalidNodeFieldMessage(config2.logLevel);
|
|
61011
61024
|
return null;
|
|
61012
61025
|
}
|
|
@@ -61104,11 +61117,11 @@ async function uniqueDocumentNames(config2, docs) {
|
|
|
61104
61117
|
}
|
|
61105
61118
|
|
|
61106
61119
|
// src/codegen/validators/noIDAlias.ts
|
|
61107
|
-
var
|
|
61120
|
+
var graphql25 = __toESM(require_graphql2(), 1);
|
|
61108
61121
|
async function noIDAlias(config2, docs) {
|
|
61109
61122
|
const errors = [];
|
|
61110
61123
|
for (const { filename, document } of docs) {
|
|
61111
|
-
|
|
61124
|
+
graphql25.visit(document, {
|
|
61112
61125
|
Field(node, _, __, ___, ancestors) {
|
|
61113
61126
|
const fieldType = parentTypeFromAncestors(config2.schema, filename, ancestors).name;
|
|
61114
61127
|
if (config2.keyFieldsForType(fieldType).includes(node.alias?.value || "")) {
|
|
@@ -61538,7 +61551,7 @@ function pipelineTest(config2, documents, shouldPass, testBody) {
|
|
|
61538
61551
|
};
|
|
61539
61552
|
}
|
|
61540
61553
|
function mockCollectedDoc(query) {
|
|
61541
|
-
const parsed =
|
|
61554
|
+
const parsed = graphql26.parse(query);
|
|
61542
61555
|
const name2 = parsed.definitions[0].name.value;
|
|
61543
61556
|
const operations = parsed.definitions;
|
|
61544
61557
|
let kind = "HoudiniFragment" /* Fragment */;
|