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
|
@@ -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(
|
|
@@ -14709,9 +14709,9 @@ var require_graphql2 = __commonJS({
|
|
|
14709
14709
|
}
|
|
14710
14710
|
});
|
|
14711
14711
|
|
|
14712
|
-
// ../../node_modules/.pnpm/minimatch@5.1.
|
|
14712
|
+
// ../../node_modules/.pnpm/minimatch@5.1.2/node_modules/minimatch/lib/path.js
|
|
14713
14713
|
var require_path = __commonJS({
|
|
14714
|
-
"../../node_modules/.pnpm/minimatch@5.1.
|
|
14714
|
+
"../../node_modules/.pnpm/minimatch@5.1.2/node_modules/minimatch/lib/path.js"(exports, module2) {
|
|
14715
14715
|
var isWindows = typeof process === "object" && process && process.platform === "win32";
|
|
14716
14716
|
module2.exports = isWindows ? { sep: "\\" } : { sep: "/" };
|
|
14717
14717
|
}
|
|
@@ -14928,9 +14928,9 @@ var require_brace_expansion = __commonJS({
|
|
|
14928
14928
|
}
|
|
14929
14929
|
});
|
|
14930
14930
|
|
|
14931
|
-
// ../../node_modules/.pnpm/minimatch@5.1.
|
|
14931
|
+
// ../../node_modules/.pnpm/minimatch@5.1.2/node_modules/minimatch/minimatch.js
|
|
14932
14932
|
var require_minimatch = __commonJS({
|
|
14933
|
-
"../../node_modules/.pnpm/minimatch@5.1.
|
|
14933
|
+
"../../node_modules/.pnpm/minimatch@5.1.2/node_modules/minimatch/minimatch.js"(exports, module2) {
|
|
14934
14934
|
var minimatch2 = module2.exports = (p, pattern, options = {}) => {
|
|
14935
14935
|
assertValidPattern(pattern);
|
|
14936
14936
|
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
@@ -15016,7 +15016,9 @@ var require_minimatch = __commonJS({
|
|
|
15016
15016
|
return list;
|
|
15017
15017
|
};
|
|
15018
15018
|
var globUnescape = (s) => s.replace(/\\(.)/g, "$1");
|
|
15019
|
+
var charUnescape = (s) => s.replace(/\\([^-\]])/g, "$1");
|
|
15019
15020
|
var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
15021
|
+
var braExpEscape = (s) => s.replace(/[[\]\\]/g, "\\$&");
|
|
15020
15022
|
var Minimatch = class {
|
|
15021
15023
|
constructor(pattern, options) {
|
|
15022
15024
|
assertValidPattern(pattern);
|
|
@@ -15208,6 +15210,10 @@ var require_minimatch = __commonJS({
|
|
|
15208
15210
|
return false;
|
|
15209
15211
|
}
|
|
15210
15212
|
case "\\":
|
|
15213
|
+
if (inClass && pattern.charAt(i + 1) === "-") {
|
|
15214
|
+
re += c;
|
|
15215
|
+
continue;
|
|
15216
|
+
}
|
|
15211
15217
|
clearStateChar();
|
|
15212
15218
|
escaping = true;
|
|
15213
15219
|
continue;
|
|
@@ -15290,17 +15296,13 @@ var require_minimatch = __commonJS({
|
|
|
15290
15296
|
}
|
|
15291
15297
|
cs = pattern.substring(classStart + 1, i);
|
|
15292
15298
|
try {
|
|
15293
|
-
RegExp("[" + cs + "]");
|
|
15299
|
+
RegExp("[" + braExpEscape(charUnescape(cs)) + "]");
|
|
15300
|
+
re += c;
|
|
15294
15301
|
} catch (er) {
|
|
15295
|
-
|
|
15296
|
-
re = re.substring(0, reClassStart) + "\\[" + sp[0] + "\\]";
|
|
15297
|
-
hasMagic = hasMagic || sp[1];
|
|
15298
|
-
inClass = false;
|
|
15299
|
-
continue;
|
|
15302
|
+
re = re.substring(0, reClassStart) + "(?:$.)";
|
|
15300
15303
|
}
|
|
15301
15304
|
hasMagic = true;
|
|
15302
15305
|
inClass = false;
|
|
15303
|
-
re += c;
|
|
15304
15306
|
continue;
|
|
15305
15307
|
default:
|
|
15306
15308
|
clearStateChar();
|
|
@@ -23127,9 +23129,9 @@ var require_lib2 = __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") {
|
|
@@ -53923,7 +53939,7 @@ __export(codegen_exports, {
|
|
|
53923
53939
|
runPipeline: () => runPipeline2
|
|
53924
53940
|
});
|
|
53925
53941
|
module.exports = __toCommonJS(codegen_exports);
|
|
53926
|
-
var
|
|
53942
|
+
var graphql26 = __toESM(require_graphql2(), 1);
|
|
53927
53943
|
|
|
53928
53944
|
// src/lib/pipeline.ts
|
|
53929
53945
|
async function runPipeline(config2, pipeline, target) {
|
|
@@ -56081,6 +56097,60 @@ function definitionFromAncestors(ancestors) {
|
|
|
56081
56097
|
}
|
|
56082
56098
|
return definition;
|
|
56083
56099
|
}
|
|
56100
|
+
function unwrapType(config2, type, wrappers = []) {
|
|
56101
|
+
if (type.kind === "NonNullType") {
|
|
56102
|
+
return unwrapType(config2, type.type, [TypeWrapper.NonNull, ...wrappers]);
|
|
56103
|
+
}
|
|
56104
|
+
if (type instanceof graphql.GraphQLNonNull) {
|
|
56105
|
+
return unwrapType(config2, type.ofType, [TypeWrapper.NonNull, ...wrappers]);
|
|
56106
|
+
}
|
|
56107
|
+
if (wrappers[0] !== TypeWrapper.NonNull) {
|
|
56108
|
+
wrappers.unshift(TypeWrapper.Nullable);
|
|
56109
|
+
}
|
|
56110
|
+
if (type.kind === "ListType") {
|
|
56111
|
+
return unwrapType(config2, type.type, [TypeWrapper.List, ...wrappers]);
|
|
56112
|
+
}
|
|
56113
|
+
if (type instanceof graphql.GraphQLList) {
|
|
56114
|
+
return unwrapType(config2, type.ofType, [TypeWrapper.List, ...wrappers]);
|
|
56115
|
+
}
|
|
56116
|
+
const namedType = config2.schema.getType(type.name.value || type.name);
|
|
56117
|
+
if (!namedType) {
|
|
56118
|
+
throw new Error("Could not unwrap type: " + JSON.stringify(type));
|
|
56119
|
+
}
|
|
56120
|
+
return { type: namedType, wrappers };
|
|
56121
|
+
}
|
|
56122
|
+
function wrapType({
|
|
56123
|
+
type,
|
|
56124
|
+
wrappers
|
|
56125
|
+
}) {
|
|
56126
|
+
const head = wrappers[0];
|
|
56127
|
+
const tail = wrappers.slice(1);
|
|
56128
|
+
let kind = graphql.Kind.NAMED_TYPE;
|
|
56129
|
+
if (head === TypeWrapper.List) {
|
|
56130
|
+
kind = graphql.Kind.LIST_TYPE;
|
|
56131
|
+
} else if (head === TypeWrapper.NonNull) {
|
|
56132
|
+
kind = graphql.Kind.NON_NULL_TYPE;
|
|
56133
|
+
}
|
|
56134
|
+
if (kind === "NamedType") {
|
|
56135
|
+
return {
|
|
56136
|
+
kind,
|
|
56137
|
+
name: {
|
|
56138
|
+
kind: graphql.Kind.NAME,
|
|
56139
|
+
value: type.name
|
|
56140
|
+
}
|
|
56141
|
+
};
|
|
56142
|
+
}
|
|
56143
|
+
return {
|
|
56144
|
+
kind,
|
|
56145
|
+
type: wrapType({ type, wrappers: tail })
|
|
56146
|
+
};
|
|
56147
|
+
}
|
|
56148
|
+
var TypeWrapper = /* @__PURE__ */ ((TypeWrapper2) => {
|
|
56149
|
+
TypeWrapper2["Nullable"] = "Nullable";
|
|
56150
|
+
TypeWrapper2["List"] = "List";
|
|
56151
|
+
TypeWrapper2["NonNull"] = "NonNull";
|
|
56152
|
+
return TypeWrapper2;
|
|
56153
|
+
})(TypeWrapper || {});
|
|
56084
56154
|
|
|
56085
56155
|
// src/lib/parse.ts
|
|
56086
56156
|
var import_parser = __toESM(require_lib3(), 1);
|
|
@@ -56325,7 +56395,7 @@ async function find_graphql(config2, parsedScript, walker) {
|
|
|
56325
56395
|
}
|
|
56326
56396
|
|
|
56327
56397
|
// src/codegen/generators/artifacts/index.ts
|
|
56328
|
-
var
|
|
56398
|
+
var graphql11 = __toESM(require_graphql2(), 1);
|
|
56329
56399
|
var recast5 = __toESM(require_main2(), 1);
|
|
56330
56400
|
|
|
56331
56401
|
// src/codegen/utils/commonjs.ts
|
|
@@ -56501,63 +56571,6 @@ var FieldCollection = class {
|
|
|
56501
56571
|
}
|
|
56502
56572
|
};
|
|
56503
56573
|
|
|
56504
|
-
// src/codegen/utils/graphql.ts
|
|
56505
|
-
var graphql3 = __toESM(require_graphql2(), 1);
|
|
56506
|
-
function unwrapType(config2, type, wrappers = []) {
|
|
56507
|
-
if (type.kind === "NonNullType") {
|
|
56508
|
-
return unwrapType(config2, type.type, [TypeWrapper.NonNull, ...wrappers]);
|
|
56509
|
-
}
|
|
56510
|
-
if (type instanceof graphql3.GraphQLNonNull) {
|
|
56511
|
-
return unwrapType(config2, type.ofType, [TypeWrapper.NonNull, ...wrappers]);
|
|
56512
|
-
}
|
|
56513
|
-
if (wrappers[0] !== TypeWrapper.NonNull) {
|
|
56514
|
-
wrappers.unshift(TypeWrapper.Nullable);
|
|
56515
|
-
}
|
|
56516
|
-
if (type.kind === "ListType") {
|
|
56517
|
-
return unwrapType(config2, type.type, [TypeWrapper.List, ...wrappers]);
|
|
56518
|
-
}
|
|
56519
|
-
if (type instanceof graphql3.GraphQLList) {
|
|
56520
|
-
return unwrapType(config2, type.ofType, [TypeWrapper.List, ...wrappers]);
|
|
56521
|
-
}
|
|
56522
|
-
const namedType = config2.schema.getType(type.name.value || type.name);
|
|
56523
|
-
if (!namedType) {
|
|
56524
|
-
throw new Error("Could not unwrap type: " + JSON.stringify(type));
|
|
56525
|
-
}
|
|
56526
|
-
return { type: namedType, wrappers };
|
|
56527
|
-
}
|
|
56528
|
-
function wrapType({
|
|
56529
|
-
type,
|
|
56530
|
-
wrappers
|
|
56531
|
-
}) {
|
|
56532
|
-
const head = wrappers[0];
|
|
56533
|
-
const tail = wrappers.slice(1);
|
|
56534
|
-
let kind = graphql3.Kind.NAMED_TYPE;
|
|
56535
|
-
if (head === TypeWrapper.List) {
|
|
56536
|
-
kind = graphql3.Kind.LIST_TYPE;
|
|
56537
|
-
} else if (head === TypeWrapper.NonNull) {
|
|
56538
|
-
kind = graphql3.Kind.NON_NULL_TYPE;
|
|
56539
|
-
}
|
|
56540
|
-
if (kind === "NamedType") {
|
|
56541
|
-
return {
|
|
56542
|
-
kind,
|
|
56543
|
-
name: {
|
|
56544
|
-
kind: graphql3.Kind.NAME,
|
|
56545
|
-
value: type.name
|
|
56546
|
-
}
|
|
56547
|
-
};
|
|
56548
|
-
}
|
|
56549
|
-
return {
|
|
56550
|
-
kind,
|
|
56551
|
-
type: wrapType({ type, wrappers: tail })
|
|
56552
|
-
};
|
|
56553
|
-
}
|
|
56554
|
-
var TypeWrapper = /* @__PURE__ */ ((TypeWrapper2) => {
|
|
56555
|
-
TypeWrapper2["Nullable"] = "Nullable";
|
|
56556
|
-
TypeWrapper2["List"] = "List";
|
|
56557
|
-
TypeWrapper2["NonNull"] = "NonNull";
|
|
56558
|
-
return TypeWrapper2;
|
|
56559
|
-
})(TypeWrapper || {});
|
|
56560
|
-
|
|
56561
56574
|
// src/codegen/utils/moduleExport.ts
|
|
56562
56575
|
var recast2 = __toESM(require_main2(), 1);
|
|
56563
56576
|
var AST2 = recast2.types.builders;
|
|
@@ -56644,7 +56657,7 @@ ${exportDefaultFrom(`./${doc.name}`, doc.name)}`,
|
|
|
56644
56657
|
}
|
|
56645
56658
|
|
|
56646
56659
|
// src/codegen/generators/artifacts/inputs.ts
|
|
56647
|
-
var
|
|
56660
|
+
var graphql3 = __toESM(require_graphql2(), 1);
|
|
56648
56661
|
var recast3 = __toESM(require_main2(), 1);
|
|
56649
56662
|
var AST3 = recast3.types.builders;
|
|
56650
56663
|
function inputObject(config2, inputs) {
|
|
@@ -56669,10 +56682,10 @@ function walkInputs(config2, visitedTypes, inputObj, rootType) {
|
|
|
56669
56682
|
if (visitedTypes.has(type.name)) {
|
|
56670
56683
|
return;
|
|
56671
56684
|
}
|
|
56672
|
-
if (
|
|
56685
|
+
if (graphql3.isEnumType(type) || graphql3.isScalarType(type)) {
|
|
56673
56686
|
return;
|
|
56674
56687
|
}
|
|
56675
|
-
if (
|
|
56688
|
+
if (graphql3.isUnionType(type)) {
|
|
56676
56689
|
return;
|
|
56677
56690
|
}
|
|
56678
56691
|
visitedTypes.add(type.name);
|
|
@@ -56690,10 +56703,10 @@ function walkInputs(config2, visitedTypes, inputObj, rootType) {
|
|
|
56690
56703
|
}
|
|
56691
56704
|
|
|
56692
56705
|
// src/codegen/generators/artifacts/operations.ts
|
|
56693
|
-
var
|
|
56706
|
+
var graphql5 = __toESM(require_graphql2(), 1);
|
|
56694
56707
|
|
|
56695
56708
|
// src/codegen/generators/artifacts/utils.ts
|
|
56696
|
-
var
|
|
56709
|
+
var graphql4 = __toESM(require_graphql2(), 1);
|
|
56697
56710
|
var recast4 = __toESM(require_main2(), 1);
|
|
56698
56711
|
var AST4 = recast4.types.builders;
|
|
56699
56712
|
function serializeValue(value) {
|
|
@@ -56745,19 +56758,19 @@ function deepMerge(filepath, ...targets) {
|
|
|
56745
56758
|
function convertValue(config2, val) {
|
|
56746
56759
|
let value;
|
|
56747
56760
|
let kind;
|
|
56748
|
-
if (val.kind ===
|
|
56761
|
+
if (val.kind === graphql4.Kind.INT) {
|
|
56749
56762
|
value = parseInt(val.value, 10);
|
|
56750
56763
|
kind = "Int";
|
|
56751
|
-
} else if (val.kind ===
|
|
56764
|
+
} else if (val.kind === graphql4.Kind.FLOAT) {
|
|
56752
56765
|
value = parseFloat(val.value);
|
|
56753
56766
|
kind = "Float";
|
|
56754
|
-
} else if (val.kind ===
|
|
56767
|
+
} else if (val.kind === graphql4.Kind.BOOLEAN) {
|
|
56755
56768
|
value = val.value;
|
|
56756
56769
|
kind = "Boolean";
|
|
56757
|
-
} else if (val.kind ===
|
|
56770
|
+
} else if (val.kind === graphql4.Kind.VARIABLE) {
|
|
56758
56771
|
value = val.name.value;
|
|
56759
56772
|
kind = "Variable";
|
|
56760
|
-
} else if (val.kind ===
|
|
56773
|
+
} else if (val.kind === graphql4.Kind.STRING) {
|
|
56761
56774
|
value = val.value;
|
|
56762
56775
|
kind = "String";
|
|
56763
56776
|
}
|
|
@@ -56770,7 +56783,7 @@ function operationsByPath(config2, filepath, definition, filterTypes) {
|
|
|
56770
56783
|
return {};
|
|
56771
56784
|
}
|
|
56772
56785
|
const pathOperations = {};
|
|
56773
|
-
|
|
56786
|
+
graphql5.visit(definition, {
|
|
56774
56787
|
FragmentSpread(node, _, __, ___, ancestors) {
|
|
56775
56788
|
if (!config2.isListFragment(node.name.value)) {
|
|
56776
56789
|
return;
|
|
@@ -56929,7 +56942,7 @@ function ancestorKey(ancestors) {
|
|
|
56929
56942
|
}
|
|
56930
56943
|
|
|
56931
56944
|
// src/codegen/generators/artifacts/selection.ts
|
|
56932
|
-
var
|
|
56945
|
+
var graphql10 = __toESM(require_graphql2(), 1);
|
|
56933
56946
|
|
|
56934
56947
|
// ../../node_modules/.pnpm/@kitql+helper@0.5.0/node_modules/@kitql/helper/index.mjs
|
|
56935
56948
|
var config = {
|
|
@@ -56969,16 +56982,16 @@ function logYellow(str) {
|
|
|
56969
56982
|
}
|
|
56970
56983
|
|
|
56971
56984
|
// src/codegen/transforms/list.ts
|
|
56972
|
-
var
|
|
56985
|
+
var graphql8 = __toESM(require_graphql2(), 1);
|
|
56973
56986
|
|
|
56974
56987
|
// src/codegen/utils/objectIdentificationSelection.ts
|
|
56975
|
-
var
|
|
56988
|
+
var graphql6 = __toESM(require_graphql2(), 1);
|
|
56976
56989
|
var objectIdentificationSelection = (config2, type) => {
|
|
56977
56990
|
return config2.keyFieldsForType(type.name).map((key) => {
|
|
56978
56991
|
return {
|
|
56979
|
-
kind:
|
|
56992
|
+
kind: graphql6.Kind.FIELD,
|
|
56980
56993
|
name: {
|
|
56981
|
-
kind:
|
|
56994
|
+
kind: graphql6.Kind.NAME,
|
|
56982
56995
|
value: key
|
|
56983
56996
|
}
|
|
56984
56997
|
};
|
|
@@ -56986,7 +56999,7 @@ var objectIdentificationSelection = (config2, type) => {
|
|
|
56986
56999
|
};
|
|
56987
57000
|
|
|
56988
57001
|
// src/codegen/transforms/paginate.ts
|
|
56989
|
-
var
|
|
57002
|
+
var graphql7 = __toESM(require_graphql2(), 1);
|
|
56990
57003
|
async function paginate(config2, documents) {
|
|
56991
57004
|
const newDocs = [];
|
|
56992
57005
|
for (const doc of documents) {
|
|
@@ -57019,7 +57032,7 @@ async function paginate(config2, documents) {
|
|
|
57019
57032
|
};
|
|
57020
57033
|
let cursorType = "String";
|
|
57021
57034
|
let paginationPath = [];
|
|
57022
|
-
doc.document =
|
|
57035
|
+
doc.document = graphql7.visit(doc.document, {
|
|
57023
57036
|
Field(node, _, __, ___, ancestors) {
|
|
57024
57037
|
const paginateDirective = node.directives?.find(
|
|
57025
57038
|
(directive) => directive.name.value === config2.paginateDirective
|
|
@@ -57046,7 +57059,7 @@ async function paginate(config2, documents) {
|
|
|
57046
57059
|
flags.offset.enabled = offsetPagination;
|
|
57047
57060
|
flags.limit.enabled = offsetPagination;
|
|
57048
57061
|
paginationPath = ancestors.filter(
|
|
57049
|
-
(ancestor) => !Array.isArray(ancestor) && ancestor.kind ===
|
|
57062
|
+
(ancestor) => !Array.isArray(ancestor) && ancestor.kind === graphql7.Kind.FIELD
|
|
57050
57063
|
).concat(node).map((field) => field.alias?.value || field.name.value);
|
|
57051
57064
|
return {
|
|
57052
57065
|
...node,
|
|
@@ -57067,7 +57080,7 @@ async function paginate(config2, documents) {
|
|
|
57067
57080
|
refetchUpdate = "prepend" /* prepend */;
|
|
57068
57081
|
}
|
|
57069
57082
|
let fragment = "";
|
|
57070
|
-
doc.document =
|
|
57083
|
+
doc.document = graphql7.visit(doc.document, {
|
|
57071
57084
|
OperationDefinition(node) {
|
|
57072
57085
|
if (node.operation !== "query") {
|
|
57073
57086
|
throw new HoudiniError({
|
|
@@ -57121,9 +57134,9 @@ async function paginate(config2, documents) {
|
|
|
57121
57134
|
directives: [
|
|
57122
57135
|
...node.directives || [],
|
|
57123
57136
|
{
|
|
57124
|
-
kind:
|
|
57137
|
+
kind: graphql7.Kind.DIRECTIVE,
|
|
57125
57138
|
name: {
|
|
57126
|
-
kind:
|
|
57139
|
+
kind: graphql7.Kind.NAME,
|
|
57127
57140
|
value: config2.argumentsDirective
|
|
57128
57141
|
}
|
|
57129
57142
|
}
|
|
@@ -57186,16 +57199,16 @@ async function paginate(config2, documents) {
|
|
|
57186
57199
|
const paginationArgs = Object.entries(flags).filter(([_, { enabled }]) => enabled).map(([key, value]) => ({ name: key, ...value }));
|
|
57187
57200
|
const fragmentSpreadSelection = [
|
|
57188
57201
|
{
|
|
57189
|
-
kind:
|
|
57202
|
+
kind: graphql7.Kind.FRAGMENT_SPREAD,
|
|
57190
57203
|
name: {
|
|
57191
|
-
kind:
|
|
57204
|
+
kind: graphql7.Kind.NAME,
|
|
57192
57205
|
value: fragmentName
|
|
57193
57206
|
},
|
|
57194
57207
|
directives: [
|
|
57195
57208
|
{
|
|
57196
|
-
kind:
|
|
57209
|
+
kind: graphql7.Kind.DIRECTIVE,
|
|
57197
57210
|
name: {
|
|
57198
|
-
kind:
|
|
57211
|
+
kind: graphql7.Kind.NAME,
|
|
57199
57212
|
value: config2.withDirective
|
|
57200
57213
|
},
|
|
57201
57214
|
["arguments"]: paginationArgs.map(
|
|
@@ -57223,29 +57236,29 @@ async function paginate(config2, documents) {
|
|
|
57223
57236
|
});
|
|
57224
57237
|
const typeConfig = config2.typeConfig?.[fragment];
|
|
57225
57238
|
const queryDoc = {
|
|
57226
|
-
kind:
|
|
57239
|
+
kind: graphql7.Kind.DOCUMENT,
|
|
57227
57240
|
definitions: [
|
|
57228
57241
|
{
|
|
57229
|
-
kind:
|
|
57242
|
+
kind: graphql7.Kind.OPERATION_DEFINITION,
|
|
57230
57243
|
name: {
|
|
57231
|
-
kind:
|
|
57244
|
+
kind: graphql7.Kind.NAME,
|
|
57232
57245
|
value: refetchQueryName
|
|
57233
57246
|
},
|
|
57234
57247
|
operation: "query",
|
|
57235
57248
|
variableDefinitions: paginationArgs.map(
|
|
57236
57249
|
(arg) => ({
|
|
57237
|
-
kind:
|
|
57250
|
+
kind: graphql7.Kind.VARIABLE_DEFINITION,
|
|
57238
57251
|
type: {
|
|
57239
|
-
kind:
|
|
57252
|
+
kind: graphql7.Kind.NAMED_TYPE,
|
|
57240
57253
|
name: {
|
|
57241
|
-
kind:
|
|
57254
|
+
kind: graphql7.Kind.NAME,
|
|
57242
57255
|
value: arg.type
|
|
57243
57256
|
}
|
|
57244
57257
|
},
|
|
57245
57258
|
variable: {
|
|
57246
|
-
kind:
|
|
57259
|
+
kind: graphql7.Kind.VARIABLE,
|
|
57247
57260
|
name: {
|
|
57248
|
-
kind:
|
|
57261
|
+
kind: graphql7.Kind.NAME,
|
|
57249
57262
|
value: arg.name
|
|
57250
57263
|
}
|
|
57251
57264
|
},
|
|
@@ -57257,12 +57270,12 @@ async function paginate(config2, documents) {
|
|
|
57257
57270
|
).concat(
|
|
57258
57271
|
!nodeQuery ? [] : keys.map(
|
|
57259
57272
|
(key) => ({
|
|
57260
|
-
kind:
|
|
57273
|
+
kind: graphql7.Kind.VARIABLE_DEFINITION,
|
|
57261
57274
|
type: key.type,
|
|
57262
57275
|
variable: {
|
|
57263
|
-
kind:
|
|
57276
|
+
kind: graphql7.Kind.VARIABLE,
|
|
57264
57277
|
name: {
|
|
57265
|
-
kind:
|
|
57278
|
+
kind: graphql7.Kind.NAME,
|
|
57266
57279
|
value: key.name
|
|
57267
57280
|
}
|
|
57268
57281
|
}
|
|
@@ -57270,42 +57283,42 @@ async function paginate(config2, documents) {
|
|
|
57270
57283
|
)
|
|
57271
57284
|
),
|
|
57272
57285
|
selectionSet: {
|
|
57273
|
-
kind:
|
|
57286
|
+
kind: graphql7.Kind.SELECTION_SET,
|
|
57274
57287
|
selections: !nodeQuery ? fragmentSpreadSelection : [
|
|
57275
57288
|
{
|
|
57276
|
-
kind:
|
|
57289
|
+
kind: graphql7.Kind.FIELD,
|
|
57277
57290
|
name: {
|
|
57278
|
-
kind:
|
|
57291
|
+
kind: graphql7.Kind.NAME,
|
|
57279
57292
|
value: typeConfig?.resolve?.queryField || "node"
|
|
57280
57293
|
},
|
|
57281
57294
|
["arguments"]: keys.map((key) => ({
|
|
57282
|
-
kind:
|
|
57295
|
+
kind: graphql7.Kind.ARGUMENT,
|
|
57283
57296
|
name: {
|
|
57284
|
-
kind:
|
|
57297
|
+
kind: graphql7.Kind.NAME,
|
|
57285
57298
|
value: key.name
|
|
57286
57299
|
},
|
|
57287
57300
|
value: {
|
|
57288
|
-
kind:
|
|
57301
|
+
kind: graphql7.Kind.VARIABLE,
|
|
57289
57302
|
name: {
|
|
57290
|
-
kind:
|
|
57303
|
+
kind: graphql7.Kind.NAME,
|
|
57291
57304
|
value: key.name
|
|
57292
57305
|
}
|
|
57293
57306
|
}
|
|
57294
57307
|
})),
|
|
57295
57308
|
selectionSet: {
|
|
57296
|
-
kind:
|
|
57309
|
+
kind: graphql7.Kind.SELECTION_SET,
|
|
57297
57310
|
selections: [
|
|
57298
57311
|
{
|
|
57299
|
-
kind:
|
|
57312
|
+
kind: graphql7.Kind.FIELD,
|
|
57300
57313
|
name: {
|
|
57301
|
-
kind:
|
|
57314
|
+
kind: graphql7.Kind.NAME,
|
|
57302
57315
|
value: "__typename"
|
|
57303
57316
|
}
|
|
57304
57317
|
},
|
|
57305
57318
|
...(typeConfig?.keys || ["id"]).map((key) => ({
|
|
57306
|
-
kind:
|
|
57319
|
+
kind: graphql7.Kind.FIELD,
|
|
57307
57320
|
name: {
|
|
57308
|
-
kind:
|
|
57321
|
+
kind: graphql7.Kind.NAME,
|
|
57309
57322
|
value: key
|
|
57310
57323
|
}
|
|
57311
57324
|
})),
|
|
@@ -57367,15 +57380,15 @@ function replaceArgumentsWithVariables(args, flags) {
|
|
|
57367
57380
|
}
|
|
57368
57381
|
function variableAsArgument(name2, variable) {
|
|
57369
57382
|
return {
|
|
57370
|
-
kind:
|
|
57383
|
+
kind: graphql7.Kind.ARGUMENT,
|
|
57371
57384
|
name: {
|
|
57372
|
-
kind:
|
|
57385
|
+
kind: graphql7.Kind.NAME,
|
|
57373
57386
|
value: name2
|
|
57374
57387
|
},
|
|
57375
57388
|
value: {
|
|
57376
|
-
kind:
|
|
57389
|
+
kind: graphql7.Kind.VARIABLE,
|
|
57377
57390
|
name: {
|
|
57378
|
-
kind:
|
|
57391
|
+
kind: graphql7.Kind.NAME,
|
|
57379
57392
|
value: variable ?? name2
|
|
57380
57393
|
}
|
|
57381
57394
|
}
|
|
@@ -57383,18 +57396,18 @@ function variableAsArgument(name2, variable) {
|
|
|
57383
57396
|
}
|
|
57384
57397
|
function staticVariableDefinition(name2, type, defaultValue, variableName) {
|
|
57385
57398
|
return {
|
|
57386
|
-
kind:
|
|
57399
|
+
kind: graphql7.Kind.VARIABLE_DEFINITION,
|
|
57387
57400
|
type: {
|
|
57388
|
-
kind:
|
|
57401
|
+
kind: graphql7.Kind.NAMED_TYPE,
|
|
57389
57402
|
name: {
|
|
57390
|
-
kind:
|
|
57403
|
+
kind: graphql7.Kind.NAME,
|
|
57391
57404
|
value: type
|
|
57392
57405
|
}
|
|
57393
57406
|
},
|
|
57394
57407
|
variable: {
|
|
57395
|
-
kind:
|
|
57408
|
+
kind: graphql7.Kind.VARIABLE,
|
|
57396
57409
|
name: {
|
|
57397
|
-
kind:
|
|
57410
|
+
kind: graphql7.Kind.NAME,
|
|
57398
57411
|
value: variableName ?? name2
|
|
57399
57412
|
}
|
|
57400
57413
|
},
|
|
@@ -57406,9 +57419,9 @@ function staticVariableDefinition(name2, type, defaultValue, variableName) {
|
|
|
57406
57419
|
}
|
|
57407
57420
|
function argumentNode(name2, value) {
|
|
57408
57421
|
return {
|
|
57409
|
-
kind:
|
|
57422
|
+
kind: graphql7.Kind.ARGUMENT,
|
|
57410
57423
|
name: {
|
|
57411
|
-
kind:
|
|
57424
|
+
kind: graphql7.Kind.NAME,
|
|
57412
57425
|
value: name2
|
|
57413
57426
|
},
|
|
57414
57427
|
value: objectNode(value)
|
|
@@ -57416,16 +57429,16 @@ function argumentNode(name2, value) {
|
|
|
57416
57429
|
}
|
|
57417
57430
|
function objectNode([type, defaultValue]) {
|
|
57418
57431
|
const node = {
|
|
57419
|
-
kind:
|
|
57432
|
+
kind: graphql7.Kind.OBJECT,
|
|
57420
57433
|
fields: [
|
|
57421
57434
|
{
|
|
57422
|
-
kind:
|
|
57435
|
+
kind: graphql7.Kind.OBJECT_FIELD,
|
|
57423
57436
|
name: {
|
|
57424
|
-
kind:
|
|
57437
|
+
kind: graphql7.Kind.NAME,
|
|
57425
57438
|
value: "type"
|
|
57426
57439
|
},
|
|
57427
57440
|
value: {
|
|
57428
|
-
kind:
|
|
57441
|
+
kind: graphql7.Kind.STRING,
|
|
57429
57442
|
value: type
|
|
57430
57443
|
}
|
|
57431
57444
|
}
|
|
@@ -57433,8 +57446,8 @@ function objectNode([type, defaultValue]) {
|
|
|
57433
57446
|
};
|
|
57434
57447
|
if (defaultValue) {
|
|
57435
57448
|
node.fields.push({
|
|
57436
|
-
kind:
|
|
57437
|
-
name: { kind:
|
|
57449
|
+
kind: graphql7.Kind.OBJECT_FIELD,
|
|
57450
|
+
name: { kind: graphql7.Kind.NAME, value: "default" },
|
|
57438
57451
|
value: {
|
|
57439
57452
|
kind: typeof defaultValue === "number" ? "IntValue" : "StringValue",
|
|
57440
57453
|
value: defaultValue.toString()
|
|
@@ -57445,34 +57458,34 @@ function objectNode([type, defaultValue]) {
|
|
|
57445
57458
|
}
|
|
57446
57459
|
var pageInfoSelection = [
|
|
57447
57460
|
{
|
|
57448
|
-
kind:
|
|
57461
|
+
kind: graphql7.Kind.FIELD,
|
|
57449
57462
|
name: {
|
|
57450
|
-
kind:
|
|
57463
|
+
kind: graphql7.Kind.NAME,
|
|
57451
57464
|
value: "edges"
|
|
57452
57465
|
},
|
|
57453
57466
|
selectionSet: {
|
|
57454
|
-
kind:
|
|
57467
|
+
kind: graphql7.Kind.SELECTION_SET,
|
|
57455
57468
|
selections: [
|
|
57456
57469
|
{
|
|
57457
|
-
kind:
|
|
57470
|
+
kind: graphql7.Kind.FIELD,
|
|
57458
57471
|
name: {
|
|
57459
|
-
kind:
|
|
57472
|
+
kind: graphql7.Kind.NAME,
|
|
57460
57473
|
value: "cursor"
|
|
57461
57474
|
}
|
|
57462
57475
|
},
|
|
57463
57476
|
{
|
|
57464
|
-
kind:
|
|
57477
|
+
kind: graphql7.Kind.FIELD,
|
|
57465
57478
|
name: {
|
|
57466
|
-
kind:
|
|
57479
|
+
kind: graphql7.Kind.NAME,
|
|
57467
57480
|
value: "node"
|
|
57468
57481
|
},
|
|
57469
57482
|
selectionSet: {
|
|
57470
|
-
kind:
|
|
57483
|
+
kind: graphql7.Kind.SELECTION_SET,
|
|
57471
57484
|
selections: [
|
|
57472
57485
|
{
|
|
57473
|
-
kind:
|
|
57486
|
+
kind: graphql7.Kind.FIELD,
|
|
57474
57487
|
name: {
|
|
57475
|
-
kind:
|
|
57488
|
+
kind: graphql7.Kind.NAME,
|
|
57476
57489
|
value: "__typename"
|
|
57477
57490
|
}
|
|
57478
57491
|
}
|
|
@@ -57483,39 +57496,39 @@ var pageInfoSelection = [
|
|
|
57483
57496
|
}
|
|
57484
57497
|
},
|
|
57485
57498
|
{
|
|
57486
|
-
kind:
|
|
57499
|
+
kind: graphql7.Kind.FIELD,
|
|
57487
57500
|
name: {
|
|
57488
|
-
kind:
|
|
57501
|
+
kind: graphql7.Kind.NAME,
|
|
57489
57502
|
value: "pageInfo"
|
|
57490
57503
|
},
|
|
57491
57504
|
selectionSet: {
|
|
57492
|
-
kind:
|
|
57505
|
+
kind: graphql7.Kind.SELECTION_SET,
|
|
57493
57506
|
selections: [
|
|
57494
57507
|
{
|
|
57495
|
-
kind:
|
|
57508
|
+
kind: graphql7.Kind.FIELD,
|
|
57496
57509
|
name: {
|
|
57497
|
-
kind:
|
|
57510
|
+
kind: graphql7.Kind.NAME,
|
|
57498
57511
|
value: "hasPreviousPage"
|
|
57499
57512
|
}
|
|
57500
57513
|
},
|
|
57501
57514
|
{
|
|
57502
|
-
kind:
|
|
57515
|
+
kind: graphql7.Kind.FIELD,
|
|
57503
57516
|
name: {
|
|
57504
|
-
kind:
|
|
57517
|
+
kind: graphql7.Kind.NAME,
|
|
57505
57518
|
value: "hasNextPage"
|
|
57506
57519
|
}
|
|
57507
57520
|
},
|
|
57508
57521
|
{
|
|
57509
|
-
kind:
|
|
57522
|
+
kind: graphql7.Kind.FIELD,
|
|
57510
57523
|
name: {
|
|
57511
|
-
kind:
|
|
57524
|
+
kind: graphql7.Kind.NAME,
|
|
57512
57525
|
value: "startCursor"
|
|
57513
57526
|
}
|
|
57514
57527
|
},
|
|
57515
57528
|
{
|
|
57516
|
-
kind:
|
|
57529
|
+
kind: graphql7.Kind.FIELD,
|
|
57517
57530
|
name: {
|
|
57518
|
-
kind:
|
|
57531
|
+
kind: graphql7.Kind.NAME,
|
|
57519
57532
|
value: "endCursor"
|
|
57520
57533
|
}
|
|
57521
57534
|
}
|
|
@@ -57529,15 +57542,15 @@ async function addListFragments(config2, documents) {
|
|
|
57529
57542
|
const lists = {};
|
|
57530
57543
|
const errors = [];
|
|
57531
57544
|
for (const doc of documents) {
|
|
57532
|
-
doc.document =
|
|
57545
|
+
doc.document = graphql8.visit(doc.document, {
|
|
57533
57546
|
Directive(node, key, parent, path2, ancestors) {
|
|
57534
57547
|
if ([config2.listDirective, config2.paginateDirective].includes(node.name.value)) {
|
|
57535
57548
|
const nameArg = node.arguments?.find((arg) => arg.name.value === "name");
|
|
57536
57549
|
let error = {
|
|
57537
|
-
...new
|
|
57550
|
+
...new graphql8.GraphQLError(
|
|
57538
57551
|
"",
|
|
57539
57552
|
node,
|
|
57540
|
-
new
|
|
57553
|
+
new graphql8.Source(""),
|
|
57541
57554
|
node.loc ? [node.loc.start, node.loc.end] : null,
|
|
57542
57555
|
path2
|
|
57543
57556
|
),
|
|
@@ -57589,7 +57602,7 @@ async function addListFragments(config2, documents) {
|
|
|
57589
57602
|
{
|
|
57590
57603
|
kind: "Argument",
|
|
57591
57604
|
name: {
|
|
57592
|
-
kind:
|
|
57605
|
+
kind: graphql8.Kind.NAME,
|
|
57593
57606
|
value: "connection"
|
|
57594
57607
|
},
|
|
57595
57608
|
value: {
|
|
@@ -57639,7 +57652,7 @@ async function addListFragments(config2, documents) {
|
|
|
57639
57652
|
const validDeletes = [
|
|
57640
57653
|
...new Set(
|
|
57641
57654
|
Object.values(lists).map(({ type }) => {
|
|
57642
|
-
if (!(type instanceof
|
|
57655
|
+
if (!(type instanceof graphql8.GraphQLObjectType)) {
|
|
57643
57656
|
return "";
|
|
57644
57657
|
}
|
|
57645
57658
|
if (config2.keyFieldsForType(type.name).length !== 1) {
|
|
@@ -57653,7 +57666,7 @@ async function addListFragments(config2, documents) {
|
|
|
57653
57666
|
return;
|
|
57654
57667
|
}
|
|
57655
57668
|
const generatedDoc = {
|
|
57656
|
-
kind:
|
|
57669
|
+
kind: graphql8.Kind.DOCUMENT,
|
|
57657
57670
|
definitions: Object.entries(lists).flatMap(
|
|
57658
57671
|
([name2, { selection: selection2, type }]) => {
|
|
57659
57672
|
const schemaType = config2.schema.getType(type.name);
|
|
@@ -57661,7 +57674,7 @@ async function addListFragments(config2, documents) {
|
|
|
57661
57674
|
throw new HoudiniError({ message: "Lists must have a selection" });
|
|
57662
57675
|
}
|
|
57663
57676
|
const fragmentSelection = {
|
|
57664
|
-
kind:
|
|
57677
|
+
kind: graphql8.Kind.SELECTION_SET,
|
|
57665
57678
|
selections: [...selection2.selections]
|
|
57666
57679
|
};
|
|
57667
57680
|
if (schemaType && fragmentSelection && !fragmentSelection?.selections.find(
|
|
@@ -57676,14 +57689,14 @@ async function addListFragments(config2, documents) {
|
|
|
57676
57689
|
{
|
|
57677
57690
|
name: {
|
|
57678
57691
|
value: config2.listInsertFragment(name2),
|
|
57679
|
-
kind:
|
|
57692
|
+
kind: graphql8.Kind.NAME
|
|
57680
57693
|
},
|
|
57681
|
-
kind:
|
|
57694
|
+
kind: graphql8.Kind.FRAGMENT_DEFINITION,
|
|
57682
57695
|
selectionSet: fragmentSelection,
|
|
57683
57696
|
typeCondition: {
|
|
57684
|
-
kind:
|
|
57697
|
+
kind: graphql8.Kind.NAMED_TYPE,
|
|
57685
57698
|
name: {
|
|
57686
|
-
kind:
|
|
57699
|
+
kind: graphql8.Kind.NAME,
|
|
57687
57700
|
value: type.name
|
|
57688
57701
|
}
|
|
57689
57702
|
}
|
|
@@ -57691,32 +57704,32 @@ async function addListFragments(config2, documents) {
|
|
|
57691
57704
|
{
|
|
57692
57705
|
name: {
|
|
57693
57706
|
value: config2.listToggleFragment(name2),
|
|
57694
|
-
kind:
|
|
57707
|
+
kind: graphql8.Kind.NAME
|
|
57695
57708
|
},
|
|
57696
|
-
kind:
|
|
57709
|
+
kind: graphql8.Kind.FRAGMENT_DEFINITION,
|
|
57697
57710
|
selectionSet: fragmentSelection,
|
|
57698
57711
|
typeCondition: {
|
|
57699
|
-
kind:
|
|
57712
|
+
kind: graphql8.Kind.NAMED_TYPE,
|
|
57700
57713
|
name: {
|
|
57701
|
-
kind:
|
|
57714
|
+
kind: graphql8.Kind.NAME,
|
|
57702
57715
|
value: type.name
|
|
57703
57716
|
}
|
|
57704
57717
|
}
|
|
57705
57718
|
},
|
|
57706
57719
|
{
|
|
57707
|
-
kind:
|
|
57720
|
+
kind: graphql8.Kind.FRAGMENT_DEFINITION,
|
|
57708
57721
|
name: {
|
|
57709
57722
|
value: config2.listRemoveFragment(name2),
|
|
57710
|
-
kind:
|
|
57723
|
+
kind: graphql8.Kind.NAME
|
|
57711
57724
|
},
|
|
57712
57725
|
selectionSet: {
|
|
57713
|
-
kind:
|
|
57726
|
+
kind: graphql8.Kind.SELECTION_SET,
|
|
57714
57727
|
selections: [...objectIdentificationSelection(config2, type)]
|
|
57715
57728
|
},
|
|
57716
57729
|
typeCondition: {
|
|
57717
|
-
kind:
|
|
57730
|
+
kind: graphql8.Kind.NAMED_TYPE,
|
|
57718
57731
|
name: {
|
|
57719
|
-
kind:
|
|
57732
|
+
kind: graphql8.Kind.NAME,
|
|
57720
57733
|
value: type.name
|
|
57721
57734
|
}
|
|
57722
57735
|
}
|
|
@@ -57725,14 +57738,14 @@ async function addListFragments(config2, documents) {
|
|
|
57725
57738
|
}
|
|
57726
57739
|
).concat(
|
|
57727
57740
|
...validDeletes.map((typeName) => ({
|
|
57728
|
-
kind:
|
|
57741
|
+
kind: graphql8.Kind.DIRECTIVE_DEFINITION,
|
|
57729
57742
|
name: {
|
|
57730
|
-
kind:
|
|
57743
|
+
kind: graphql8.Kind.NAME,
|
|
57731
57744
|
value: config2.listDeleteDirective(typeName)
|
|
57732
57745
|
},
|
|
57733
57746
|
locations: [
|
|
57734
57747
|
{
|
|
57735
|
-
kind:
|
|
57748
|
+
kind: graphql8.Kind.NAME,
|
|
57736
57749
|
value: "FIELD"
|
|
57737
57750
|
}
|
|
57738
57751
|
],
|
|
@@ -57740,8 +57753,8 @@ async function addListFragments(config2, documents) {
|
|
|
57740
57753
|
}))
|
|
57741
57754
|
)
|
|
57742
57755
|
};
|
|
57743
|
-
config2.newSchema += "\n" + generatedDoc.definitions.filter((c) => c.kind !== "FragmentDefinition").map(
|
|
57744
|
-
config2.newDocuments += "\n" + generatedDoc.definitions.filter((c) => c.kind === "FragmentDefinition").map(
|
|
57756
|
+
config2.newSchema += "\n" + generatedDoc.definitions.filter((c) => c.kind !== "FragmentDefinition").map(graphql8.print).join("\n\n");
|
|
57757
|
+
config2.newDocuments += "\n" + generatedDoc.definitions.filter((c) => c.kind === "FragmentDefinition").map(graphql8.print).join("\n\n");
|
|
57745
57758
|
documents.push({
|
|
57746
57759
|
name: "generated::lists",
|
|
57747
57760
|
kind: "HoudiniFragment" /* Fragment */,
|
|
@@ -57826,11 +57839,11 @@ var nodeNotDefinedMessage = (config2) => `Looks like you are trying to use the $
|
|
|
57826
57839
|
For more information, visit this link: ${siteURL}/guides/pagination`;
|
|
57827
57840
|
|
|
57828
57841
|
// src/codegen/generators/artifacts/fieldKey.ts
|
|
57829
|
-
var
|
|
57842
|
+
var graphql9 = __toESM(require_graphql2(), 1);
|
|
57830
57843
|
function fieldKey(config2, field) {
|
|
57831
57844
|
const attributeName = field.alias?.value || field.name.value;
|
|
57832
|
-
const printed =
|
|
57833
|
-
const secondParse =
|
|
57845
|
+
const printed = graphql9.print(field);
|
|
57846
|
+
const secondParse = graphql9.parse(`{${printed}}`).definitions[0].selectionSet.selections[0];
|
|
57834
57847
|
const paginated = !!field.directives?.find(
|
|
57835
57848
|
(directive) => directive.name.value === config2.paginateDirective
|
|
57836
57849
|
);
|
|
@@ -57925,8 +57938,8 @@ function selection({
|
|
|
57925
57938
|
const typeConditionName = field.typeCondition.name.value;
|
|
57926
57939
|
const typeCondition = config2.schema.getType(typeConditionName);
|
|
57927
57940
|
const possibleTypes = [];
|
|
57928
|
-
if (!
|
|
57929
|
-
} else if (
|
|
57941
|
+
if (!graphql10.isAbstractType(typeCondition)) {
|
|
57942
|
+
} else if (graphql10.isAbstractType(parentType)) {
|
|
57930
57943
|
const possibleParentTypes = config2.schema.getPossibleTypes(parentType).map((type) => type.name);
|
|
57931
57944
|
for (const possible of config2.schema.getPossibleTypes(typeCondition)) {
|
|
57932
57945
|
if (possibleParentTypes.includes(possible.name)) {
|
|
@@ -57974,7 +57987,7 @@ function selection({
|
|
|
57974
57987
|
} else {
|
|
57975
57988
|
let typeRef = type.getFields()[field.name.value].type;
|
|
57976
57989
|
fieldType = getRootType(typeRef);
|
|
57977
|
-
nullable = !
|
|
57990
|
+
nullable = !graphql10.isNonNullType(typeRef);
|
|
57978
57991
|
}
|
|
57979
57992
|
const typeName = fieldType.toString();
|
|
57980
57993
|
const pathSoFar = path2.concat(attributeName);
|
|
@@ -58039,7 +58052,7 @@ function selection({
|
|
|
58039
58052
|
{}
|
|
58040
58053
|
);
|
|
58041
58054
|
}
|
|
58042
|
-
if (
|
|
58055
|
+
if (graphql10.isInterfaceType(fieldType) || graphql10.isUnionType(fieldType)) {
|
|
58043
58056
|
fieldObj.abstract = true;
|
|
58044
58057
|
}
|
|
58045
58058
|
object.fields = {
|
|
@@ -58096,7 +58109,7 @@ function artifactGenerator(stats) {
|
|
|
58096
58109
|
return async function(config2, docs) {
|
|
58097
58110
|
const filterTypes = {};
|
|
58098
58111
|
for (const doc of docs) {
|
|
58099
|
-
|
|
58112
|
+
graphql11.visit(doc.document, {
|
|
58100
58113
|
Directive(node, _, __, ___, ancestors) {
|
|
58101
58114
|
if (node.name.value !== config2.listDirective) {
|
|
58102
58115
|
return;
|
|
@@ -58155,7 +58168,7 @@ function artifactGenerator(stats) {
|
|
|
58155
58168
|
return;
|
|
58156
58169
|
}
|
|
58157
58170
|
const usedVariableNames = /* @__PURE__ */ new Set();
|
|
58158
|
-
let documentWithoutInternalDirectives =
|
|
58171
|
+
let documentWithoutInternalDirectives = graphql11.visit(document, {
|
|
58159
58172
|
Directive(node) {
|
|
58160
58173
|
if (config2.isInternalDirective(node)) {
|
|
58161
58174
|
return null;
|
|
@@ -58168,7 +58181,7 @@ function artifactGenerator(stats) {
|
|
|
58168
58181
|
}
|
|
58169
58182
|
}
|
|
58170
58183
|
});
|
|
58171
|
-
let documentWithoutExtraVariables =
|
|
58184
|
+
let documentWithoutExtraVariables = graphql11.visit(
|
|
58172
58185
|
documentWithoutInternalDirectives,
|
|
58173
58186
|
{
|
|
58174
58187
|
VariableDefinition(variableDefinitionNode) {
|
|
@@ -58179,13 +58192,13 @@ function artifactGenerator(stats) {
|
|
|
58179
58192
|
}
|
|
58180
58193
|
}
|
|
58181
58194
|
);
|
|
58182
|
-
let rawString =
|
|
58195
|
+
let rawString = graphql11.print(documentWithoutExtraVariables);
|
|
58183
58196
|
let docKind = doc.kind;
|
|
58184
58197
|
const operations = document.definitions.filter(
|
|
58185
|
-
({ kind }) => kind ===
|
|
58198
|
+
({ kind }) => kind === graphql11.Kind.OPERATION_DEFINITION
|
|
58186
58199
|
);
|
|
58187
58200
|
const fragments = document.definitions.filter(
|
|
58188
|
-
({ kind }) => kind ===
|
|
58201
|
+
({ kind }) => kind === graphql11.Kind.FRAGMENT_DEFINITION
|
|
58189
58202
|
);
|
|
58190
58203
|
let rootType = "";
|
|
58191
58204
|
let selectionSet;
|
|
@@ -58427,15 +58440,15 @@ async function generatePluginRuntime(config2, plugin) {
|
|
|
58427
58440
|
var recast12 = __toESM(require_main2(), 1);
|
|
58428
58441
|
|
|
58429
58442
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
58430
|
-
var
|
|
58443
|
+
var graphql14 = __toESM(require_graphql2(), 1);
|
|
58431
58444
|
var recast9 = __toESM(require_main2(), 1);
|
|
58432
58445
|
|
|
58433
58446
|
// src/codegen/generators/typescript/typeReference.ts
|
|
58434
|
-
var
|
|
58447
|
+
var graphql13 = __toESM(require_graphql2(), 1);
|
|
58435
58448
|
var recast8 = __toESM(require_main2(), 1);
|
|
58436
58449
|
|
|
58437
58450
|
// src/codegen/generators/typescript/types.ts
|
|
58438
|
-
var
|
|
58451
|
+
var graphql12 = __toESM(require_graphql2(), 1);
|
|
58439
58452
|
var recast7 = __toESM(require_main2(), 1);
|
|
58440
58453
|
var AST7 = recast7.types.builders;
|
|
58441
58454
|
function readonlyProperty(prop, enable = true) {
|
|
@@ -58469,7 +58482,7 @@ function scalarPropertyValue(config2, missingScalars, target) {
|
|
|
58469
58482
|
return AST7.tsStringKeyword();
|
|
58470
58483
|
}
|
|
58471
58484
|
default: {
|
|
58472
|
-
if (
|
|
58485
|
+
if (graphql12.isNonNullType(target) && "ofType" in target) {
|
|
58473
58486
|
return scalarPropertyValue(
|
|
58474
58487
|
config2,
|
|
58475
58488
|
missingScalars,
|
|
@@ -58490,7 +58503,7 @@ var AST8 = recast8.types.builders;
|
|
|
58490
58503
|
function tsTypeReference(config2, missingScalars, definition) {
|
|
58491
58504
|
const { type, wrappers } = unwrapType(config2, definition.type);
|
|
58492
58505
|
let result;
|
|
58493
|
-
if (
|
|
58506
|
+
if (graphql13.isScalarType(type)) {
|
|
58494
58507
|
result = scalarPropertyValue(config2, missingScalars, type);
|
|
58495
58508
|
} else {
|
|
58496
58509
|
result = AST8.tsTypeReference(AST8.identifier(type.name));
|
|
@@ -58511,17 +58524,17 @@ function tsTypeReference(config2, missingScalars, definition) {
|
|
|
58511
58524
|
var AST9 = recast9.types.builders;
|
|
58512
58525
|
function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingScalars, rootType) {
|
|
58513
58526
|
const { type } = unwrapType(config2, rootType);
|
|
58514
|
-
if (
|
|
58527
|
+
if (graphql14.isScalarType(type)) {
|
|
58515
58528
|
return;
|
|
58516
58529
|
}
|
|
58517
58530
|
if (visitedTypes.has(type.name)) {
|
|
58518
58531
|
return;
|
|
58519
58532
|
}
|
|
58520
|
-
if (
|
|
58533
|
+
if (graphql14.isUnionType(type)) {
|
|
58521
58534
|
throw new HoudiniError({ filepath, message: "Input Unions are not supported yet. Sorry!" });
|
|
58522
58535
|
}
|
|
58523
58536
|
visitedTypes.add(type.name);
|
|
58524
|
-
if (
|
|
58537
|
+
if (graphql14.isEnumType(type)) {
|
|
58525
58538
|
ensureImports({
|
|
58526
58539
|
config: config2,
|
|
58527
58540
|
body,
|
|
@@ -58538,7 +58551,7 @@ function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingS
|
|
|
58538
58551
|
AST9.tsPropertySignature(
|
|
58539
58552
|
AST9.identifier(field.name),
|
|
58540
58553
|
AST9.tsTypeAnnotation(tsTypeReference(config2, missingScalars, field)),
|
|
58541
|
-
|
|
58554
|
+
graphql14.isNullableType(field.type)
|
|
58542
58555
|
)
|
|
58543
58556
|
);
|
|
58544
58557
|
}
|
|
@@ -58546,7 +58559,7 @@ function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingS
|
|
|
58546
58559
|
}
|
|
58547
58560
|
|
|
58548
58561
|
// src/codegen/generators/typescript/imperativeCache.ts
|
|
58549
|
-
var
|
|
58562
|
+
var graphql15 = __toESM(require_graphql2(), 1);
|
|
58550
58563
|
var recast10 = __toESM(require_main2(), 1);
|
|
58551
58564
|
var AST10 = recast10.types.builders;
|
|
58552
58565
|
async function imperativeCacheTypef(config2, docs) {
|
|
@@ -58582,7 +58595,7 @@ function typeDefinitions(config2, body) {
|
|
|
58582
58595
|
const operationTypes = [config2.schema.getMutationType(), config2.schema.getSubscriptionType()].filter(Boolean).map((type) => type?.name);
|
|
58583
58596
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
58584
58597
|
const types14 = Object.values(config2.schema.getTypeMap()).filter(
|
|
58585
|
-
(type) => !
|
|
58598
|
+
(type) => !graphql15.isAbstractType(type) && !graphql15.isScalarType(type) && !graphql15.isEnumType(type) && !graphql15.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
|
|
58586
58599
|
);
|
|
58587
58600
|
return AST10.tsTypeLiteral(
|
|
58588
58601
|
types14.map((type) => {
|
|
@@ -58592,7 +58605,7 @@ function typeDefinitions(config2, body) {
|
|
|
58592
58605
|
}
|
|
58593
58606
|
let idFields = AST10.tsNeverKeyword();
|
|
58594
58607
|
const keys = keyFieldsForType(config2.configFile, type.name);
|
|
58595
|
-
if (
|
|
58608
|
+
if (graphql15.isObjectType(type) && keys.length > 0 && keys.every((key) => type.getFields()[key])) {
|
|
58596
58609
|
idFields = AST10.tsTypeLiteral(
|
|
58597
58610
|
keys.map((key) => {
|
|
58598
58611
|
const fieldType = type.getFields()[key];
|
|
@@ -58609,21 +58622,21 @@ function typeDefinitions(config2, body) {
|
|
|
58609
58622
|
idFields = AST10.tsTypeLiteral([]);
|
|
58610
58623
|
}
|
|
58611
58624
|
let fields = AST10.tsTypeLiteral([]);
|
|
58612
|
-
if (
|
|
58625
|
+
if (graphql15.isObjectType(type)) {
|
|
58613
58626
|
fields = AST10.tsTypeLiteral(
|
|
58614
58627
|
Object.entries(type.getFields()).map(
|
|
58615
58628
|
([key, fieldType]) => {
|
|
58616
58629
|
const unwrapped = unwrapType(config2, fieldType.type);
|
|
58617
58630
|
let typeOptions = AST10.tsUnionType([]);
|
|
58618
|
-
if (
|
|
58631
|
+
if (graphql15.isScalarType(unwrapped.type)) {
|
|
58619
58632
|
typeOptions.types.push(
|
|
58620
58633
|
scalarPropertyValue(config2, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
58621
58634
|
);
|
|
58622
|
-
} else if (
|
|
58635
|
+
} else if (graphql15.isEnumType(unwrapped.type)) {
|
|
58623
58636
|
typeOptions.types.push(
|
|
58624
58637
|
AST10.tsTypeReference(AST10.identifier(unwrapped.type.name))
|
|
58625
58638
|
);
|
|
58626
|
-
} else if (!
|
|
58639
|
+
} else if (!graphql15.isAbstractType(unwrapped.type)) {
|
|
58627
58640
|
typeOptions.types.push(record(unwrapped.type.name));
|
|
58628
58641
|
} else {
|
|
58629
58642
|
typeOptions.types.push(
|
|
@@ -58709,7 +58722,7 @@ function listDefinitions(config2, docs) {
|
|
|
58709
58722
|
const lists = [];
|
|
58710
58723
|
const visitedLists = /* @__PURE__ */ new Set();
|
|
58711
58724
|
for (const doc of docs) {
|
|
58712
|
-
|
|
58725
|
+
graphql15.visit(doc.document, {
|
|
58713
58726
|
Directive(node, key, parent, path2, ancestors) {
|
|
58714
58727
|
if (![config2.listDirective, config2.paginateDirective].includes(node.name.value)) {
|
|
58715
58728
|
return;
|
|
@@ -58729,7 +58742,7 @@ function listDefinitions(config2, docs) {
|
|
|
58729
58742
|
const targetFieldDefinition = parentType.getFields()[targetField.name.value];
|
|
58730
58743
|
const { type: listType } = unwrapType(config2, targetFieldDefinition.type);
|
|
58731
58744
|
const possibleTypes = [];
|
|
58732
|
-
if (
|
|
58745
|
+
if (graphql15.isAbstractType(listType)) {
|
|
58733
58746
|
possibleTypes.push(
|
|
58734
58747
|
...config2.schema.getPossibleTypes(listType).map((possible) => possible.name)
|
|
58735
58748
|
);
|
|
@@ -58793,7 +58806,7 @@ function record(name2) {
|
|
|
58793
58806
|
}
|
|
58794
58807
|
|
|
58795
58808
|
// src/codegen/generators/typescript/inlineType.ts
|
|
58796
|
-
var
|
|
58809
|
+
var graphql16 = __toESM(require_graphql2(), 1);
|
|
58797
58810
|
var recast11 = __toESM(require_main2(), 1);
|
|
58798
58811
|
var AST11 = recast11.types.builders;
|
|
58799
58812
|
var fragmentKey = "$fragments";
|
|
@@ -58812,9 +58825,9 @@ function inlineType({
|
|
|
58812
58825
|
}) {
|
|
58813
58826
|
const { type, wrappers } = unwrapType(config2, rootType);
|
|
58814
58827
|
let result;
|
|
58815
|
-
if (
|
|
58828
|
+
if (graphql16.isScalarType(type)) {
|
|
58816
58829
|
result = scalarPropertyValue(config2, missingScalars, type);
|
|
58817
|
-
} else if (
|
|
58830
|
+
} else if (graphql16.isEnumType(type)) {
|
|
58818
58831
|
if (!visitedTypes.has(type.name)) {
|
|
58819
58832
|
ensureImports({
|
|
58820
58833
|
config: config2,
|
|
@@ -58832,11 +58845,11 @@ function inlineType({
|
|
|
58832
58845
|
for (const selection2 of selections) {
|
|
58833
58846
|
if (selection2.kind === "InlineFragment" && selection2.typeCondition) {
|
|
58834
58847
|
const fragmentType = config2.schema.getType(selection2.typeCondition.name.value);
|
|
58835
|
-
if (!
|
|
58848
|
+
if (!graphql16.isInterfaceType(type) && !graphql16.isUnionType(type)) {
|
|
58836
58849
|
selectedFields.push(...selection2.selectionSet.selections);
|
|
58837
58850
|
continue;
|
|
58838
58851
|
}
|
|
58839
|
-
if (!
|
|
58852
|
+
if (!graphql16.isInterfaceType(fragmentType) && !graphql16.isUnionType(fragmentType)) {
|
|
58840
58853
|
if (!inlineFragments[fragmentType.name]) {
|
|
58841
58854
|
inlineFragments[fragmentType.name] = [];
|
|
58842
58855
|
}
|
|
@@ -58956,7 +58969,7 @@ function inlineType({
|
|
|
58956
58969
|
}
|
|
58957
58970
|
}
|
|
58958
58971
|
}
|
|
58959
|
-
if (objectType.type === "TSTypeLiteral" && !
|
|
58972
|
+
if (objectType.type === "TSTypeLiteral" && !graphql16.isInterfaceType(fragmentRootType) && !graphql16.isUnionType(fragmentRootType)) {
|
|
58960
58973
|
const existingTypenameIndex = objectType.members.findIndex(
|
|
58961
58974
|
(member) => member.type === "TSPropertySignature" && member.key.type === "Identifier" && member.key.name === "__typename"
|
|
58962
58975
|
);
|
|
@@ -59023,7 +59036,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection2) {
|
|
|
59023
59036
|
},
|
|
59024
59037
|
type: schema.getType("String")
|
|
59025
59038
|
};
|
|
59026
|
-
} else if (
|
|
59039
|
+
} else if (graphql16.isNonNullType(rootType) && "getFields" in rootType.ofType) {
|
|
59027
59040
|
fields = rootType.ofType.getFields();
|
|
59028
59041
|
} else {
|
|
59029
59042
|
fields = rootType.getFields();
|
|
@@ -59035,7 +59048,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection2) {
|
|
|
59035
59048
|
message: `Could not find type information for field ${rootType.toString()}.${selectionName} ${field}`
|
|
59036
59049
|
});
|
|
59037
59050
|
}
|
|
59038
|
-
const fieldType =
|
|
59051
|
+
const fieldType = graphql16.getNamedType(field.type);
|
|
59039
59052
|
if (!fieldType) {
|
|
59040
59053
|
throw new HoudiniError({
|
|
59041
59054
|
filepath,
|
|
@@ -59356,7 +59369,7 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
59356
59369
|
}
|
|
59357
59370
|
|
|
59358
59371
|
// src/codegen/generators/persistedQueries/index.ts
|
|
59359
|
-
var
|
|
59372
|
+
var graphql17 = __toESM(require_graphql2(), 1);
|
|
59360
59373
|
async function persistOutputGenerator(config2, docs) {
|
|
59361
59374
|
if (typeof config2.persistedQueryPath !== "string" || config2.persistedQueryPath.length === 0)
|
|
59362
59375
|
return;
|
|
@@ -59368,8 +59381,8 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
59368
59381
|
if (!generateArtifact) {
|
|
59369
59382
|
return acc;
|
|
59370
59383
|
}
|
|
59371
|
-
let rawString =
|
|
59372
|
-
|
|
59384
|
+
let rawString = graphql17.print(
|
|
59385
|
+
graphql17.visit(document, {
|
|
59373
59386
|
Directive(node) {
|
|
59374
59387
|
if (config2.isInternalDirective(node)) {
|
|
59375
59388
|
return null;
|
|
@@ -59378,7 +59391,7 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
59378
59391
|
})
|
|
59379
59392
|
);
|
|
59380
59393
|
const operations = document.definitions.filter(
|
|
59381
|
-
({ kind }) => kind ===
|
|
59394
|
+
({ kind }) => kind === graphql17.Kind.OPERATION_DEFINITION
|
|
59382
59395
|
);
|
|
59383
59396
|
if (operations.length > 0 && operations[0].kind === "OperationDefinition") {
|
|
59384
59397
|
acc[hashDocument(rawString)] = rawString;
|
|
@@ -59391,11 +59404,11 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
59391
59404
|
}
|
|
59392
59405
|
|
|
59393
59406
|
// src/codegen/generators/definitions/enums.ts
|
|
59394
|
-
var
|
|
59407
|
+
var graphql18 = __toESM(require_graphql2(), 1);
|
|
59395
59408
|
var recast13 = __toESM(require_main2(), 1);
|
|
59396
59409
|
var AST13 = recast13.types.builders;
|
|
59397
59410
|
async function definitionsGenerator(config2) {
|
|
59398
|
-
const enums =
|
|
59411
|
+
const enums = graphql18.parse(graphql18.printSchema(config2.schema)).definitions.filter(
|
|
59399
59412
|
(definition) => definition.kind === "EnumTypeDefinition"
|
|
59400
59413
|
).filter((def) => !config2.isInternalEnum(def));
|
|
59401
59414
|
const runtimeDefinitions = recast13.print(
|
|
@@ -59568,7 +59581,7 @@ function flattenFragments(filepath, operation, fragments) {
|
|
|
59568
59581
|
}
|
|
59569
59582
|
|
|
59570
59583
|
// src/codegen/transforms/schema.ts
|
|
59571
|
-
var
|
|
59584
|
+
var graphql20 = __toESM(require_graphql2(), 1);
|
|
59572
59585
|
async function graphqlExtensions(config2, documents) {
|
|
59573
59586
|
const internalSchema = `
|
|
59574
59587
|
enum CachePolicy {
|
|
@@ -59646,19 +59659,19 @@ directive @${config2.maskEnableDirective} on FRAGMENT_SPREAD
|
|
|
59646
59659
|
"""
|
|
59647
59660
|
directive @${config2.maskDisableDirective} on FRAGMENT_SPREAD
|
|
59648
59661
|
`;
|
|
59649
|
-
let currentSchema =
|
|
59662
|
+
let currentSchema = graphql20.printSchema(config2.schema);
|
|
59650
59663
|
if (!currentSchema.includes(`directive @${config2.listDirective}`)) {
|
|
59651
59664
|
currentSchema += internalSchema;
|
|
59652
59665
|
}
|
|
59653
59666
|
config2.newSchema += internalSchema;
|
|
59654
|
-
config2.schema =
|
|
59667
|
+
config2.schema = graphql20.buildSchema(currentSchema);
|
|
59655
59668
|
}
|
|
59656
59669
|
|
|
59657
59670
|
// src/codegen/transforms/typename.ts
|
|
59658
|
-
var
|
|
59671
|
+
var graphql21 = __toESM(require_graphql2(), 1);
|
|
59659
59672
|
async function addTypename(config2, documents) {
|
|
59660
59673
|
for (const doc of documents) {
|
|
59661
|
-
doc.document =
|
|
59674
|
+
doc.document = graphql21.visit(doc.document, {
|
|
59662
59675
|
Field(node, key, parent, path2, ancestors) {
|
|
59663
59676
|
if (!node.selectionSet) {
|
|
59664
59677
|
return;
|
|
@@ -59670,7 +59683,7 @@ async function addTypename(config2, documents) {
|
|
|
59670
59683
|
);
|
|
59671
59684
|
const field = type.getFields()[node.name.value];
|
|
59672
59685
|
const fieldType = unwrapType(config2, field.type).type;
|
|
59673
|
-
if (
|
|
59686
|
+
if (graphql21.isInterfaceType(fieldType) || graphql21.isUnionType(fieldType)) {
|
|
59674
59687
|
return {
|
|
59675
59688
|
...node,
|
|
59676
59689
|
selectionSet: {
|
|
@@ -59678,9 +59691,9 @@ async function addTypename(config2, documents) {
|
|
|
59678
59691
|
selections: [
|
|
59679
59692
|
...node.selectionSet.selections,
|
|
59680
59693
|
{
|
|
59681
|
-
kind:
|
|
59694
|
+
kind: graphql21.Kind.FIELD,
|
|
59682
59695
|
name: {
|
|
59683
|
-
kind:
|
|
59696
|
+
kind: graphql21.Kind.NAME,
|
|
59684
59697
|
value: "__typename"
|
|
59685
59698
|
}
|
|
59686
59699
|
}
|
|
@@ -59694,10 +59707,10 @@ async function addTypename(config2, documents) {
|
|
|
59694
59707
|
}
|
|
59695
59708
|
|
|
59696
59709
|
// src/codegen/transforms/addID.ts
|
|
59697
|
-
var
|
|
59710
|
+
var graphql22 = __toESM(require_graphql2(), 1);
|
|
59698
59711
|
async function addID(config2, documents) {
|
|
59699
59712
|
for (const doc of documents) {
|
|
59700
|
-
doc.document =
|
|
59713
|
+
doc.document = graphql22.visit(doc.document, {
|
|
59701
59714
|
Field(node, key, parent, path2, ancestors) {
|
|
59702
59715
|
if (!node.selectionSet) {
|
|
59703
59716
|
return;
|
|
@@ -59710,7 +59723,7 @@ async function addID(config2, documents) {
|
|
|
59710
59723
|
const field = type.getFields()[node.name.value];
|
|
59711
59724
|
const fieldType = unwrapType(config2, field.type).type;
|
|
59712
59725
|
if (node.selectionSet?.selections.length > 0) {
|
|
59713
|
-
if (!
|
|
59726
|
+
if (!graphql22.isObjectType(fieldType) && !graphql22.isInterfaceType(fieldType)) {
|
|
59714
59727
|
return;
|
|
59715
59728
|
}
|
|
59716
59729
|
const keyFields = config2.keyFieldsForType(fieldType.name);
|
|
@@ -59725,9 +59738,9 @@ async function addID(config2, documents) {
|
|
|
59725
59738
|
continue;
|
|
59726
59739
|
}
|
|
59727
59740
|
selections.push({
|
|
59728
|
-
kind:
|
|
59741
|
+
kind: graphql22.Kind.FIELD,
|
|
59729
59742
|
name: {
|
|
59730
|
-
kind:
|
|
59743
|
+
kind: graphql22.Kind.NAME,
|
|
59731
59744
|
value: keyField
|
|
59732
59745
|
}
|
|
59733
59746
|
});
|
|
@@ -59746,8 +59759,8 @@ async function addID(config2, documents) {
|
|
|
59746
59759
|
}
|
|
59747
59760
|
|
|
59748
59761
|
// src/codegen/transforms/fragmentVariables.ts
|
|
59749
|
-
var
|
|
59750
|
-
var GraphqlKinds2 =
|
|
59762
|
+
var graphql23 = __toESM(require_graphql2(), 1);
|
|
59763
|
+
var GraphqlKinds2 = graphql23.Kind;
|
|
59751
59764
|
async function fragmentVariables(config2, documents) {
|
|
59752
59765
|
const fragments = collectFragments(config2, documents);
|
|
59753
59766
|
const generatedFragments = {};
|
|
@@ -59770,7 +59783,7 @@ async function fragmentVariables(config2, documents) {
|
|
|
59770
59783
|
});
|
|
59771
59784
|
}
|
|
59772
59785
|
const doc = {
|
|
59773
|
-
kind:
|
|
59786
|
+
kind: graphql23.Kind.DOCUMENT,
|
|
59774
59787
|
definitions: Object.values(generatedFragments)
|
|
59775
59788
|
};
|
|
59776
59789
|
documents.push({
|
|
@@ -59806,7 +59819,7 @@ function inlineFragmentArgs({
|
|
|
59806
59819
|
filepath,
|
|
59807
59820
|
document
|
|
59808
59821
|
).reduce((acc, arg) => ({ ...acc, [arg.name]: arg }), {});
|
|
59809
|
-
const result =
|
|
59822
|
+
const result = graphql23.visit(document, {
|
|
59810
59823
|
FragmentSpread(node) {
|
|
59811
59824
|
const { definition } = fragmentDefinitions[node.name.value];
|
|
59812
59825
|
let { args, hash } = collectWithArguments(config2, filepath, node, scope);
|
|
@@ -59894,7 +59907,7 @@ function inlineFragmentArgs({
|
|
|
59894
59907
|
});
|
|
59895
59908
|
if (newName) {
|
|
59896
59909
|
result.name = {
|
|
59897
|
-
kind:
|
|
59910
|
+
kind: graphql23.Kind.NAME,
|
|
59898
59911
|
value: newName
|
|
59899
59912
|
};
|
|
59900
59913
|
}
|
|
@@ -60006,7 +60019,7 @@ function operationScope(operation) {
|
|
|
60006
60019
|
}
|
|
60007
60020
|
|
|
60008
60021
|
// src/codegen/validators/typeCheck.ts
|
|
60009
|
-
var
|
|
60022
|
+
var graphql24 = __toESM(require_graphql2(), 1);
|
|
60010
60023
|
async function typeCheck(config2, docs) {
|
|
60011
60024
|
const errors = [];
|
|
60012
60025
|
const freeLists = [];
|
|
@@ -60014,11 +60027,11 @@ async function typeCheck(config2, docs) {
|
|
|
60014
60027
|
const listTypes = [];
|
|
60015
60028
|
const fragments = {};
|
|
60016
60029
|
for (const { document: parsed, filename } of docs) {
|
|
60017
|
-
|
|
60018
|
-
[
|
|
60030
|
+
graphql24.visit(parsed, {
|
|
60031
|
+
[graphql24.Kind.FRAGMENT_DEFINITION](definition) {
|
|
60019
60032
|
fragments[definition.name.value] = definition;
|
|
60020
60033
|
},
|
|
60021
|
-
[
|
|
60034
|
+
[graphql24.Kind.DIRECTIVE](directive, _, parent, __, ancestors) {
|
|
60022
60035
|
if (![config2.listDirective, config2.paginateDirective].includes(directive.name.value)) {
|
|
60023
60036
|
return;
|
|
60024
60037
|
}
|
|
@@ -60064,14 +60077,14 @@ async function typeCheck(config2, docs) {
|
|
|
60064
60077
|
);
|
|
60065
60078
|
return;
|
|
60066
60079
|
}
|
|
60067
|
-
if (
|
|
60080
|
+
if (graphql24.isListType(rootType) || graphql24.isNonNullType(rootType) && graphql24.isListType(rootType.ofType)) {
|
|
60068
60081
|
needsParent = true;
|
|
60069
60082
|
break;
|
|
60070
60083
|
}
|
|
60071
|
-
if (
|
|
60084
|
+
if (graphql24.isNonNullType(rootType) && "ofType" in rootType) {
|
|
60072
60085
|
rootType = rootType.ofType;
|
|
60073
60086
|
}
|
|
60074
|
-
if (
|
|
60087
|
+
if (graphql24.isScalarType(rootType)) {
|
|
60075
60088
|
break;
|
|
60076
60089
|
}
|
|
60077
60090
|
rootType = rootType?.getFields()[parent2.name.value]?.type;
|
|
@@ -60147,9 +60160,9 @@ async function typeCheck(config2, docs) {
|
|
|
60147
60160
|
);
|
|
60148
60161
|
}
|
|
60149
60162
|
let targetTypes = [type];
|
|
60150
|
-
if (
|
|
60163
|
+
if (graphql24.isUnionType(type)) {
|
|
60151
60164
|
targetTypes = config2.schema.getPossibleTypes(type);
|
|
60152
|
-
} else if (
|
|
60165
|
+
} else if (graphql24.isInterfaceType(type)) {
|
|
60153
60166
|
try {
|
|
60154
60167
|
for (const key of config2.keyFieldsForType(type.name)) {
|
|
60155
60168
|
if (!type.getFields()[key]) {
|
|
@@ -60187,13 +60200,13 @@ async function typeCheck(config2, docs) {
|
|
|
60187
60200
|
if (errors.length > 0) {
|
|
60188
60201
|
throw errors;
|
|
60189
60202
|
}
|
|
60190
|
-
const rules = (filepath) => [...
|
|
60203
|
+
const rules = (filepath) => [...graphql24.specifiedRules].filter(
|
|
60191
60204
|
(rule) => ![
|
|
60192
|
-
|
|
60193
|
-
|
|
60194
|
-
|
|
60195
|
-
|
|
60196
|
-
|
|
60205
|
+
graphql24.NoUnusedFragmentsRule,
|
|
60206
|
+
graphql24.KnownFragmentNamesRule,
|
|
60207
|
+
graphql24.ExecutableDefinitionsRule,
|
|
60208
|
+
graphql24.KnownDirectivesRule,
|
|
60209
|
+
graphql24.KnownArgumentNamesRule
|
|
60197
60210
|
].includes(rule)
|
|
60198
60211
|
).concat(
|
|
60199
60212
|
validateLists({
|
|
@@ -60212,7 +60225,7 @@ async function typeCheck(config2, docs) {
|
|
|
60212
60225
|
noUnusedFragmentArguments(config2)
|
|
60213
60226
|
);
|
|
60214
60227
|
for (const { filename, document: parsed } of docs) {
|
|
60215
|
-
for (const error of
|
|
60228
|
+
for (const error of graphql24.validate(config2.schema, parsed, rules(filename))) {
|
|
60216
60229
|
errors.push(
|
|
60217
60230
|
new HoudiniError({
|
|
60218
60231
|
filepath: filename,
|
|
@@ -60238,7 +60251,7 @@ var validateLists = ({
|
|
|
60238
60251
|
if (!config2.isListFragment(node.name.value)) {
|
|
60239
60252
|
if (!fragments[node.name.value]) {
|
|
60240
60253
|
ctx.reportError(
|
|
60241
|
-
new
|
|
60254
|
+
new graphql24.GraphQLError(
|
|
60242
60255
|
"Encountered unknown fragment: " + node.name.value
|
|
60243
60256
|
)
|
|
60244
60257
|
);
|
|
@@ -60248,7 +60261,7 @@ var validateLists = ({
|
|
|
60248
60261
|
const listName = config2.listNameFromFragment(node.name.value);
|
|
60249
60262
|
if (!lists.includes(listName)) {
|
|
60250
60263
|
ctx.reportError(
|
|
60251
|
-
new
|
|
60264
|
+
new graphql24.GraphQLError(
|
|
60252
60265
|
"Encountered fragment referencing unknown list: " + listName
|
|
60253
60266
|
)
|
|
60254
60267
|
);
|
|
@@ -60273,7 +60286,7 @@ var validateLists = ({
|
|
|
60273
60286
|
);
|
|
60274
60287
|
if (parentArg) {
|
|
60275
60288
|
ctx.reportError(
|
|
60276
|
-
new
|
|
60289
|
+
new graphql24.GraphQLError(
|
|
60277
60290
|
`@${config2.deprecatedlistDirectiveParentIDArg} should be defined only in it's own directive now`
|
|
60278
60291
|
)
|
|
60279
60292
|
);
|
|
@@ -60289,7 +60302,7 @@ var validateLists = ({
|
|
|
60289
60302
|
return;
|
|
60290
60303
|
}
|
|
60291
60304
|
ctx.reportError(
|
|
60292
|
-
new
|
|
60305
|
+
new graphql24.GraphQLError(
|
|
60293
60306
|
`For this list fragment, you need to add or @${config2.listParentDirective} or @${config2.listAllListsDirective} directive to specify the behavior`
|
|
60294
60307
|
)
|
|
60295
60308
|
);
|
|
@@ -60299,7 +60312,7 @@ var validateLists = ({
|
|
|
60299
60312
|
const directiveName = node.name.value;
|
|
60300
60313
|
if (directiveName === "connection") {
|
|
60301
60314
|
ctx.reportError(
|
|
60302
|
-
new
|
|
60315
|
+
new graphql24.GraphQLError(
|
|
60303
60316
|
"@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."
|
|
60304
60317
|
)
|
|
60305
60318
|
);
|
|
@@ -60308,7 +60321,7 @@ var validateLists = ({
|
|
|
60308
60321
|
if (!config2.isInternalDirective(node)) {
|
|
60309
60322
|
if (!config2.schema.getDirective(directiveName)) {
|
|
60310
60323
|
ctx.reportError(
|
|
60311
|
-
new
|
|
60324
|
+
new graphql24.GraphQLError(
|
|
60312
60325
|
"Encountered unknown directive: " + directiveName
|
|
60313
60326
|
)
|
|
60314
60327
|
);
|
|
@@ -60317,7 +60330,7 @@ var validateLists = ({
|
|
|
60317
60330
|
}
|
|
60318
60331
|
if (config2.isListOperationDirective(directiveName) && !listTypes.includes(config2.listNameFromDirective(directiveName))) {
|
|
60319
60332
|
ctx.reportError(
|
|
60320
|
-
new
|
|
60333
|
+
new graphql24.GraphQLError(
|
|
60321
60334
|
"Encountered directive referencing unknown list: " + directiveName
|
|
60322
60335
|
)
|
|
60323
60336
|
);
|
|
@@ -60328,7 +60341,7 @@ var validateLists = ({
|
|
|
60328
60341
|
};
|
|
60329
60342
|
function knownArguments(config2) {
|
|
60330
60343
|
return function(ctx) {
|
|
60331
|
-
const nativeValidator =
|
|
60344
|
+
const nativeValidator = graphql24.KnownArgumentNamesRule(ctx);
|
|
60332
60345
|
return {
|
|
60333
60346
|
...nativeValidator,
|
|
60334
60347
|
Directive(directiveNode) {
|
|
@@ -60361,7 +60374,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60361
60374
|
for (const arg of node.arguments || []) {
|
|
60362
60375
|
if (arg.value.kind !== "ObjectValue") {
|
|
60363
60376
|
ctx.reportError(
|
|
60364
|
-
new
|
|
60377
|
+
new graphql24.GraphQLError("values in @arguments must be an object")
|
|
60365
60378
|
);
|
|
60366
60379
|
return;
|
|
60367
60380
|
}
|
|
@@ -60371,13 +60384,13 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60371
60384
|
);
|
|
60372
60385
|
if (!typeArg) {
|
|
60373
60386
|
ctx.reportError(
|
|
60374
|
-
new
|
|
60387
|
+
new graphql24.GraphQLError("missing type field for @arguments directive")
|
|
60375
60388
|
);
|
|
60376
60389
|
return;
|
|
60377
60390
|
}
|
|
60378
|
-
if (typeArg.value.kind !==
|
|
60391
|
+
if (typeArg.value.kind !== graphql24.Kind.STRING) {
|
|
60379
60392
|
ctx.reportError(
|
|
60380
|
-
new
|
|
60393
|
+
new graphql24.GraphQLError("type field to @arguments must be a string")
|
|
60381
60394
|
);
|
|
60382
60395
|
return;
|
|
60383
60396
|
}
|
|
@@ -60390,7 +60403,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60390
60403
|
);
|
|
60391
60404
|
if (typeArg.value.value !== defaultValueType) {
|
|
60392
60405
|
ctx.reportError(
|
|
60393
|
-
new
|
|
60406
|
+
new graphql24.GraphQLError(
|
|
60394
60407
|
`Invalid default value provided for ${arg.name.value}. Expected ${typeArg.value.value}, found ${defaultValueType}`
|
|
60395
60408
|
)
|
|
60396
60409
|
);
|
|
@@ -60408,7 +60421,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60408
60421
|
try {
|
|
60409
60422
|
args = fragmentArguments(config2, filepath, fragments[fragmentName]);
|
|
60410
60423
|
} catch (e) {
|
|
60411
|
-
ctx.reportError(new
|
|
60424
|
+
ctx.reportError(new graphql24.GraphQLError(e.message));
|
|
60412
60425
|
return;
|
|
60413
60426
|
}
|
|
60414
60427
|
fragmentArguments2[fragmentName] = args;
|
|
@@ -60431,7 +60444,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60431
60444
|
);
|
|
60432
60445
|
if (missing.length > 0) {
|
|
60433
60446
|
ctx.reportError(
|
|
60434
|
-
new
|
|
60447
|
+
new graphql24.GraphQLError(
|
|
60435
60448
|
"The following arguments are missing from this fragment: " + JSON.stringify(missing)
|
|
60436
60449
|
)
|
|
60437
60450
|
);
|
|
@@ -60442,7 +60455,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60442
60455
|
);
|
|
60443
60456
|
if (unknown.length > 0) {
|
|
60444
60457
|
ctx.reportError(
|
|
60445
|
-
new
|
|
60458
|
+
new graphql24.GraphQLError(
|
|
60446
60459
|
"Encountered unknown arguments: " + JSON.stringify(unknown)
|
|
60447
60460
|
)
|
|
60448
60461
|
);
|
|
@@ -60454,7 +60467,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60454
60467
|
]
|
|
60455
60468
|
);
|
|
60456
60469
|
for (const [applied, target] of zipped) {
|
|
60457
|
-
if (applied.value.kind ===
|
|
60470
|
+
if (applied.value.kind === graphql24.Kind.VARIABLE || applied.value.kind === graphql24.Kind.LIST || applied.value.kind === graphql24.Kind.OBJECT) {
|
|
60458
60471
|
continue;
|
|
60459
60472
|
}
|
|
60460
60473
|
const appliedType = applied.value.kind.substring(
|
|
@@ -60463,7 +60476,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60463
60476
|
);
|
|
60464
60477
|
if (appliedType !== target) {
|
|
60465
60478
|
ctx.reportError(
|
|
60466
|
-
new
|
|
60479
|
+
new graphql24.GraphQLError(
|
|
60467
60480
|
`Invalid argument type. Expected ${target}, found ${appliedType}`
|
|
60468
60481
|
)
|
|
60469
60482
|
);
|
|
@@ -60484,7 +60497,7 @@ function paginateArgs(config2, filepath) {
|
|
|
60484
60497
|
}
|
|
60485
60498
|
if (alreadyPaginated) {
|
|
60486
60499
|
ctx.reportError(
|
|
60487
|
-
new
|
|
60500
|
+
new graphql24.GraphQLError(
|
|
60488
60501
|
`@${config2.paginateDirective} can only appear in a document once.`
|
|
60489
60502
|
)
|
|
60490
60503
|
);
|
|
@@ -60499,7 +60512,7 @@ function paginateArgs(config2, filepath) {
|
|
|
60499
60512
|
const hasRequiredArgs = definitionArgs.find((arg) => arg.required);
|
|
60500
60513
|
if (hasRequiredArgs) {
|
|
60501
60514
|
ctx.reportError(
|
|
60502
|
-
new
|
|
60515
|
+
new graphql24.GraphQLError(
|
|
60503
60516
|
"@paginate cannot appear on a document with required args"
|
|
60504
60517
|
)
|
|
60505
60518
|
);
|
|
@@ -60531,14 +60544,14 @@ function paginateArgs(config2, filepath) {
|
|
|
60531
60544
|
const backwards = appliedArgs.has("last");
|
|
60532
60545
|
if (!forward && !backwards) {
|
|
60533
60546
|
ctx.reportError(
|
|
60534
|
-
new
|
|
60547
|
+
new graphql24.GraphQLError(
|
|
60535
60548
|
"A field with cursor-based pagination must have a first or last argument"
|
|
60536
60549
|
)
|
|
60537
60550
|
);
|
|
60538
60551
|
}
|
|
60539
60552
|
if (forward && backwards) {
|
|
60540
60553
|
ctx.reportError(
|
|
60541
|
-
new
|
|
60554
|
+
new graphql24.GraphQLError(
|
|
60542
60555
|
`A field with cursor pagination cannot go forwards an backwards simultaneously`
|
|
60543
60556
|
)
|
|
60544
60557
|
);
|
|
@@ -60552,7 +60565,7 @@ function paginateArgs(config2, filepath) {
|
|
|
60552
60565
|
);
|
|
60553
60566
|
if (!appliedLimitArg) {
|
|
60554
60567
|
ctx.reportError(
|
|
60555
|
-
new
|
|
60568
|
+
new graphql24.GraphQLError(
|
|
60556
60569
|
"A field with offset-based pagination must have a limit argument"
|
|
60557
60570
|
)
|
|
60558
60571
|
);
|
|
@@ -60568,20 +60581,20 @@ function noUnusedFragmentArguments(config2) {
|
|
|
60568
60581
|
const args = /* @__PURE__ */ new Set();
|
|
60569
60582
|
return {
|
|
60570
60583
|
enter(node) {
|
|
60571
|
-
if (node.kind ===
|
|
60584
|
+
if (node.kind === graphql24.Kind.FRAGMENT_DEFINITION) {
|
|
60572
60585
|
const definitionArguments = node.directives?.filter((directive) => directive.name.value === config2.argumentsDirective).flatMap((directive) => directive.arguments);
|
|
60573
60586
|
for (const arg of definitionArguments?.map((arg2) => arg2?.name.value) || []) {
|
|
60574
60587
|
args.add(arg);
|
|
60575
60588
|
}
|
|
60576
|
-
} else if (node.kind ===
|
|
60589
|
+
} else if (node.kind === graphql24.Kind.VARIABLE) {
|
|
60577
60590
|
args.delete(node.name.value);
|
|
60578
60591
|
}
|
|
60579
60592
|
},
|
|
60580
60593
|
leave(node) {
|
|
60581
|
-
if (node.kind ===
|
|
60594
|
+
if (node.kind === graphql24.Kind.FRAGMENT_DEFINITION) {
|
|
60582
60595
|
if (args.size > 0) {
|
|
60583
60596
|
ctx.reportError(
|
|
60584
|
-
new
|
|
60597
|
+
new graphql24.GraphQLError(
|
|
60585
60598
|
"Encountered unused fragment arguments: " + [...args].join(",")
|
|
60586
60599
|
)
|
|
60587
60600
|
);
|
|
@@ -60617,7 +60630,7 @@ function nodeDirectives(config2, directives) {
|
|
|
60617
60630
|
if (definition.kind === "OperationDefinition") {
|
|
60618
60631
|
if (definition.operation !== "query") {
|
|
60619
60632
|
ctx.reportError(
|
|
60620
|
-
new
|
|
60633
|
+
new graphql24.GraphQLError(
|
|
60621
60634
|
`@${node.name.value} must fall on a fragment or query document`
|
|
60622
60635
|
)
|
|
60623
60636
|
);
|
|
@@ -60629,7 +60642,7 @@ function nodeDirectives(config2, directives) {
|
|
|
60629
60642
|
}
|
|
60630
60643
|
if (!possibleNodes.includes(definitionType)) {
|
|
60631
60644
|
ctx.reportError(
|
|
60632
|
-
new
|
|
60645
|
+
new graphql24.GraphQLError(paginateOnNonNodeMessage(config2, node.name.value))
|
|
60633
60646
|
);
|
|
60634
60647
|
}
|
|
60635
60648
|
}
|
|
@@ -60648,7 +60661,7 @@ function checkMutationOperation(config2) {
|
|
|
60648
60661
|
);
|
|
60649
60662
|
if (append && prepend) {
|
|
60650
60663
|
ctx.reportError(
|
|
60651
|
-
new
|
|
60664
|
+
new graphql24.GraphQLError(
|
|
60652
60665
|
`You can't apply both @${config2.listPrependDirective} and @${config2.listAppendDirective} at the same time`
|
|
60653
60666
|
)
|
|
60654
60667
|
);
|
|
@@ -60662,7 +60675,7 @@ function checkMutationOperation(config2) {
|
|
|
60662
60675
|
);
|
|
60663
60676
|
if (parentId && allLists) {
|
|
60664
60677
|
ctx.reportError(
|
|
60665
|
-
new
|
|
60678
|
+
new graphql24.GraphQLError(
|
|
60666
60679
|
`You can't apply both @${config2.listParentDirective} and @${config2.listAllListsDirective} at the same time`
|
|
60667
60680
|
)
|
|
60668
60681
|
);
|
|
@@ -60684,7 +60697,7 @@ function checkMaskDirective(config2) {
|
|
|
60684
60697
|
);
|
|
60685
60698
|
if (maskEnableDirective && maskDisableDirective) {
|
|
60686
60699
|
ctx.reportError(
|
|
60687
|
-
new
|
|
60700
|
+
new graphql24.GraphQLError(
|
|
60688
60701
|
`You can't apply both @${config2.maskEnableDirective} and @${config2.maskDisableDirective} at the same time`
|
|
60689
60702
|
)
|
|
60690
60703
|
);
|
|
@@ -60700,7 +60713,7 @@ function getAndVerifyNodeInterface(config2) {
|
|
|
60700
60713
|
if (!nodeInterface) {
|
|
60701
60714
|
return null;
|
|
60702
60715
|
}
|
|
60703
|
-
if (!
|
|
60716
|
+
if (!graphql24.isInterfaceType(nodeInterface)) {
|
|
60704
60717
|
displayInvalidNodeFieldMessage(config2.logLevel);
|
|
60705
60718
|
return null;
|
|
60706
60719
|
}
|
|
@@ -60798,11 +60811,11 @@ async function uniqueDocumentNames(config2, docs) {
|
|
|
60798
60811
|
}
|
|
60799
60812
|
|
|
60800
60813
|
// src/codegen/validators/noIDAlias.ts
|
|
60801
|
-
var
|
|
60814
|
+
var graphql25 = __toESM(require_graphql2(), 1);
|
|
60802
60815
|
async function noIDAlias(config2, docs) {
|
|
60803
60816
|
const errors = [];
|
|
60804
60817
|
for (const { filename, document } of docs) {
|
|
60805
|
-
|
|
60818
|
+
graphql25.visit(document, {
|
|
60806
60819
|
Field(node, _, __, ___, ancestors) {
|
|
60807
60820
|
const fieldType = parentTypeFromAncestors(config2.schema, filename, ancestors).name;
|
|
60808
60821
|
if (config2.keyFieldsForType(fieldType).includes(node.alias?.value || "")) {
|
|
@@ -61000,12 +61013,12 @@ async function processJSFile(config2, contents) {
|
|
|
61000
61013
|
return documents;
|
|
61001
61014
|
}
|
|
61002
61015
|
async function processGraphQLDocument(config2, filepath, document) {
|
|
61003
|
-
const parsedDoc =
|
|
61016
|
+
const parsedDoc = graphql26.parse(document);
|
|
61004
61017
|
const operations = parsedDoc.definitions.filter(
|
|
61005
|
-
({ kind: kind2 }) => kind2 ===
|
|
61018
|
+
({ kind: kind2 }) => kind2 === graphql26.Kind.OPERATION_DEFINITION
|
|
61006
61019
|
);
|
|
61007
61020
|
const fragments = parsedDoc.definitions.filter(
|
|
61008
|
-
({ kind: kind2 }) => kind2 ===
|
|
61021
|
+
({ kind: kind2 }) => kind2 === graphql26.Kind.FRAGMENT_DEFINITION
|
|
61009
61022
|
);
|
|
61010
61023
|
if (operations.length > 1) {
|
|
61011
61024
|
throw new HoudiniError({
|