houdini 0.18.3 → 0.19.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 +961 -534
- package/build/cmd-esm/index.js +961 -534
- package/build/codegen/generators/artifacts/utils.d.ts +2 -1
- package/build/codegen/generators/runtime/index.d.ts +2 -2
- package/build/codegen/generators/typescript/addReferencedInputTypes.d.ts +1 -1
- package/build/codegen/generators/typescript/imperativeCache.d.ts +2 -0
- package/build/codegen/generators/typescript/typeReference.d.ts +1 -1
- package/build/codegen-cjs/index.js +861 -483
- package/build/codegen-esm/index.js +861 -483
- package/build/lib/config.d.ts +27 -10
- package/build/lib-cjs/index.js +172 -64
- package/build/lib-esm/index.js +171 -64
- package/build/runtime/cache/cache.d.ts +5 -2
- package/build/runtime/cache/schema.d.ts +21 -0
- package/build/runtime/generated.d.ts +4 -0
- package/build/runtime/index.d.ts +6 -3
- package/build/runtime/lib/config.d.ts +7 -3
- package/build/runtime/lib/network.d.ts +2 -2
- package/build/runtime/lib/types.d.ts +2 -2
- package/build/runtime/public/cache.d.ts +19 -0
- package/build/runtime/public/index.d.ts +1 -0
- package/build/runtime/public/list.d.ts +18 -0
- package/build/runtime/public/record.d.ts +31 -0
- package/build/runtime/public/tests/test.d.ts +114 -0
- package/build/runtime/public/types.d.ts +36 -0
- package/build/runtime-cjs/cache/cache.d.ts +5 -2
- package/build/runtime-cjs/cache/cache.js +16 -5
- package/build/runtime-cjs/cache/schema.d.ts +21 -0
- package/build/runtime-cjs/cache/schema.js +66 -0
- package/build/runtime-cjs/generated.d.ts +4 -0
- package/build/runtime-cjs/generated.js +16 -0
- package/build/runtime-cjs/index.d.ts +6 -3
- package/build/runtime-cjs/index.js +4 -0
- package/build/runtime-cjs/lib/config.d.ts +7 -3
- package/build/runtime-cjs/lib/network.d.ts +2 -2
- package/build/runtime-cjs/lib/network.js +2 -2
- package/build/runtime-cjs/lib/types.d.ts +2 -2
- package/build/runtime-cjs/public/cache.d.ts +19 -0
- package/build/runtime-cjs/public/cache.js +97 -0
- package/build/runtime-cjs/public/index.d.ts +1 -0
- package/build/runtime-cjs/public/index.js +28 -0
- package/build/runtime-cjs/public/list.d.ts +18 -0
- package/build/runtime-cjs/public/list.js +163 -0
- package/build/runtime-cjs/public/record.d.ts +31 -0
- package/build/runtime-cjs/public/record.js +249 -0
- package/build/runtime-cjs/public/tests/test.d.ts +114 -0
- package/build/runtime-cjs/public/tests/test.js +31 -0
- package/build/runtime-cjs/public/types.d.ts +36 -0
- package/build/runtime-cjs/public/types.js +16 -0
- package/build/runtime-esm/cache/cache.d.ts +5 -2
- package/build/runtime-esm/cache/cache.js +16 -5
- package/build/runtime-esm/cache/schema.d.ts +21 -0
- package/build/runtime-esm/cache/schema.js +42 -0
- package/build/runtime-esm/generated.d.ts +4 -0
- package/build/runtime-esm/generated.js +0 -0
- package/build/runtime-esm/index.d.ts +6 -3
- package/build/runtime-esm/index.js +5 -2
- package/build/runtime-esm/lib/config.d.ts +7 -3
- package/build/runtime-esm/lib/network.d.ts +2 -2
- package/build/runtime-esm/lib/network.js +2 -2
- package/build/runtime-esm/lib/types.d.ts +2 -2
- package/build/runtime-esm/public/cache.d.ts +19 -0
- package/build/runtime-esm/public/cache.js +72 -0
- package/build/runtime-esm/public/index.d.ts +1 -0
- package/build/runtime-esm/public/index.js +4 -0
- package/build/runtime-esm/public/list.d.ts +18 -0
- package/build/runtime-esm/public/list.js +139 -0
- package/build/runtime-esm/public/record.d.ts +31 -0
- package/build/runtime-esm/public/record.js +222 -0
- package/build/runtime-esm/public/tests/test.d.ts +114 -0
- package/build/runtime-esm/public/tests/test.js +7 -0
- package/build/runtime-esm/public/types.d.ts +36 -0
- package/build/runtime-esm/public/types.js +0 -0
- package/build/test-cjs/index.js +857 -466
- package/build/test-esm/index.js +857 -466
- package/build/vite-cjs/index.js +939 -527
- package/build/vite-esm/index.js +939 -527
- package/package.json +2 -2
|
@@ -1977,12 +1977,12 @@ var require_parser = __commonJS({
|
|
|
1977
1977
|
return [];
|
|
1978
1978
|
}
|
|
1979
1979
|
if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {
|
|
1980
|
-
var
|
|
1980
|
+
var types14 = [];
|
|
1981
1981
|
this.expectOptionalToken(_tokenKind.TokenKind.AMP);
|
|
1982
1982
|
do {
|
|
1983
|
-
|
|
1983
|
+
types14.push(this.parseNamedType());
|
|
1984
1984
|
} while (this.expectOptionalToken(_tokenKind.TokenKind.AMP) || this.peek(_tokenKind.TokenKind.NAME));
|
|
1985
|
-
return
|
|
1985
|
+
return types14;
|
|
1986
1986
|
}
|
|
1987
1987
|
return this.delimitedMany(_tokenKind.TokenKind.AMP, this.parseNamedType);
|
|
1988
1988
|
};
|
|
@@ -2061,13 +2061,13 @@ var require_parser = __commonJS({
|
|
|
2061
2061
|
this.expectKeyword("union");
|
|
2062
2062
|
var name2 = this.parseName();
|
|
2063
2063
|
var directives = this.parseDirectives(true);
|
|
2064
|
-
var
|
|
2064
|
+
var types14 = this.parseUnionMemberTypes();
|
|
2065
2065
|
return {
|
|
2066
2066
|
kind: _kinds.Kind.UNION_TYPE_DEFINITION,
|
|
2067
2067
|
description,
|
|
2068
2068
|
name: name2,
|
|
2069
2069
|
directives,
|
|
2070
|
-
types:
|
|
2070
|
+
types: types14,
|
|
2071
2071
|
loc: this.loc(start)
|
|
2072
2072
|
};
|
|
2073
2073
|
};
|
|
@@ -2225,15 +2225,15 @@ var require_parser = __commonJS({
|
|
|
2225
2225
|
this.expectKeyword("union");
|
|
2226
2226
|
var name2 = this.parseName();
|
|
2227
2227
|
var directives = this.parseDirectives(true);
|
|
2228
|
-
var
|
|
2229
|
-
if (directives.length === 0 &&
|
|
2228
|
+
var types14 = this.parseUnionMemberTypes();
|
|
2229
|
+
if (directives.length === 0 && types14.length === 0) {
|
|
2230
2230
|
throw this.unexpected();
|
|
2231
2231
|
}
|
|
2232
2232
|
return {
|
|
2233
2233
|
kind: _kinds.Kind.UNION_TYPE_EXTENSION,
|
|
2234
2234
|
name: name2,
|
|
2235
2235
|
directives,
|
|
2236
|
-
types:
|
|
2236
|
+
types: types14,
|
|
2237
2237
|
loc: this.loc(start)
|
|
2238
2238
|
};
|
|
2239
2239
|
};
|
|
@@ -2403,7 +2403,7 @@ var require_visitor = __commonJS({
|
|
|
2403
2403
|
Object.defineProperty(exports, "__esModule", {
|
|
2404
2404
|
value: true
|
|
2405
2405
|
});
|
|
2406
|
-
exports.visit =
|
|
2406
|
+
exports.visit = visit12;
|
|
2407
2407
|
exports.visitInParallel = visitInParallel;
|
|
2408
2408
|
exports.getVisitFn = getVisitFn;
|
|
2409
2409
|
exports.BREAK = exports.QueryDocumentKeys = void 0;
|
|
@@ -2466,7 +2466,7 @@ var require_visitor = __commonJS({
|
|
|
2466
2466
|
exports.QueryDocumentKeys = QueryDocumentKeys;
|
|
2467
2467
|
var BREAK = Object.freeze({});
|
|
2468
2468
|
exports.BREAK = BREAK;
|
|
2469
|
-
function
|
|
2469
|
+
function visit12(root, visitor) {
|
|
2470
2470
|
var visitorKeys = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : QueryDocumentKeys;
|
|
2471
2471
|
var stack = void 0;
|
|
2472
2472
|
var inArray = Array.isArray(root);
|
|
@@ -3211,8 +3211,8 @@ var require_printer = __commonJS({
|
|
|
3211
3211
|
return join2(["interface", name2, wrap("implements ", join2(interfaces, " & ")), join2(directives, " "), block(fields)], " ");
|
|
3212
3212
|
}),
|
|
3213
3213
|
UnionTypeDefinition: addDescription(function(_ref27) {
|
|
3214
|
-
var name2 = _ref27.name, directives = _ref27.directives,
|
|
3215
|
-
return join2(["union", name2, join2(directives, " "),
|
|
3214
|
+
var name2 = _ref27.name, directives = _ref27.directives, types14 = _ref27.types;
|
|
3215
|
+
return join2(["union", name2, join2(directives, " "), types14 && types14.length !== 0 ? "= " + join2(types14, " | ") : ""], " ");
|
|
3216
3216
|
}),
|
|
3217
3217
|
EnumTypeDefinition: addDescription(function(_ref28) {
|
|
3218
3218
|
var name2 = _ref28.name, directives = _ref28.directives, values = _ref28.values;
|
|
@@ -3247,8 +3247,8 @@ var require_printer = __commonJS({
|
|
|
3247
3247
|
return join2(["extend interface", name2, wrap("implements ", join2(interfaces, " & ")), join2(directives, " "), block(fields)], " ");
|
|
3248
3248
|
},
|
|
3249
3249
|
UnionTypeExtension: function UnionTypeExtension(_ref36) {
|
|
3250
|
-
var name2 = _ref36.name, directives = _ref36.directives,
|
|
3251
|
-
return join2(["extend union", name2, join2(directives, " "),
|
|
3250
|
+
var name2 = _ref36.name, directives = _ref36.directives, types14 = _ref36.types;
|
|
3251
|
+
return join2(["extend union", name2, join2(directives, " "), types14 && types14.length !== 0 ? "= " + join2(types14, " | ") : ""], " ");
|
|
3252
3252
|
},
|
|
3253
3253
|
EnumTypeExtension: function EnumTypeExtension(_ref37) {
|
|
3254
3254
|
var name2 = _ref37.name, directives = _ref37.directives, values = _ref37.values;
|
|
@@ -3344,17 +3344,17 @@ var require_definition = __commonJS({
|
|
|
3344
3344
|
});
|
|
3345
3345
|
exports.isType = isType;
|
|
3346
3346
|
exports.assertType = assertType;
|
|
3347
|
-
exports.isScalarType =
|
|
3347
|
+
exports.isScalarType = isScalarType7;
|
|
3348
3348
|
exports.assertScalarType = assertScalarType;
|
|
3349
|
-
exports.isObjectType =
|
|
3349
|
+
exports.isObjectType = isObjectType3;
|
|
3350
3350
|
exports.assertObjectType = assertObjectType;
|
|
3351
3351
|
exports.isInterfaceType = isInterfaceType6;
|
|
3352
3352
|
exports.assertInterfaceType = assertInterfaceType;
|
|
3353
3353
|
exports.isUnionType = isUnionType7;
|
|
3354
3354
|
exports.assertUnionType = assertUnionType;
|
|
3355
|
-
exports.isEnumType =
|
|
3355
|
+
exports.isEnumType = isEnumType5;
|
|
3356
3356
|
exports.assertEnumType = assertEnumType;
|
|
3357
|
-
exports.isInputObjectType =
|
|
3357
|
+
exports.isInputObjectType = isInputObjectType2;
|
|
3358
3358
|
exports.assertInputObjectType = assertInputObjectType;
|
|
3359
3359
|
exports.isListType = isListType3;
|
|
3360
3360
|
exports.assertListType = assertListType;
|
|
@@ -3368,7 +3368,7 @@ var require_definition = __commonJS({
|
|
|
3368
3368
|
exports.assertLeafType = assertLeafType;
|
|
3369
3369
|
exports.isCompositeType = isCompositeType;
|
|
3370
3370
|
exports.assertCompositeType = assertCompositeType;
|
|
3371
|
-
exports.isAbstractType =
|
|
3371
|
+
exports.isAbstractType = isAbstractType3;
|
|
3372
3372
|
exports.assertAbstractType = assertAbstractType;
|
|
3373
3373
|
exports.GraphQLList = GraphQLList2;
|
|
3374
3374
|
exports.GraphQLNonNull = GraphQLNonNull2;
|
|
@@ -3423,7 +3423,7 @@ var require_definition = __commonJS({
|
|
|
3423
3423
|
return Constructor;
|
|
3424
3424
|
}
|
|
3425
3425
|
function isType(type) {
|
|
3426
|
-
return
|
|
3426
|
+
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) || isEnumType5(type) || isInputObjectType2(type) || isListType3(type) || isNonNullType6(type);
|
|
3427
3427
|
}
|
|
3428
3428
|
function assertType(type) {
|
|
3429
3429
|
if (!isType(type)) {
|
|
@@ -3431,20 +3431,20 @@ var require_definition = __commonJS({
|
|
|
3431
3431
|
}
|
|
3432
3432
|
return type;
|
|
3433
3433
|
}
|
|
3434
|
-
function
|
|
3434
|
+
function isScalarType7(type) {
|
|
3435
3435
|
return (0, _instanceOf.default)(type, GraphQLScalarType);
|
|
3436
3436
|
}
|
|
3437
3437
|
function assertScalarType(type) {
|
|
3438
|
-
if (!
|
|
3438
|
+
if (!isScalarType7(type)) {
|
|
3439
3439
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Scalar type."));
|
|
3440
3440
|
}
|
|
3441
3441
|
return type;
|
|
3442
3442
|
}
|
|
3443
|
-
function
|
|
3443
|
+
function isObjectType3(type) {
|
|
3444
3444
|
return (0, _instanceOf.default)(type, GraphQLObjectType2);
|
|
3445
3445
|
}
|
|
3446
3446
|
function assertObjectType(type) {
|
|
3447
|
-
if (!
|
|
3447
|
+
if (!isObjectType3(type)) {
|
|
3448
3448
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Object type."));
|
|
3449
3449
|
}
|
|
3450
3450
|
return type;
|
|
@@ -3467,20 +3467,20 @@ var require_definition = __commonJS({
|
|
|
3467
3467
|
}
|
|
3468
3468
|
return type;
|
|
3469
3469
|
}
|
|
3470
|
-
function
|
|
3470
|
+
function isEnumType5(type) {
|
|
3471
3471
|
return (0, _instanceOf.default)(type, GraphQLEnumType);
|
|
3472
3472
|
}
|
|
3473
3473
|
function assertEnumType(type) {
|
|
3474
|
-
if (!
|
|
3474
|
+
if (!isEnumType5(type)) {
|
|
3475
3475
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Enum type."));
|
|
3476
3476
|
}
|
|
3477
3477
|
return type;
|
|
3478
3478
|
}
|
|
3479
|
-
function
|
|
3479
|
+
function isInputObjectType2(type) {
|
|
3480
3480
|
return (0, _instanceOf.default)(type, GraphQLInputObjectType);
|
|
3481
3481
|
}
|
|
3482
3482
|
function assertInputObjectType(type) {
|
|
3483
|
-
if (!
|
|
3483
|
+
if (!isInputObjectType2(type)) {
|
|
3484
3484
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Input Object type."));
|
|
3485
3485
|
}
|
|
3486
3486
|
return type;
|
|
@@ -3504,7 +3504,7 @@ var require_definition = __commonJS({
|
|
|
3504
3504
|
return type;
|
|
3505
3505
|
}
|
|
3506
3506
|
function isInputType(type) {
|
|
3507
|
-
return
|
|
3507
|
+
return isScalarType7(type) || isEnumType5(type) || isInputObjectType2(type) || isWrappingType(type) && isInputType(type.ofType);
|
|
3508
3508
|
}
|
|
3509
3509
|
function assertInputType(type) {
|
|
3510
3510
|
if (!isInputType(type)) {
|
|
@@ -3513,7 +3513,7 @@ var require_definition = __commonJS({
|
|
|
3513
3513
|
return type;
|
|
3514
3514
|
}
|
|
3515
3515
|
function isOutputType(type) {
|
|
3516
|
-
return
|
|
3516
|
+
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) || isEnumType5(type) || isWrappingType(type) && isOutputType(type.ofType);
|
|
3517
3517
|
}
|
|
3518
3518
|
function assertOutputType(type) {
|
|
3519
3519
|
if (!isOutputType(type)) {
|
|
@@ -3522,7 +3522,7 @@ var require_definition = __commonJS({
|
|
|
3522
3522
|
return type;
|
|
3523
3523
|
}
|
|
3524
3524
|
function isLeafType(type) {
|
|
3525
|
-
return
|
|
3525
|
+
return isScalarType7(type) || isEnumType5(type);
|
|
3526
3526
|
}
|
|
3527
3527
|
function assertLeafType(type) {
|
|
3528
3528
|
if (!isLeafType(type)) {
|
|
@@ -3531,7 +3531,7 @@ var require_definition = __commonJS({
|
|
|
3531
3531
|
return type;
|
|
3532
3532
|
}
|
|
3533
3533
|
function isCompositeType(type) {
|
|
3534
|
-
return
|
|
3534
|
+
return isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type);
|
|
3535
3535
|
}
|
|
3536
3536
|
function assertCompositeType(type) {
|
|
3537
3537
|
if (!isCompositeType(type)) {
|
|
@@ -3539,11 +3539,11 @@ var require_definition = __commonJS({
|
|
|
3539
3539
|
}
|
|
3540
3540
|
return type;
|
|
3541
3541
|
}
|
|
3542
|
-
function
|
|
3542
|
+
function isAbstractType3(type) {
|
|
3543
3543
|
return isInterfaceType6(type) || isUnionType7(type);
|
|
3544
3544
|
}
|
|
3545
3545
|
function assertAbstractType(type) {
|
|
3546
|
-
if (!
|
|
3546
|
+
if (!isAbstractType3(type)) {
|
|
3547
3547
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL abstract type."));
|
|
3548
3548
|
}
|
|
3549
3549
|
return type;
|
|
@@ -3610,7 +3610,7 @@ var require_definition = __commonJS({
|
|
|
3610
3610
|
}
|
|
3611
3611
|
}
|
|
3612
3612
|
function isNamedType(type) {
|
|
3613
|
-
return
|
|
3613
|
+
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) || isEnumType5(type) || isInputObjectType2(type);
|
|
3614
3614
|
}
|
|
3615
3615
|
function assertNamedType(type) {
|
|
3616
3616
|
if (!isNamedType(type)) {
|
|
@@ -3919,9 +3919,9 @@ var require_definition = __commonJS({
|
|
|
3919
3919
|
exports.GraphQLUnionType = GraphQLUnionType;
|
|
3920
3920
|
(0, _defineInspect.default)(GraphQLUnionType);
|
|
3921
3921
|
function defineTypes(config2) {
|
|
3922
|
-
var
|
|
3923
|
-
Array.isArray(
|
|
3924
|
-
return
|
|
3922
|
+
var types14 = resolveThunk(config2.types);
|
|
3923
|
+
Array.isArray(types14) || (0, _devAssert.default)(0, "Must provide Array of types or a function which returns such an array for Union ".concat(config2.name, "."));
|
|
3924
|
+
return types14;
|
|
3925
3925
|
}
|
|
3926
3926
|
var GraphQLEnumType = /* @__PURE__ */ function() {
|
|
3927
3927
|
function GraphQLEnumType2(config2) {
|
|
@@ -9759,7 +9759,7 @@ var require_graphql = __commonJS({
|
|
|
9759
9759
|
Object.defineProperty(exports, "__esModule", {
|
|
9760
9760
|
value: true
|
|
9761
9761
|
});
|
|
9762
|
-
exports.graphql =
|
|
9762
|
+
exports.graphql = graphql28;
|
|
9763
9763
|
exports.graphqlSync = graphqlSync;
|
|
9764
9764
|
var _isPromise = _interopRequireDefault(require_isPromise());
|
|
9765
9765
|
var _parser = require_parser();
|
|
@@ -9769,7 +9769,7 @@ var require_graphql = __commonJS({
|
|
|
9769
9769
|
function _interopRequireDefault(obj) {
|
|
9770
9770
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
9771
9771
|
}
|
|
9772
|
-
function
|
|
9772
|
+
function graphql28(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) {
|
|
9773
9773
|
var _arguments = arguments;
|
|
9774
9774
|
return new Promise(function(resolve2) {
|
|
9775
9775
|
return resolve2(
|
|
@@ -11558,7 +11558,7 @@ var require_buildClientSchema = __commonJS({
|
|
|
11558
11558
|
return new _definition.GraphQLUnionType({
|
|
11559
11559
|
name: unionIntrospection.name,
|
|
11560
11560
|
description: unionIntrospection.description,
|
|
11561
|
-
types: function
|
|
11561
|
+
types: function types14() {
|
|
11562
11562
|
return unionIntrospection.possibleTypes.map(getObjectType);
|
|
11563
11563
|
}
|
|
11564
11564
|
});
|
|
@@ -11903,7 +11903,7 @@ var require_extendSchema = __commonJS({
|
|
|
11903
11903
|
var config2 = type.toConfig();
|
|
11904
11904
|
var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
|
|
11905
11905
|
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config2), {}, {
|
|
11906
|
-
types: function
|
|
11906
|
+
types: function types14() {
|
|
11907
11907
|
return [].concat(type.getTypes().map(replaceNamedType), buildUnionTypes(extensions));
|
|
11908
11908
|
},
|
|
11909
11909
|
extensionASTNodes: config2.extensionASTNodes.concat(extensions)
|
|
@@ -12051,17 +12051,17 @@ var require_extendSchema = __commonJS({
|
|
|
12051
12051
|
return interfaces;
|
|
12052
12052
|
}
|
|
12053
12053
|
function buildUnionTypes(nodes) {
|
|
12054
|
-
var
|
|
12054
|
+
var types14 = [];
|
|
12055
12055
|
for (var _i32 = 0; _i32 < nodes.length; _i32++) {
|
|
12056
12056
|
var _node$types;
|
|
12057
12057
|
var node = nodes[_i32];
|
|
12058
12058
|
var typeNodes = (_node$types = node.types) !== null && _node$types !== void 0 ? _node$types : [];
|
|
12059
12059
|
for (var _i34 = 0; _i34 < typeNodes.length; _i34++) {
|
|
12060
12060
|
var type = typeNodes[_i34];
|
|
12061
|
-
|
|
12061
|
+
types14.push(getNamedType2(type));
|
|
12062
12062
|
}
|
|
12063
12063
|
}
|
|
12064
|
-
return
|
|
12064
|
+
return types14;
|
|
12065
12065
|
}
|
|
12066
12066
|
function buildType(astNode) {
|
|
12067
12067
|
var _typeExtensionsMap$na;
|
|
@@ -12118,7 +12118,7 @@ var require_extendSchema = __commonJS({
|
|
|
12118
12118
|
return new _definition.GraphQLUnionType({
|
|
12119
12119
|
name: name3,
|
|
12120
12120
|
description,
|
|
12121
|
-
types: function
|
|
12121
|
+
types: function types14() {
|
|
12122
12122
|
return buildUnionTypes(_allNodes3);
|
|
12123
12123
|
},
|
|
12124
12124
|
astNode,
|
|
@@ -12416,7 +12416,7 @@ var require_lexicographicSortSchema = __commonJS({
|
|
|
12416
12416
|
if ((0, _definition.isUnionType)(type)) {
|
|
12417
12417
|
var _config2 = type.toConfig();
|
|
12418
12418
|
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, _config2), {}, {
|
|
12419
|
-
types: function
|
|
12419
|
+
types: function types14() {
|
|
12420
12420
|
return sortTypes(_config2.types);
|
|
12421
12421
|
}
|
|
12422
12422
|
}));
|
|
@@ -12501,10 +12501,10 @@ var require_printSchema = __commonJS({
|
|
|
12501
12501
|
}
|
|
12502
12502
|
function printFilteredSchema(schema, directiveFilter, typeFilter, options) {
|
|
12503
12503
|
var directives = schema.getDirectives().filter(directiveFilter);
|
|
12504
|
-
var
|
|
12504
|
+
var types14 = (0, _objectValues.default)(schema.getTypeMap()).filter(typeFilter);
|
|
12505
12505
|
return [printSchemaDefinition(schema)].concat(directives.map(function(directive) {
|
|
12506
12506
|
return printDirective(directive, options);
|
|
12507
|
-
}),
|
|
12507
|
+
}), types14.map(function(type) {
|
|
12508
12508
|
return printType(type, options);
|
|
12509
12509
|
})).filter(Boolean).join("\n\n") + "\n";
|
|
12510
12510
|
}
|
|
@@ -12579,8 +12579,8 @@ var require_printSchema = __commonJS({
|
|
|
12579
12579
|
return printDescription(options, type) + "interface ".concat(type.name) + printImplementedInterfaces(type) + printFields(options, type);
|
|
12580
12580
|
}
|
|
12581
12581
|
function printUnion(type, options) {
|
|
12582
|
-
var
|
|
12583
|
-
var possibleTypes =
|
|
12582
|
+
var types14 = type.getTypes();
|
|
12583
|
+
var possibleTypes = types14.length ? " = " + types14.join(" | ") : "";
|
|
12584
12584
|
return printDescription(options, type) + "union " + type.name + possibleTypes;
|
|
12585
12585
|
}
|
|
12586
12586
|
function printEnum(type, options) {
|
|
@@ -23908,14 +23908,14 @@ var require_lib3 = __commonJS({
|
|
|
23908
23908
|
this.preserveSpace = !!preserveSpace;
|
|
23909
23909
|
}
|
|
23910
23910
|
};
|
|
23911
|
-
var
|
|
23911
|
+
var types14 = {
|
|
23912
23912
|
brace: new TokContext("{"),
|
|
23913
23913
|
j_oTag: new TokContext("<tag"),
|
|
23914
23914
|
j_cTag: new TokContext("</tag"),
|
|
23915
23915
|
j_expr: new TokContext("<tag>...</tag>", true)
|
|
23916
23916
|
};
|
|
23917
23917
|
{
|
|
23918
|
-
|
|
23918
|
+
types14.template = new TokContext("`", true);
|
|
23919
23919
|
}
|
|
23920
23920
|
var beforeExpr = true;
|
|
23921
23921
|
var startsExpr = true;
|
|
@@ -24447,17 +24447,17 @@ var require_lib3 = __commonJS({
|
|
|
24447
24447
|
context.pop();
|
|
24448
24448
|
};
|
|
24449
24449
|
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
|
|
24450
|
-
context.push(
|
|
24450
|
+
context.push(types14.brace);
|
|
24451
24451
|
};
|
|
24452
24452
|
tokenTypes[22].updateContext = (context) => {
|
|
24453
|
-
if (context[context.length - 1] ===
|
|
24453
|
+
if (context[context.length - 1] === types14.template) {
|
|
24454
24454
|
context.pop();
|
|
24455
24455
|
} else {
|
|
24456
|
-
context.push(
|
|
24456
|
+
context.push(types14.template);
|
|
24457
24457
|
}
|
|
24458
24458
|
};
|
|
24459
24459
|
tokenTypes[140].updateContext = (context) => {
|
|
24460
|
-
context.push(
|
|
24460
|
+
context.push(types14.j_expr, types14.j_oTag);
|
|
24461
24461
|
};
|
|
24462
24462
|
}
|
|
24463
24463
|
var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC";
|
|
@@ -25098,7 +25098,7 @@ var require_lib3 = __commonJS({
|
|
|
25098
25098
|
this.lastTokEndLoc = null;
|
|
25099
25099
|
this.lastTokStartLoc = null;
|
|
25100
25100
|
this.lastTokStart = 0;
|
|
25101
|
-
this.context = [
|
|
25101
|
+
this.context = [types14.brace];
|
|
25102
25102
|
this.canStartJSXElement = true;
|
|
25103
25103
|
this.containsEsc = false;
|
|
25104
25104
|
this.firstInvalidTemplateEscapePos = null;
|
|
@@ -29022,7 +29022,7 @@ var require_lib3 = __commonJS({
|
|
|
29022
29022
|
context
|
|
29023
29023
|
} = this.state;
|
|
29024
29024
|
const currentContext = context[context.length - 1];
|
|
29025
|
-
if (currentContext ===
|
|
29025
|
+
if (currentContext === types14.j_oTag || currentContext === types14.j_expr) {
|
|
29026
29026
|
context.pop();
|
|
29027
29027
|
}
|
|
29028
29028
|
}
|
|
@@ -30082,9 +30082,9 @@ var require_lib3 = __commonJS({
|
|
|
30082
30082
|
switch (this.state.type) {
|
|
30083
30083
|
case 5:
|
|
30084
30084
|
node = this.startNode();
|
|
30085
|
-
this.setContext(
|
|
30085
|
+
this.setContext(types14.brace);
|
|
30086
30086
|
this.next();
|
|
30087
|
-
node = this.jsxParseExpressionContainer(node,
|
|
30087
|
+
node = this.jsxParseExpressionContainer(node, types14.j_oTag);
|
|
30088
30088
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
30089
30089
|
this.raise(JsxErrors.AttributeIsEmpty, {
|
|
30090
30090
|
at: node
|
|
@@ -30107,7 +30107,7 @@ var require_lib3 = __commonJS({
|
|
|
30107
30107
|
jsxParseSpreadChild(node) {
|
|
30108
30108
|
this.next();
|
|
30109
30109
|
node.expression = this.parseExpression();
|
|
30110
|
-
this.setContext(
|
|
30110
|
+
this.setContext(types14.j_expr);
|
|
30111
30111
|
this.state.canStartJSXElement = true;
|
|
30112
30112
|
this.expect(8);
|
|
30113
30113
|
return this.finishNode(node, "JSXSpreadChild");
|
|
@@ -30127,11 +30127,11 @@ var require_lib3 = __commonJS({
|
|
|
30127
30127
|
jsxParseAttribute() {
|
|
30128
30128
|
const node = this.startNode();
|
|
30129
30129
|
if (this.match(5)) {
|
|
30130
|
-
this.setContext(
|
|
30130
|
+
this.setContext(types14.brace);
|
|
30131
30131
|
this.next();
|
|
30132
30132
|
this.expect(21);
|
|
30133
30133
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
30134
|
-
this.setContext(
|
|
30134
|
+
this.setContext(types14.j_oTag);
|
|
30135
30135
|
this.state.canStartJSXElement = true;
|
|
30136
30136
|
this.expect(8);
|
|
30137
30137
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
@@ -30190,12 +30190,12 @@ var require_lib3 = __commonJS({
|
|
|
30190
30190
|
break;
|
|
30191
30191
|
case 5: {
|
|
30192
30192
|
const node2 = this.startNode();
|
|
30193
|
-
this.setContext(
|
|
30193
|
+
this.setContext(types14.brace);
|
|
30194
30194
|
this.next();
|
|
30195
30195
|
if (this.match(21)) {
|
|
30196
30196
|
children.push(this.jsxParseSpreadChild(node2));
|
|
30197
30197
|
} else {
|
|
30198
|
-
children.push(this.jsxParseExpressionContainer(node2,
|
|
30198
|
+
children.push(this.jsxParseExpressionContainer(node2, types14.j_expr));
|
|
30199
30199
|
}
|
|
30200
30200
|
break;
|
|
30201
30201
|
}
|
|
@@ -30266,10 +30266,10 @@ var require_lib3 = __commonJS({
|
|
|
30266
30266
|
}
|
|
30267
30267
|
getTokenFromCode(code) {
|
|
30268
30268
|
const context = this.curContext();
|
|
30269
|
-
if (context ===
|
|
30269
|
+
if (context === types14.j_expr) {
|
|
30270
30270
|
return this.jsxReadToken();
|
|
30271
30271
|
}
|
|
30272
|
-
if (context ===
|
|
30272
|
+
if (context === types14.j_oTag || context === types14.j_cTag) {
|
|
30273
30273
|
if (isIdentifierStart(code)) {
|
|
30274
30274
|
return this.jsxReadWord();
|
|
30275
30275
|
}
|
|
@@ -30277,7 +30277,7 @@ var require_lib3 = __commonJS({
|
|
|
30277
30277
|
++this.state.pos;
|
|
30278
30278
|
return this.finishToken(141);
|
|
30279
30279
|
}
|
|
30280
|
-
if ((code === 34 || code === 39) && context ===
|
|
30280
|
+
if ((code === 34 || code === 39) && context === types14.j_oTag) {
|
|
30281
30281
|
return this.jsxReadString(code);
|
|
30282
30282
|
}
|
|
30283
30283
|
}
|
|
@@ -30293,17 +30293,17 @@ var require_lib3 = __commonJS({
|
|
|
30293
30293
|
type
|
|
30294
30294
|
} = this.state;
|
|
30295
30295
|
if (type === 56 && prevType === 140) {
|
|
30296
|
-
context.splice(-2, 2,
|
|
30296
|
+
context.splice(-2, 2, types14.j_cTag);
|
|
30297
30297
|
this.state.canStartJSXElement = false;
|
|
30298
30298
|
} else if (type === 140) {
|
|
30299
|
-
context.push(
|
|
30299
|
+
context.push(types14.j_oTag);
|
|
30300
30300
|
} else if (type === 141) {
|
|
30301
30301
|
const out = context[context.length - 1];
|
|
30302
|
-
if (out ===
|
|
30302
|
+
if (out === types14.j_oTag && prevType === 56 || out === types14.j_cTag) {
|
|
30303
30303
|
context.pop();
|
|
30304
|
-
this.state.canStartJSXElement = context[context.length - 1] ===
|
|
30304
|
+
this.state.canStartJSXElement = context[context.length - 1] === types14.j_expr;
|
|
30305
30305
|
} else {
|
|
30306
|
-
this.setContext(
|
|
30306
|
+
this.setContext(types14.j_expr);
|
|
30307
30307
|
this.state.canStartJSXElement = true;
|
|
30308
30308
|
}
|
|
30309
30309
|
} else {
|
|
@@ -31310,14 +31310,14 @@ var require_lib3 = __commonJS({
|
|
|
31310
31310
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
31311
31311
|
const node = this.startNode();
|
|
31312
31312
|
const hasLeadingOperator = this.eat(operator);
|
|
31313
|
-
const
|
|
31313
|
+
const types15 = [];
|
|
31314
31314
|
do {
|
|
31315
|
-
|
|
31315
|
+
types15.push(parseConstituentType());
|
|
31316
31316
|
} while (this.eat(operator));
|
|
31317
|
-
if (
|
|
31318
|
-
return
|
|
31317
|
+
if (types15.length === 1 && !hasLeadingOperator) {
|
|
31318
|
+
return types15[0];
|
|
31319
31319
|
}
|
|
31320
|
-
node.types =
|
|
31320
|
+
node.types = types15;
|
|
31321
31321
|
return this.finishNode(node, kind);
|
|
31322
31322
|
}
|
|
31323
31323
|
tsParseIntersectionTypeOrHigher() {
|
|
@@ -32533,7 +32533,7 @@ var require_lib3 = __commonJS({
|
|
|
32533
32533
|
context
|
|
32534
32534
|
} = this.state;
|
|
32535
32535
|
const currentContext = context[context.length - 1];
|
|
32536
|
-
if (currentContext ===
|
|
32536
|
+
if (currentContext === types14.j_oTag || currentContext === types14.j_expr) {
|
|
32537
32537
|
context.pop();
|
|
32538
32538
|
}
|
|
32539
32539
|
}
|
|
@@ -38105,9 +38105,9 @@ var require_shared = __commonJS({
|
|
|
38105
38105
|
var tslib_1 = require_tslib();
|
|
38106
38106
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
38107
38107
|
function default_1(fork) {
|
|
38108
|
-
var
|
|
38109
|
-
var Type =
|
|
38110
|
-
var builtin =
|
|
38108
|
+
var types14 = fork.use(types_1.default);
|
|
38109
|
+
var Type = types14.Type;
|
|
38110
|
+
var builtin = types14.builtInTypes;
|
|
38111
38111
|
var isNumber = builtin.number;
|
|
38112
38112
|
function geq(than) {
|
|
38113
38113
|
return Type.from(function(value) {
|
|
@@ -38257,9 +38257,9 @@ var require_types = __commonJS({
|
|
|
38257
38257
|
}(BaseType);
|
|
38258
38258
|
var OrType = function(_super) {
|
|
38259
38259
|
tslib_1.__extends(OrType2, _super);
|
|
38260
|
-
function OrType2(
|
|
38260
|
+
function OrType2(types14) {
|
|
38261
38261
|
var _this = _super.call(this) || this;
|
|
38262
|
-
_this.types =
|
|
38262
|
+
_this.types = types14;
|
|
38263
38263
|
_this.kind = "OrType";
|
|
38264
38264
|
return _this;
|
|
38265
38265
|
}
|
|
@@ -38400,11 +38400,11 @@ var require_types = __commonJS({
|
|
|
38400
38400
|
function typesPlugin(_fork) {
|
|
38401
38401
|
var Type = {
|
|
38402
38402
|
or: function() {
|
|
38403
|
-
var
|
|
38403
|
+
var types14 = [];
|
|
38404
38404
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
38405
|
-
|
|
38405
|
+
types14[_i] = arguments[_i];
|
|
38406
38406
|
}
|
|
38407
|
-
return new OrType(
|
|
38407
|
+
return new OrType(types14.map(function(type) {
|
|
38408
38408
|
return Type.from(type);
|
|
38409
38409
|
}));
|
|
38410
38410
|
},
|
|
@@ -38849,9 +38849,9 @@ var require_path2 = __commonJS({
|
|
|
38849
38849
|
var Op = Object.prototype;
|
|
38850
38850
|
var hasOwn = Op.hasOwnProperty;
|
|
38851
38851
|
function pathPlugin(fork) {
|
|
38852
|
-
var
|
|
38853
|
-
var isArray =
|
|
38854
|
-
var isNumber =
|
|
38852
|
+
var types14 = fork.use(types_1.default);
|
|
38853
|
+
var isArray = types14.builtInTypes.array;
|
|
38854
|
+
var isNumber = types14.builtInTypes.number;
|
|
38855
38855
|
var Path = function Path2(value, parentPath, name2) {
|
|
38856
38856
|
if (!(this instanceof Path2)) {
|
|
38857
38857
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
@@ -39153,13 +39153,13 @@ var require_scope = __commonJS({
|
|
|
39153
39153
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
39154
39154
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
39155
39155
|
function scopePlugin(fork) {
|
|
39156
|
-
var
|
|
39157
|
-
var Type =
|
|
39158
|
-
var namedTypes =
|
|
39156
|
+
var types14 = fork.use(types_1.default);
|
|
39157
|
+
var Type = types14.Type;
|
|
39158
|
+
var namedTypes = types14.namedTypes;
|
|
39159
39159
|
var Node = namedTypes.Node;
|
|
39160
39160
|
var Expression = namedTypes.Expression;
|
|
39161
|
-
var isArray =
|
|
39162
|
-
var b =
|
|
39161
|
+
var isArray = types14.builtInTypes.array;
|
|
39162
|
+
var b = types14.builders;
|
|
39163
39163
|
var Scope = function Scope2(path2, parentScope) {
|
|
39164
39164
|
if (!(this instanceof Scope2)) {
|
|
39165
39165
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
@@ -39222,7 +39222,7 @@ var require_scope = __commonJS({
|
|
|
39222
39222
|
++index;
|
|
39223
39223
|
}
|
|
39224
39224
|
var name2 = prefix + index;
|
|
39225
|
-
return this.bindings[name2] =
|
|
39225
|
+
return this.bindings[name2] = types14.builders.identifier(name2);
|
|
39226
39226
|
};
|
|
39227
39227
|
Sp.injectTemporary = function(identifier, init) {
|
|
39228
39228
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -39298,7 +39298,7 @@ var require_scope = __commonJS({
|
|
|
39298
39298
|
bindings
|
|
39299
39299
|
);
|
|
39300
39300
|
} else if (Node.check(node) && !Expression.check(node)) {
|
|
39301
|
-
|
|
39301
|
+
types14.eachField(node, function(name2, child) {
|
|
39302
39302
|
var childPath = path2.get(name2);
|
|
39303
39303
|
if (!pathHasValue(childPath, child)) {
|
|
39304
39304
|
throw new Error("");
|
|
@@ -39376,24 +39376,24 @@ var require_scope = __commonJS({
|
|
|
39376
39376
|
addPattern(patternPath.get("argument"), bindings);
|
|
39377
39377
|
}
|
|
39378
39378
|
}
|
|
39379
|
-
function addTypePattern(patternPath,
|
|
39379
|
+
function addTypePattern(patternPath, types15) {
|
|
39380
39380
|
var pattern = patternPath.value;
|
|
39381
39381
|
namedTypes.Pattern.assert(pattern);
|
|
39382
39382
|
if (namedTypes.Identifier.check(pattern)) {
|
|
39383
|
-
if (hasOwn.call(
|
|
39384
|
-
|
|
39383
|
+
if (hasOwn.call(types15, pattern.name)) {
|
|
39384
|
+
types15[pattern.name].push(patternPath);
|
|
39385
39385
|
} else {
|
|
39386
|
-
|
|
39386
|
+
types15[pattern.name] = [patternPath];
|
|
39387
39387
|
}
|
|
39388
39388
|
}
|
|
39389
39389
|
}
|
|
39390
|
-
function addTypeParameter(parameterPath,
|
|
39390
|
+
function addTypeParameter(parameterPath, types15) {
|
|
39391
39391
|
var parameter = parameterPath.value;
|
|
39392
39392
|
FlowOrTSTypeParameterType.assert(parameter);
|
|
39393
|
-
if (hasOwn.call(
|
|
39394
|
-
|
|
39393
|
+
if (hasOwn.call(types15, parameter.name)) {
|
|
39394
|
+
types15[parameter.name].push(parameterPath);
|
|
39395
39395
|
} else {
|
|
39396
|
-
|
|
39396
|
+
types15[parameter.name] = [parameterPath];
|
|
39397
39397
|
}
|
|
39398
39398
|
}
|
|
39399
39399
|
Sp.lookup = function(name2) {
|
|
@@ -39434,11 +39434,11 @@ var require_node_path = __commonJS({
|
|
|
39434
39434
|
var scope_1 = tslib_1.__importDefault(require_scope());
|
|
39435
39435
|
var shared_1 = require_shared();
|
|
39436
39436
|
function nodePathPlugin(fork) {
|
|
39437
|
-
var
|
|
39438
|
-
var n =
|
|
39439
|
-
var b =
|
|
39440
|
-
var isNumber =
|
|
39441
|
-
var isArray =
|
|
39437
|
+
var types14 = fork.use(types_1.default);
|
|
39438
|
+
var n = types14.namedTypes;
|
|
39439
|
+
var b = types14.builders;
|
|
39440
|
+
var isNumber = types14.builtInTypes.number;
|
|
39441
|
+
var isArray = types14.builtInTypes.array;
|
|
39442
39442
|
var Path = fork.use(path_1.default);
|
|
39443
39443
|
var Scope = fork.use(scope_1.default);
|
|
39444
39444
|
var NodePath = function NodePath2(value, parentPath, name2) {
|
|
@@ -39529,7 +39529,7 @@ var require_node_path = __commonJS({
|
|
|
39529
39529
|
return scope || null;
|
|
39530
39530
|
};
|
|
39531
39531
|
NPp.getValueProperty = function(name2) {
|
|
39532
|
-
return
|
|
39532
|
+
return types14.getFieldValue(this.value, name2);
|
|
39533
39533
|
};
|
|
39534
39534
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
39535
39535
|
var pp = this.parentPath;
|
|
@@ -39671,7 +39671,7 @@ var require_node_path = __commonJS({
|
|
|
39671
39671
|
return node.some(containsCallExpression);
|
|
39672
39672
|
}
|
|
39673
39673
|
if (n.Node.check(node)) {
|
|
39674
|
-
return
|
|
39674
|
+
return types14.someField(node, function(_name, child) {
|
|
39675
39675
|
return containsCallExpression(child);
|
|
39676
39676
|
});
|
|
39677
39677
|
}
|
|
@@ -39792,11 +39792,11 @@ var require_path_visitor = __commonJS({
|
|
|
39792
39792
|
var shared_1 = require_shared();
|
|
39793
39793
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
39794
39794
|
function pathVisitorPlugin(fork) {
|
|
39795
|
-
var
|
|
39795
|
+
var types14 = fork.use(types_1.default);
|
|
39796
39796
|
var NodePath = fork.use(node_path_1.default);
|
|
39797
|
-
var isArray =
|
|
39798
|
-
var isObject =
|
|
39799
|
-
var isFunction =
|
|
39797
|
+
var isArray = types14.builtInTypes.array;
|
|
39798
|
+
var isObject = types14.builtInTypes.object;
|
|
39799
|
+
var isFunction = types14.builtInTypes.function;
|
|
39800
39800
|
var undefined2;
|
|
39801
39801
|
var PathVisitor = function PathVisitor2() {
|
|
39802
39802
|
if (!(this instanceof PathVisitor2)) {
|
|
@@ -39816,7 +39816,7 @@ var require_path_visitor = __commonJS({
|
|
|
39816
39816
|
typeNames[methodName.slice("visit".length)] = true;
|
|
39817
39817
|
}
|
|
39818
39818
|
}
|
|
39819
|
-
var supertypeTable =
|
|
39819
|
+
var supertypeTable = types14.computeSupertypeLookupTable(typeNames);
|
|
39820
39820
|
var methodNameTable = /* @__PURE__ */ Object.create(null);
|
|
39821
39821
|
var typeNameKeys = Object.keys(supertypeTable);
|
|
39822
39822
|
var typeNameCount = typeNameKeys.length;
|
|
@@ -39858,7 +39858,7 @@ var require_path_visitor = __commonJS({
|
|
|
39858
39858
|
}
|
|
39859
39859
|
return target;
|
|
39860
39860
|
}
|
|
39861
|
-
PathVisitor.visit = function
|
|
39861
|
+
PathVisitor.visit = function visit12(node, methods) {
|
|
39862
39862
|
return PathVisitor.fromMethodsObject(methods).visit(node);
|
|
39863
39863
|
};
|
|
39864
39864
|
var PVp = PathVisitor.prototype;
|
|
@@ -39935,7 +39935,7 @@ var require_path_visitor = __commonJS({
|
|
|
39935
39935
|
path2.each(visitor.visitWithoutReset, visitor);
|
|
39936
39936
|
} else if (!isObject.check(value)) {
|
|
39937
39937
|
} else {
|
|
39938
|
-
var childNames =
|
|
39938
|
+
var childNames = types14.getFieldNames(value);
|
|
39939
39939
|
if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
|
|
39940
39940
|
childNames.push("comments");
|
|
39941
39941
|
}
|
|
@@ -39944,7 +39944,7 @@ var require_path_visitor = __commonJS({
|
|
|
39944
39944
|
for (var i = 0; i < childCount; ++i) {
|
|
39945
39945
|
var childName = childNames[i];
|
|
39946
39946
|
if (!hasOwn.call(value, childName)) {
|
|
39947
|
-
value[childName] =
|
|
39947
|
+
value[childName] = types14.getFieldValue(value, childName);
|
|
39948
39948
|
}
|
|
39949
39949
|
childPaths.push(path2.get(childName));
|
|
39950
39950
|
}
|
|
@@ -40049,7 +40049,7 @@ var require_path_visitor = __commonJS({
|
|
|
40049
40049
|
this.needToCallTraverse = false;
|
|
40050
40050
|
return visitChildren(path2, PathVisitor.fromMethodsObject(newVisitor || this.visitor));
|
|
40051
40051
|
};
|
|
40052
|
-
sharedContextProtoMethods.visit = function
|
|
40052
|
+
sharedContextProtoMethods.visit = function visit12(path2, newVisitor) {
|
|
40053
40053
|
if (!(this instanceof this.Context)) {
|
|
40054
40054
|
throw new Error("");
|
|
40055
40055
|
}
|
|
@@ -40087,13 +40087,13 @@ var require_equiv = __commonJS({
|
|
|
40087
40087
|
var shared_1 = require_shared();
|
|
40088
40088
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
40089
40089
|
function default_1(fork) {
|
|
40090
|
-
var
|
|
40091
|
-
var getFieldNames =
|
|
40092
|
-
var getFieldValue =
|
|
40093
|
-
var isArray =
|
|
40094
|
-
var isObject =
|
|
40095
|
-
var isDate =
|
|
40096
|
-
var isRegExp =
|
|
40090
|
+
var types14 = fork.use(types_1.default);
|
|
40091
|
+
var getFieldNames = types14.getFieldNames;
|
|
40092
|
+
var getFieldValue = types14.getFieldValue;
|
|
40093
|
+
var isArray = types14.builtInTypes.array;
|
|
40094
|
+
var isObject = types14.builtInTypes.object;
|
|
40095
|
+
var isDate = types14.builtInTypes.Date;
|
|
40096
|
+
var isRegExp = types14.builtInTypes.RegExp;
|
|
40097
40097
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
40098
40098
|
function astNodesAreEquivalent(a, b, problemPath) {
|
|
40099
40099
|
if (isArray.check(problemPath)) {
|
|
@@ -40246,24 +40246,24 @@ var require_fork = __commonJS({
|
|
|
40246
40246
|
var shared_1 = require_shared();
|
|
40247
40247
|
function default_1(plugins) {
|
|
40248
40248
|
var fork = createFork();
|
|
40249
|
-
var
|
|
40249
|
+
var types14 = fork.use(types_1.default);
|
|
40250
40250
|
plugins.forEach(fork.use);
|
|
40251
|
-
|
|
40251
|
+
types14.finalize();
|
|
40252
40252
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
40253
40253
|
return {
|
|
40254
|
-
Type:
|
|
40255
|
-
builtInTypes:
|
|
40256
|
-
namedTypes:
|
|
40257
|
-
builders:
|
|
40258
|
-
defineMethod:
|
|
40259
|
-
getFieldNames:
|
|
40260
|
-
getFieldValue:
|
|
40261
|
-
eachField:
|
|
40262
|
-
someField:
|
|
40263
|
-
getSupertypeNames:
|
|
40264
|
-
getBuilderName:
|
|
40254
|
+
Type: types14.Type,
|
|
40255
|
+
builtInTypes: types14.builtInTypes,
|
|
40256
|
+
namedTypes: types14.namedTypes,
|
|
40257
|
+
builders: types14.builders,
|
|
40258
|
+
defineMethod: types14.defineMethod,
|
|
40259
|
+
getFieldNames: types14.getFieldNames,
|
|
40260
|
+
getFieldValue: types14.getFieldValue,
|
|
40261
|
+
eachField: types14.eachField,
|
|
40262
|
+
someField: types14.someField,
|
|
40263
|
+
getSupertypeNames: types14.getSupertypeNames,
|
|
40264
|
+
getBuilderName: types14.getBuilderName,
|
|
40265
40265
|
astNodesAreEquivalent: fork.use(equiv_1.default),
|
|
40266
|
-
finalize:
|
|
40266
|
+
finalize: types14.finalize,
|
|
40267
40267
|
Path: fork.use(path_1.default),
|
|
40268
40268
|
NodePath: fork.use(node_path_1.default),
|
|
40269
40269
|
PathVisitor,
|
|
@@ -40433,8 +40433,8 @@ var require_core2 = __commonJS({
|
|
|
40433
40433
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
40434
40434
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40435
40435
|
function default_1(fork) {
|
|
40436
|
-
var
|
|
40437
|
-
var Type =
|
|
40436
|
+
var types14 = fork.use(types_1.default);
|
|
40437
|
+
var Type = types14.Type;
|
|
40438
40438
|
var def = Type.def;
|
|
40439
40439
|
var or = Type.or;
|
|
40440
40440
|
var shared = fork.use(shared_1.default);
|
|
@@ -40526,9 +40526,9 @@ var require_es6 = __commonJS({
|
|
|
40526
40526
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40527
40527
|
function default_1(fork) {
|
|
40528
40528
|
fork.use(core_1.default);
|
|
40529
|
-
var
|
|
40530
|
-
var def =
|
|
40531
|
-
var or =
|
|
40529
|
+
var types14 = fork.use(types_1.default);
|
|
40530
|
+
var def = types14.Type.def;
|
|
40531
|
+
var or = types14.Type.or;
|
|
40532
40532
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40533
40533
|
def("Function").field("generator", Boolean, defaults["false"]).field("expression", Boolean, defaults["false"]).field("defaults", [or(def("Expression"), null)], defaults.emptyArray).field("rest", or(def("Identifier"), null), defaults["null"]);
|
|
40534
40534
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
@@ -40618,8 +40618,8 @@ var require_es2017 = __commonJS({
|
|
|
40618
40618
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40619
40619
|
function default_1(fork) {
|
|
40620
40620
|
fork.use(es2016_1.default);
|
|
40621
|
-
var
|
|
40622
|
-
var def =
|
|
40621
|
+
var types14 = fork.use(types_1.default);
|
|
40622
|
+
var def = types14.Type.def;
|
|
40623
40623
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40624
40624
|
def("Function").field("async", Boolean, defaults["false"]);
|
|
40625
40625
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
@@ -40642,9 +40642,9 @@ var require_es2018 = __commonJS({
|
|
|
40642
40642
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40643
40643
|
function default_1(fork) {
|
|
40644
40644
|
fork.use(es2017_1.default);
|
|
40645
|
-
var
|
|
40646
|
-
var def =
|
|
40647
|
-
var or =
|
|
40645
|
+
var types14 = fork.use(types_1.default);
|
|
40646
|
+
var def = types14.Type.def;
|
|
40647
|
+
var or = types14.Type.or;
|
|
40648
40648
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40649
40649
|
def("ForOfStatement").field("await", Boolean, defaults["false"]);
|
|
40650
40650
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -40675,9 +40675,9 @@ var require_es2019 = __commonJS({
|
|
|
40675
40675
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40676
40676
|
function default_1(fork) {
|
|
40677
40677
|
fork.use(es2018_1.default);
|
|
40678
|
-
var
|
|
40679
|
-
var def =
|
|
40680
|
-
var or =
|
|
40678
|
+
var types14 = fork.use(types_1.default);
|
|
40679
|
+
var def = types14.Type.def;
|
|
40680
|
+
var or = types14.Type.or;
|
|
40681
40681
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40682
40682
|
def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]);
|
|
40683
40683
|
}
|
|
@@ -40701,9 +40701,9 @@ var require_es20202 = __commonJS({
|
|
|
40701
40701
|
function default_1(fork) {
|
|
40702
40702
|
fork.use(es2020_1.default);
|
|
40703
40703
|
fork.use(es2019_1.default);
|
|
40704
|
-
var
|
|
40705
|
-
var def =
|
|
40706
|
-
var or =
|
|
40704
|
+
var types14 = fork.use(types_1.default);
|
|
40705
|
+
var def = types14.Type.def;
|
|
40706
|
+
var or = types14.Type.or;
|
|
40707
40707
|
var shared = fork.use(shared_1.default);
|
|
40708
40708
|
var defaults = shared.defaults;
|
|
40709
40709
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
@@ -40753,8 +40753,8 @@ var require_es2022 = __commonJS({
|
|
|
40753
40753
|
var shared_1 = require_shared();
|
|
40754
40754
|
function default_1(fork) {
|
|
40755
40755
|
fork.use(es2021_1.default);
|
|
40756
|
-
var
|
|
40757
|
-
var def =
|
|
40756
|
+
var types14 = fork.use(types_1.default);
|
|
40757
|
+
var def = types14.Type.def;
|
|
40758
40758
|
def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
|
|
40759
40759
|
}
|
|
40760
40760
|
exports.default = default_1;
|
|
@@ -40775,9 +40775,9 @@ var require_es_proposals = __commonJS({
|
|
|
40775
40775
|
var es2022_1 = tslib_1.__importDefault(require_es2022());
|
|
40776
40776
|
function default_1(fork) {
|
|
40777
40777
|
fork.use(es2022_1.default);
|
|
40778
|
-
var
|
|
40779
|
-
var Type =
|
|
40780
|
-
var def =
|
|
40778
|
+
var types14 = fork.use(types_1.default);
|
|
40779
|
+
var Type = types14.Type;
|
|
40780
|
+
var def = types14.Type.def;
|
|
40781
40781
|
var or = Type.or;
|
|
40782
40782
|
var shared = fork.use(shared_1.default);
|
|
40783
40783
|
var defaults = shared.defaults;
|
|
@@ -40817,9 +40817,9 @@ var require_jsx = __commonJS({
|
|
|
40817
40817
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40818
40818
|
function default_1(fork) {
|
|
40819
40819
|
fork.use(es_proposals_1.default);
|
|
40820
|
-
var
|
|
40821
|
-
var def =
|
|
40822
|
-
var or =
|
|
40820
|
+
var types14 = fork.use(types_1.default);
|
|
40821
|
+
var def = types14.Type.def;
|
|
40822
|
+
var or = types14.Type.or;
|
|
40823
40823
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40824
40824
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
40825
40825
|
def("Literal"),
|
|
@@ -40877,9 +40877,9 @@ var require_type_annotations = __commonJS({
|
|
|
40877
40877
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
40878
40878
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40879
40879
|
function default_1(fork) {
|
|
40880
|
-
var
|
|
40881
|
-
var def =
|
|
40882
|
-
var or =
|
|
40880
|
+
var types14 = fork.use(types_1.default);
|
|
40881
|
+
var def = types14.Type.def;
|
|
40882
|
+
var or = types14.Type.or;
|
|
40883
40883
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40884
40884
|
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
|
|
40885
40885
|
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
|
|
@@ -40914,9 +40914,9 @@ var require_flow = __commonJS({
|
|
|
40914
40914
|
function default_1(fork) {
|
|
40915
40915
|
fork.use(es_proposals_1.default);
|
|
40916
40916
|
fork.use(type_annotations_1.default);
|
|
40917
|
-
var
|
|
40918
|
-
var def =
|
|
40919
|
-
var or =
|
|
40917
|
+
var types14 = fork.use(types_1.default);
|
|
40918
|
+
var def = types14.Type.def;
|
|
40919
|
+
var or = types14.Type.or;
|
|
40920
40920
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40921
40921
|
def("Flow").bases("Node");
|
|
40922
40922
|
def("FlowType").bases("Flow");
|
|
@@ -41030,10 +41030,10 @@ var require_esprima = __commonJS({
|
|
|
41030
41030
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
41031
41031
|
function default_1(fork) {
|
|
41032
41032
|
fork.use(es_proposals_1.default);
|
|
41033
|
-
var
|
|
41033
|
+
var types14 = fork.use(types_1.default);
|
|
41034
41034
|
var defaults = fork.use(shared_1.default).defaults;
|
|
41035
|
-
var def =
|
|
41036
|
-
var or =
|
|
41035
|
+
var def = types14.Type.def;
|
|
41036
|
+
var or = types14.Type.or;
|
|
41037
41037
|
def("VariableDeclaration").field("declarations", [or(
|
|
41038
41038
|
def("VariableDeclarator"),
|
|
41039
41039
|
def("Identifier")
|
|
@@ -41078,11 +41078,11 @@ var require_babel_core = __commonJS({
|
|
|
41078
41078
|
function default_1(fork) {
|
|
41079
41079
|
var _a, _b, _c, _d, _e;
|
|
41080
41080
|
fork.use(es_proposals_1.default);
|
|
41081
|
-
var
|
|
41081
|
+
var types14 = fork.use(types_1.default);
|
|
41082
41082
|
var defaults = fork.use(shared_1.default).defaults;
|
|
41083
|
-
var def =
|
|
41084
|
-
var or =
|
|
41085
|
-
var isUndefined =
|
|
41083
|
+
var def = types14.Type.def;
|
|
41084
|
+
var or = types14.Type.or;
|
|
41085
|
+
var isUndefined = types14.builtInTypes.undefined;
|
|
41086
41086
|
def("Noop").bases("Statement").build();
|
|
41087
41087
|
def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
|
|
41088
41088
|
def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
|
|
@@ -41107,7 +41107,7 @@ var require_babel_core = __commonJS({
|
|
|
41107
41107
|
raw: String
|
|
41108
41108
|
},
|
|
41109
41109
|
function getDefault() {
|
|
41110
|
-
var value =
|
|
41110
|
+
var value = types14.getFieldValue(this, "value");
|
|
41111
41111
|
return {
|
|
41112
41112
|
rawValue: value,
|
|
41113
41113
|
raw: toRaw ? toRaw(value) : String(value)
|
|
@@ -41210,8 +41210,8 @@ var require_babel = __commonJS({
|
|
|
41210
41210
|
var flow_1 = tslib_1.__importDefault(require_flow());
|
|
41211
41211
|
var shared_1 = require_shared();
|
|
41212
41212
|
function default_1(fork) {
|
|
41213
|
-
var
|
|
41214
|
-
var def =
|
|
41213
|
+
var types14 = fork.use(types_1.default);
|
|
41214
|
+
var def = types14.Type.def;
|
|
41215
41215
|
fork.use(babel_core_1.default);
|
|
41216
41216
|
fork.use(flow_1.default);
|
|
41217
41217
|
def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
|
|
@@ -41237,12 +41237,12 @@ var require_typescript = __commonJS({
|
|
|
41237
41237
|
function default_1(fork) {
|
|
41238
41238
|
fork.use(babel_core_1.default);
|
|
41239
41239
|
fork.use(type_annotations_1.default);
|
|
41240
|
-
var
|
|
41241
|
-
var n =
|
|
41242
|
-
var def =
|
|
41243
|
-
var or =
|
|
41240
|
+
var types14 = fork.use(types_1.default);
|
|
41241
|
+
var n = types14.namedTypes;
|
|
41242
|
+
var def = types14.Type.def;
|
|
41243
|
+
var or = types14.Type.or;
|
|
41244
41244
|
var defaults = fork.use(shared_1.default).defaults;
|
|
41245
|
-
var StringLiteral =
|
|
41245
|
+
var StringLiteral = types14.Type.from(function(value, deep) {
|
|
41246
41246
|
if (n.StringLiteral && n.StringLiteral.check(value, deep)) {
|
|
41247
41247
|
return true;
|
|
41248
41248
|
}
|
|
@@ -41442,7 +41442,7 @@ var require_main = __commonJS({
|
|
|
41442
41442
|
var someField = _a.someField;
|
|
41443
41443
|
var Type = _a.Type;
|
|
41444
41444
|
var use = _a.use;
|
|
41445
|
-
var
|
|
41445
|
+
var visit12 = _a.visit;
|
|
41446
41446
|
exports.astNodesAreEquivalent = astNodesAreEquivalent;
|
|
41447
41447
|
exports.builders = builders;
|
|
41448
41448
|
exports.builtInTypes = builtInTypes;
|
|
@@ -41459,7 +41459,7 @@ var require_main = __commonJS({
|
|
|
41459
41459
|
exports.someField = someField;
|
|
41460
41460
|
exports.Type = Type;
|
|
41461
41461
|
exports.use = use;
|
|
41462
|
-
exports.visit =
|
|
41462
|
+
exports.visit = visit12;
|
|
41463
41463
|
Object.assign(namedTypes_1.namedTypes, n);
|
|
41464
41464
|
}
|
|
41465
41465
|
});
|
|
@@ -43218,8 +43218,8 @@ var require_util2 = __commonJS({
|
|
|
43218
43218
|
exports.isTrailingCommaEnabled = exports.getParentExportDeclaration = exports.isExportDeclaration = exports.fixFaultyLocations = exports.getTrueLoc = exports.composeSourceMaps = exports.copyPos = exports.comparePos = exports.getUnionOfKeys = exports.getOption = exports.isBrowser = exports.getLineTerminator = void 0;
|
|
43219
43219
|
var tslib_1 = require_tslib();
|
|
43220
43220
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
43221
|
-
var
|
|
43222
|
-
var n =
|
|
43221
|
+
var types14 = tslib_1.__importStar(require_main());
|
|
43222
|
+
var n = types14.namedTypes;
|
|
43223
43223
|
var source_map_1 = tslib_1.__importDefault(require_source_map());
|
|
43224
43224
|
var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
|
|
43225
43225
|
var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
|
|
@@ -50537,10 +50537,10 @@ var require_comments = __commonJS({
|
|
|
50537
50537
|
exports.printComments = exports.attach = void 0;
|
|
50538
50538
|
var tslib_1 = require_tslib();
|
|
50539
50539
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
50540
|
-
var
|
|
50541
|
-
var n =
|
|
50542
|
-
var isArray =
|
|
50543
|
-
var isObject =
|
|
50540
|
+
var types14 = tslib_1.__importStar(require_main());
|
|
50541
|
+
var n = types14.namedTypes;
|
|
50542
|
+
var isArray = types14.builtInTypes.array;
|
|
50543
|
+
var isObject = types14.builtInTypes.object;
|
|
50544
50544
|
var lines_1 = require_lines();
|
|
50545
50545
|
var util_1 = require_util2();
|
|
50546
50546
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -50571,7 +50571,7 @@ var require_comments = __commonJS({
|
|
|
50571
50571
|
if (isArray.check(node)) {
|
|
50572
50572
|
names = Object.keys(node);
|
|
50573
50573
|
} else if (isObject.check(node)) {
|
|
50574
|
-
names =
|
|
50574
|
+
names = types14.getFieldNames(node);
|
|
50575
50575
|
} else {
|
|
50576
50576
|
return resultArray;
|
|
50577
50577
|
}
|
|
@@ -50749,7 +50749,7 @@ var require_comments = __commonJS({
|
|
|
50749
50749
|
function printComments(path2, print9) {
|
|
50750
50750
|
var value = path2.getValue();
|
|
50751
50751
|
var innerLines = print9(path2);
|
|
50752
|
-
var comments = n.Node.check(value) &&
|
|
50752
|
+
var comments = n.Node.check(value) && types14.getFieldValue(value, "comments");
|
|
50753
50753
|
if (!comments || comments.length === 0) {
|
|
50754
50754
|
return innerLines;
|
|
50755
50755
|
}
|
|
@@ -50757,8 +50757,8 @@ var require_comments = __commonJS({
|
|
|
50757
50757
|
var trailingParts = [innerLines];
|
|
50758
50758
|
path2.each(function(commentPath) {
|
|
50759
50759
|
var comment = commentPath.getValue();
|
|
50760
|
-
var leading =
|
|
50761
|
-
var trailing =
|
|
50760
|
+
var leading = types14.getFieldValue(comment, "leading");
|
|
50761
|
+
var trailing = types14.getFieldValue(comment, "trailing");
|
|
50762
50762
|
if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
50763
50763
|
leadingParts.push(printLeadingComment(commentPath, print9));
|
|
50764
50764
|
} else if (trailing) {
|
|
@@ -50780,10 +50780,10 @@ var require_parser2 = __commonJS({
|
|
|
50780
50780
|
exports.parse = void 0;
|
|
50781
50781
|
var tslib_1 = require_tslib();
|
|
50782
50782
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
50783
|
-
var
|
|
50784
|
-
var b =
|
|
50785
|
-
var isObject =
|
|
50786
|
-
var isArray =
|
|
50783
|
+
var types14 = tslib_1.__importStar(require_main());
|
|
50784
|
+
var b = types14.builders;
|
|
50785
|
+
var isObject = types14.builtInTypes.object;
|
|
50786
|
+
var isArray = types14.builtInTypes.array;
|
|
50787
50787
|
var options_1 = require_options();
|
|
50788
50788
|
var lines_1 = require_lines();
|
|
50789
50789
|
var comments_1 = require_comments();
|
|
@@ -50969,11 +50969,11 @@ var require_fast_path = __commonJS({
|
|
|
50969
50969
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50970
50970
|
var tslib_1 = require_tslib();
|
|
50971
50971
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
50972
|
-
var
|
|
50972
|
+
var types14 = tslib_1.__importStar(require_main());
|
|
50973
50973
|
var util = tslib_1.__importStar(require_util2());
|
|
50974
|
-
var n =
|
|
50975
|
-
var isArray =
|
|
50976
|
-
var isNumber =
|
|
50974
|
+
var n = types14.namedTypes;
|
|
50975
|
+
var isArray = types14.builtInTypes.array;
|
|
50976
|
+
var isNumber = types14.builtInTypes.number;
|
|
50977
50977
|
var PRECEDENCE = {};
|
|
50978
50978
|
[
|
|
50979
50979
|
["??"],
|
|
@@ -51002,7 +51002,7 @@ var require_fast_path = __commonJS({
|
|
|
51002
51002
|
if (obj instanceof FastPath) {
|
|
51003
51003
|
return obj.copy();
|
|
51004
51004
|
}
|
|
51005
|
-
if (obj instanceof
|
|
51005
|
+
if (obj instanceof types14.NodePath) {
|
|
51006
51006
|
var copy = Object.create(FastPath.prototype);
|
|
51007
51007
|
var stack = [obj.value];
|
|
51008
51008
|
for (var pp = void 0; pp = obj.parentPath; obj = pp)
|
|
@@ -51313,7 +51313,7 @@ var require_fast_path = __commonJS({
|
|
|
51313
51313
|
return node.some(containsCallExpression);
|
|
51314
51314
|
}
|
|
51315
51315
|
if (n.Node.check(node)) {
|
|
51316
|
-
return
|
|
51316
|
+
return types14.someField(node, function(_name, child) {
|
|
51317
51317
|
return containsCallExpression(child);
|
|
51318
51318
|
});
|
|
51319
51319
|
}
|
|
@@ -51403,16 +51403,16 @@ var require_patcher = __commonJS({
|
|
|
51403
51403
|
var tslib_1 = require_tslib();
|
|
51404
51404
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
51405
51405
|
var linesModule = tslib_1.__importStar(require_lines());
|
|
51406
|
-
var
|
|
51407
|
-
var Printable =
|
|
51408
|
-
var Expression =
|
|
51409
|
-
var ReturnStatement =
|
|
51410
|
-
var SourceLocation =
|
|
51406
|
+
var types14 = tslib_1.__importStar(require_main());
|
|
51407
|
+
var Printable = types14.namedTypes.Printable;
|
|
51408
|
+
var Expression = types14.namedTypes.Expression;
|
|
51409
|
+
var ReturnStatement = types14.namedTypes.ReturnStatement;
|
|
51410
|
+
var SourceLocation = types14.namedTypes.SourceLocation;
|
|
51411
51411
|
var util_1 = require_util2();
|
|
51412
51412
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
51413
|
-
var isObject =
|
|
51414
|
-
var isArray =
|
|
51415
|
-
var isString =
|
|
51413
|
+
var isObject = types14.builtInTypes.object;
|
|
51414
|
+
var isArray = types14.builtInTypes.array;
|
|
51415
|
+
var isString = types14.builtInTypes.string;
|
|
51416
51416
|
var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
|
|
51417
51417
|
var Patcher = function Patcher2(lines) {
|
|
51418
51418
|
assert_1.default.ok(this instanceof Patcher2);
|
|
@@ -51682,8 +51682,8 @@ var require_patcher = __commonJS({
|
|
|
51682
51682
|
if (k.charAt(0) === "_") {
|
|
51683
51683
|
continue;
|
|
51684
51684
|
}
|
|
51685
|
-
newPath.stack.push(k,
|
|
51686
|
-
oldPath.stack.push(k,
|
|
51685
|
+
newPath.stack.push(k, types14.getFieldValue(newNode, k));
|
|
51686
|
+
oldPath.stack.push(k, types14.getFieldValue(oldNode, k));
|
|
51687
51687
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
51688
51688
|
newPath.stack.length -= 2;
|
|
51689
51689
|
oldPath.stack.length -= 2;
|
|
@@ -51707,16 +51707,16 @@ var require_printer2 = __commonJS({
|
|
|
51707
51707
|
exports.Printer = void 0;
|
|
51708
51708
|
var tslib_1 = require_tslib();
|
|
51709
51709
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
51710
|
-
var
|
|
51710
|
+
var types14 = tslib_1.__importStar(require_main());
|
|
51711
51711
|
var comments_1 = require_comments();
|
|
51712
51712
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
51713
51713
|
var lines_1 = require_lines();
|
|
51714
51714
|
var options_1 = require_options();
|
|
51715
51715
|
var patcher_1 = require_patcher();
|
|
51716
51716
|
var util = tslib_1.__importStar(require_util2());
|
|
51717
|
-
var namedTypes =
|
|
51718
|
-
var isString =
|
|
51719
|
-
var isObject =
|
|
51717
|
+
var namedTypes = types14.namedTypes;
|
|
51718
|
+
var isString = types14.builtInTypes.string;
|
|
51719
|
+
var isObject = types14.builtInTypes.object;
|
|
51720
51720
|
var PrintResult = function PrintResult2(code, sourceMap) {
|
|
51721
51721
|
assert_1.default.ok(this instanceof PrintResult2);
|
|
51722
51722
|
isString.assert(code);
|
|
@@ -51878,7 +51878,7 @@ var require_printer2 = __commonJS({
|
|
|
51878
51878
|
case "OptionalMemberExpression": {
|
|
51879
51879
|
parts.push(path2.call(print9, "object"));
|
|
51880
51880
|
var property = path2.call(print9, "property");
|
|
51881
|
-
var optional =
|
|
51881
|
+
var optional = types14.getFieldValue(n, "optional");
|
|
51882
51882
|
if (n.computed) {
|
|
51883
51883
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
51884
51884
|
} else {
|
|
@@ -52149,7 +52149,7 @@ var require_printer2 = __commonJS({
|
|
|
52149
52149
|
if (n.typeArguments) {
|
|
52150
52150
|
parts.push(path2.call(print9, "typeArguments"));
|
|
52151
52151
|
}
|
|
52152
|
-
if (
|
|
52152
|
+
if (types14.getFieldValue(n, "optional")) {
|
|
52153
52153
|
parts.push("?.");
|
|
52154
52154
|
}
|
|
52155
52155
|
parts.push(printArgumentsList(path2, options, print9));
|
|
@@ -53828,8 +53828,8 @@ var require_printer2 = __commonJS({
|
|
|
53828
53828
|
});
|
|
53829
53829
|
}
|
|
53830
53830
|
function getPossibleRaw(node) {
|
|
53831
|
-
var value =
|
|
53832
|
-
var extra =
|
|
53831
|
+
var value = types14.getFieldValue(node, "value");
|
|
53832
|
+
var extra = types14.getFieldValue(node, "extra");
|
|
53833
53833
|
if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
|
|
53834
53834
|
return extra.raw;
|
|
53835
53835
|
}
|
|
@@ -53877,8 +53877,8 @@ var require_main2 = __commonJS({
|
|
|
53877
53877
|
exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
|
|
53878
53878
|
var tslib_1 = require_tslib();
|
|
53879
53879
|
var fs_1 = tslib_1.__importDefault(__require("fs"));
|
|
53880
|
-
var
|
|
53881
|
-
exports.types =
|
|
53880
|
+
var types14 = tslib_1.__importStar(require_main());
|
|
53881
|
+
exports.types = types14;
|
|
53882
53882
|
var parser_1 = require_parser2();
|
|
53883
53883
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
|
|
53884
53884
|
return parser_1.parse;
|
|
@@ -53892,10 +53892,10 @@ var require_main2 = __commonJS({
|
|
|
53892
53892
|
return new printer_1.Printer(options).print(node);
|
|
53893
53893
|
}
|
|
53894
53894
|
exports.print = print9;
|
|
53895
|
-
function
|
|
53895
|
+
function prettyPrint3(node, options) {
|
|
53896
53896
|
return new printer_1.Printer(options).printGenerically(node);
|
|
53897
53897
|
}
|
|
53898
|
-
exports.prettyPrint =
|
|
53898
|
+
exports.prettyPrint = prettyPrint3;
|
|
53899
53899
|
function run(transformer, options) {
|
|
53900
53900
|
return runFile(process.argv[2], transformer, options);
|
|
53901
53901
|
}
|
|
@@ -53922,7 +53922,7 @@ var require_main2 = __commonJS({
|
|
|
53922
53922
|
});
|
|
53923
53923
|
|
|
53924
53924
|
// src/codegen/index.ts
|
|
53925
|
-
var
|
|
53925
|
+
var graphql27 = __toESM(require_graphql2(), 1);
|
|
53926
53926
|
|
|
53927
53927
|
// src/lib/pipeline.ts
|
|
53928
53928
|
async function runPipeline(config2, pipeline, target) {
|
|
@@ -54402,8 +54402,8 @@ var List = class {
|
|
|
54402
54402
|
} else {
|
|
54403
54403
|
entries = this.cache._internal_unstable.storage.get(value, "edges").value;
|
|
54404
54404
|
}
|
|
54405
|
-
for (let
|
|
54406
|
-
yield
|
|
54405
|
+
for (let record2 of entries) {
|
|
54406
|
+
yield record2;
|
|
54407
54407
|
}
|
|
54408
54408
|
}
|
|
54409
54409
|
};
|
|
@@ -54452,6 +54452,46 @@ var ListCollection = class {
|
|
|
54452
54452
|
}
|
|
54453
54453
|
};
|
|
54454
54454
|
|
|
54455
|
+
// src/runtime/cache/schema.ts
|
|
54456
|
+
var SchemaManager = class {
|
|
54457
|
+
cache;
|
|
54458
|
+
fieldTypes = {};
|
|
54459
|
+
constructor(cache) {
|
|
54460
|
+
this.cache = cache;
|
|
54461
|
+
}
|
|
54462
|
+
setFieldType({
|
|
54463
|
+
parent,
|
|
54464
|
+
key,
|
|
54465
|
+
type,
|
|
54466
|
+
nullable = false,
|
|
54467
|
+
link
|
|
54468
|
+
}) {
|
|
54469
|
+
let parensIndex = key.indexOf("(");
|
|
54470
|
+
if (parensIndex !== -1) {
|
|
54471
|
+
key = key.substring(0, parensIndex);
|
|
54472
|
+
}
|
|
54473
|
+
if (parent === rootID) {
|
|
54474
|
+
parent = "Query";
|
|
54475
|
+
} else if (parent.includes(":")) {
|
|
54476
|
+
parent = parent.substring(0, parent.indexOf(":"));
|
|
54477
|
+
}
|
|
54478
|
+
if (!this.fieldTypes[parent]) {
|
|
54479
|
+
this.fieldTypes[parent] = {};
|
|
54480
|
+
}
|
|
54481
|
+
this.fieldTypes[parent][key] = {
|
|
54482
|
+
type,
|
|
54483
|
+
nullable,
|
|
54484
|
+
link: !!link
|
|
54485
|
+
};
|
|
54486
|
+
}
|
|
54487
|
+
fieldType(type, field) {
|
|
54488
|
+
return this.fieldTypes[type]?.[field] || null;
|
|
54489
|
+
}
|
|
54490
|
+
get config() {
|
|
54491
|
+
return this.cache._internal_unstable.config;
|
|
54492
|
+
}
|
|
54493
|
+
};
|
|
54494
|
+
|
|
54455
54495
|
// src/runtime/cache/storage.ts
|
|
54456
54496
|
var InMemoryStorage = class {
|
|
54457
54497
|
data;
|
|
@@ -55019,7 +55059,7 @@ var InMemorySubscriptions = class {
|
|
|
55019
55059
|
};
|
|
55020
55060
|
|
|
55021
55061
|
// src/runtime/cache/cache.ts
|
|
55022
|
-
var
|
|
55062
|
+
var Cache3 = class {
|
|
55023
55063
|
_internal_unstable;
|
|
55024
55064
|
constructor(config2) {
|
|
55025
55065
|
this._internal_unstable = new CacheInternal({
|
|
@@ -55027,7 +55067,8 @@ var Cache2 = class {
|
|
|
55027
55067
|
storage: new InMemoryStorage(),
|
|
55028
55068
|
subscriptions: new InMemorySubscriptions(this),
|
|
55029
55069
|
lists: new ListManager(this, rootID),
|
|
55030
|
-
lifetimes: new GarbageCollector(this)
|
|
55070
|
+
lifetimes: new GarbageCollector(this),
|
|
55071
|
+
schema: new SchemaManager(this)
|
|
55031
55072
|
});
|
|
55032
55073
|
if (config2) {
|
|
55033
55074
|
this.setConfig(defaultConfigValues(config2));
|
|
@@ -55113,18 +55154,21 @@ var CacheInternal = class {
|
|
|
55113
55154
|
lists;
|
|
55114
55155
|
cache;
|
|
55115
55156
|
lifetimes;
|
|
55157
|
+
schema;
|
|
55116
55158
|
constructor({
|
|
55117
55159
|
storage,
|
|
55118
55160
|
subscriptions,
|
|
55119
55161
|
lists,
|
|
55120
55162
|
cache,
|
|
55121
|
-
lifetimes
|
|
55163
|
+
lifetimes,
|
|
55164
|
+
schema
|
|
55122
55165
|
}) {
|
|
55123
55166
|
this.storage = storage;
|
|
55124
55167
|
this.subscriptions = subscriptions;
|
|
55125
55168
|
this.lists = lists;
|
|
55126
55169
|
this.cache = cache;
|
|
55127
55170
|
this.lifetimes = lifetimes;
|
|
55171
|
+
this.schema = schema;
|
|
55128
55172
|
this._disabled = typeof globalThis.window === "undefined";
|
|
55129
55173
|
try {
|
|
55130
55174
|
if (process.env.HOUDINI_TEST === "true") {
|
|
@@ -55140,7 +55184,6 @@ var CacheInternal = class {
|
|
|
55140
55184
|
data,
|
|
55141
55185
|
selection: selection2,
|
|
55142
55186
|
variables = {},
|
|
55143
|
-
root = rootID,
|
|
55144
55187
|
parent = rootID,
|
|
55145
55188
|
applyUpdates = false,
|
|
55146
55189
|
layer,
|
|
@@ -55163,9 +55206,17 @@ var CacheInternal = class {
|
|
|
55163
55206
|
selection: fieldSelection,
|
|
55164
55207
|
operations,
|
|
55165
55208
|
abstract: isAbstract,
|
|
55166
|
-
update
|
|
55209
|
+
update,
|
|
55210
|
+
nullable
|
|
55167
55211
|
} = targetSelection[field];
|
|
55168
55212
|
const key = evaluateKey(keyRaw, variables);
|
|
55213
|
+
this.schema.setFieldType({
|
|
55214
|
+
parent,
|
|
55215
|
+
key: keyRaw,
|
|
55216
|
+
type: linkedType,
|
|
55217
|
+
nullable,
|
|
55218
|
+
link: !!fieldSelection
|
|
55219
|
+
});
|
|
55169
55220
|
const currentSubscribers = this.subscriptions.get(parent, key);
|
|
55170
55221
|
const { value: previousValue, displayLayers } = this.storage.get(parent, key);
|
|
55171
55222
|
const displayLayer = layer.isDisplayLayer(displayLayers);
|
|
@@ -55234,7 +55285,6 @@ var CacheInternal = class {
|
|
|
55234
55285
|
}
|
|
55235
55286
|
if (linkedID) {
|
|
55236
55287
|
this.writeSelection({
|
|
55237
|
-
root,
|
|
55238
55288
|
selection: fieldSelection,
|
|
55239
55289
|
parent: linkedID,
|
|
55240
55290
|
data: value,
|
|
@@ -55625,7 +55675,7 @@ var CacheInternal = class {
|
|
|
55625
55675
|
var rootID = "_ROOT_";
|
|
55626
55676
|
|
|
55627
55677
|
// src/runtime/cache/index.ts
|
|
55628
|
-
var cache_default = new
|
|
55678
|
+
var cache_default = new Cache3();
|
|
55629
55679
|
|
|
55630
55680
|
// src/runtime/lib/types.ts
|
|
55631
55681
|
var CompiledFragmentKind = "HoudiniFragment" /* Fragment */;
|
|
@@ -55817,6 +55867,7 @@ async function writeFile(filepath, data) {
|
|
|
55817
55867
|
return;
|
|
55818
55868
|
}
|
|
55819
55869
|
if (houdini_mode.is_testing) {
|
|
55870
|
+
import_memfs.fs.mkdirpSync(dirname(filepath));
|
|
55820
55871
|
return import_memfs.fs.writeFileSync(filepath, data);
|
|
55821
55872
|
}
|
|
55822
55873
|
return await fs.writeFile(filepath, data, "utf8");
|
|
@@ -56204,47 +56255,69 @@ var graphql2 = __toESM(require_graphql2(), 1);
|
|
|
56204
56255
|
async function find_graphql(config2, parsedScript, walker) {
|
|
56205
56256
|
await asyncWalk(parsedScript, {
|
|
56206
56257
|
async enter(node, parent) {
|
|
56207
|
-
if (node.type
|
|
56258
|
+
if (node.type !== "TaggedTemplateExpression" && node.type !== "CallExpression") {
|
|
56259
|
+
return;
|
|
56260
|
+
}
|
|
56261
|
+
let documentString;
|
|
56262
|
+
if (node.type === "TaggedTemplateExpression") {
|
|
56208
56263
|
const expr = node;
|
|
56209
|
-
|
|
56210
|
-
const parsedTag = graphql2.parse(tagContent);
|
|
56211
|
-
if (walker.where && !walker.where(parsedTag)) {
|
|
56264
|
+
if (expr.tag.type !== "Identifier" || expr.tag.name !== "graphql") {
|
|
56212
56265
|
return;
|
|
56213
56266
|
}
|
|
56214
|
-
|
|
56215
|
-
|
|
56216
|
-
|
|
56217
|
-
|
|
56267
|
+
documentString = expr.quasi.quasis[0].value.raw;
|
|
56268
|
+
} else if (node.type === "CallExpression") {
|
|
56269
|
+
const expr = node;
|
|
56270
|
+
if (expr.callee.type !== "Identifier" || expr.callee.name !== "graphql" || expr.arguments.length !== 1) {
|
|
56271
|
+
return;
|
|
56218
56272
|
}
|
|
56219
|
-
|
|
56220
|
-
if (
|
|
56221
|
-
|
|
56273
|
+
const argument = expr.arguments[0];
|
|
56274
|
+
if (argument.type === "TemplateLiteral") {
|
|
56275
|
+
documentString = argument.quasis[0].value.raw;
|
|
56276
|
+
} else if (argument.type === "StringLiteral") {
|
|
56277
|
+
documentString = argument.value;
|
|
56222
56278
|
} else {
|
|
56223
|
-
|
|
56224
|
-
kind = CompiledQueryKind;
|
|
56225
|
-
} else if (definition.operation === "mutation") {
|
|
56226
|
-
kind = CompiledMutationKind;
|
|
56227
|
-
} else {
|
|
56228
|
-
kind = CompiledSubscriptionKind;
|
|
56229
|
-
}
|
|
56279
|
+
return;
|
|
56230
56280
|
}
|
|
56231
|
-
|
|
56232
|
-
|
|
56233
|
-
|
|
56234
|
-
|
|
56235
|
-
|
|
56236
|
-
|
|
56237
|
-
remove: this.remove,
|
|
56238
|
-
replaceWith: this.replace
|
|
56239
|
-
},
|
|
56240
|
-
artifact: {
|
|
56241
|
-
name: name2,
|
|
56242
|
-
kind
|
|
56243
|
-
},
|
|
56244
|
-
parent,
|
|
56245
|
-
tagContent
|
|
56246
|
-
});
|
|
56281
|
+
} else {
|
|
56282
|
+
return;
|
|
56283
|
+
}
|
|
56284
|
+
const parsedTag = graphql2.parse(documentString);
|
|
56285
|
+
if (walker.where && !walker.where(parsedTag)) {
|
|
56286
|
+
return;
|
|
56247
56287
|
}
|
|
56288
|
+
const definition = config2.extractDefinition(parsedTag);
|
|
56289
|
+
const name2 = definition.name?.value;
|
|
56290
|
+
if (!name2) {
|
|
56291
|
+
throw new Error("Could not find definition name");
|
|
56292
|
+
}
|
|
56293
|
+
let kind;
|
|
56294
|
+
if (definition.kind === "FragmentDefinition") {
|
|
56295
|
+
kind = CompiledFragmentKind;
|
|
56296
|
+
} else {
|
|
56297
|
+
if (definition.operation === "query") {
|
|
56298
|
+
kind = CompiledQueryKind;
|
|
56299
|
+
} else if (definition.operation === "mutation") {
|
|
56300
|
+
kind = CompiledMutationKind;
|
|
56301
|
+
} else {
|
|
56302
|
+
kind = CompiledSubscriptionKind;
|
|
56303
|
+
}
|
|
56304
|
+
}
|
|
56305
|
+
walker.dependency?.(config2.artifactPath(parsedTag));
|
|
56306
|
+
await walker.tag({
|
|
56307
|
+
parsedDocument: parsedTag,
|
|
56308
|
+
node: {
|
|
56309
|
+
...node,
|
|
56310
|
+
...this,
|
|
56311
|
+
remove: this.remove,
|
|
56312
|
+
replaceWith: this.replace
|
|
56313
|
+
},
|
|
56314
|
+
artifact: {
|
|
56315
|
+
name: name2,
|
|
56316
|
+
kind
|
|
56317
|
+
},
|
|
56318
|
+
parent,
|
|
56319
|
+
tagContent: documentString
|
|
56320
|
+
});
|
|
56248
56321
|
}
|
|
56249
56322
|
});
|
|
56250
56323
|
}
|
|
@@ -56667,7 +56740,7 @@ function deepMerge(filepath, ...targets) {
|
|
|
56667
56740
|
Object.entries(fields).map(([key, value]) => [key, deepMerge(filepath, ...value)])
|
|
56668
56741
|
);
|
|
56669
56742
|
}
|
|
56670
|
-
function convertValue(val) {
|
|
56743
|
+
function convertValue(config2, val) {
|
|
56671
56744
|
let value;
|
|
56672
56745
|
let kind;
|
|
56673
56746
|
if (val.kind === graphql5.Kind.INT) {
|
|
@@ -56799,7 +56872,7 @@ function operationObject({
|
|
|
56799
56872
|
operationWhen[i ? "must_not" : "must"] = arg.value.fields.reduce(
|
|
56800
56873
|
(obj, arg2) => ({
|
|
56801
56874
|
...obj,
|
|
56802
|
-
[arg2.name.value]: convertValue(arg2.value).value
|
|
56875
|
+
[arg2.name.value]: convertValue(config2, arg2.value).value
|
|
56803
56876
|
}),
|
|
56804
56877
|
{}
|
|
56805
56878
|
);
|
|
@@ -56815,7 +56888,7 @@ function operationObject({
|
|
|
56815
56888
|
operationWhen[which] = directive.arguments?.reduce(
|
|
56816
56889
|
(filters, argument) => ({
|
|
56817
56890
|
...filters,
|
|
56818
|
-
[argument.name.value]: convertValue(argument.value).value
|
|
56891
|
+
[argument.name.value]: convertValue(config2, argument.value).value
|
|
56819
56892
|
}),
|
|
56820
56893
|
{}
|
|
56821
56894
|
);
|
|
@@ -57774,7 +57847,9 @@ function fieldKey(config2, field) {
|
|
|
57774
57847
|
[arg.name.value]: printed.substring(start - 1, end - 1)
|
|
57775
57848
|
};
|
|
57776
57849
|
}, {});
|
|
57777
|
-
|
|
57850
|
+
const args = Object.keys(argObj);
|
|
57851
|
+
args.sort();
|
|
57852
|
+
let key = Object.values(argObj).length > 0 ? `${attributeName}(${args.map((key2) => `${key2}: ${argObj[key2]}`).join(", ")})` : attributeName;
|
|
57778
57853
|
if (paginated) {
|
|
57779
57854
|
key = key + "::paginated";
|
|
57780
57855
|
}
|
|
@@ -57957,7 +58032,7 @@ function selection({
|
|
|
57957
58032
|
fieldObj.filters = (field.arguments || []).reduce(
|
|
57958
58033
|
(filters, arg) => ({
|
|
57959
58034
|
...filters,
|
|
57960
|
-
[arg.name.value]: convertValue(arg.value)
|
|
58035
|
+
[arg.name.value]: convertValue(config2, arg.value)
|
|
57961
58036
|
}),
|
|
57962
58037
|
{}
|
|
57963
58038
|
);
|
|
@@ -58244,7 +58319,9 @@ function artifactGenerator(stats) {
|
|
|
58244
58319
|
}
|
|
58245
58320
|
|
|
58246
58321
|
// src/codegen/generators/runtime/index.ts
|
|
58247
|
-
|
|
58322
|
+
var recast6 = __toESM(require_main2(), 1);
|
|
58323
|
+
var AST6 = recast6.types.builders;
|
|
58324
|
+
async function runtimeGenerator(config2, docs) {
|
|
58248
58325
|
await Promise.all([
|
|
58249
58326
|
fs_exports.recursiveCopy(config2.runtimeSource, config2.runtimeDirectory, {
|
|
58250
58327
|
[path_exports.join(config2.runtimeSource, "lib", "config.js")]: (content) => {
|
|
@@ -58258,6 +58335,59 @@ async function runtimeGenerator(config2) {
|
|
|
58258
58335
|
}),
|
|
58259
58336
|
...config2.plugins.filter((plugin) => plugin.include_runtime).map((plugin) => generatePluginRuntime(config2, plugin))
|
|
58260
58337
|
]);
|
|
58338
|
+
const indexPath = path_exports.join(config2.runtimeDirectory, "index.d.ts");
|
|
58339
|
+
const contents = await parseJS(await fs_exports.readFile(indexPath) || "");
|
|
58340
|
+
const graphql_tag_return = config2.plugins.find(
|
|
58341
|
+
(plugin) => plugin.graphql_tag_return
|
|
58342
|
+
)?.graphql_tag_return;
|
|
58343
|
+
if (graphql_tag_return && contents) {
|
|
58344
|
+
const overloaded_returns = {};
|
|
58345
|
+
for (const doc of docs) {
|
|
58346
|
+
const return_value = graphql_tag_return({
|
|
58347
|
+
config: config2,
|
|
58348
|
+
doc,
|
|
58349
|
+
ensure_import({ identifier, module }) {
|
|
58350
|
+
ensureImports({
|
|
58351
|
+
config: config2,
|
|
58352
|
+
body: contents.script.body,
|
|
58353
|
+
sourceModule: module,
|
|
58354
|
+
import: [identifier]
|
|
58355
|
+
});
|
|
58356
|
+
}
|
|
58357
|
+
});
|
|
58358
|
+
if (return_value) {
|
|
58359
|
+
overloaded_returns[doc.originalString] = return_value;
|
|
58360
|
+
}
|
|
58361
|
+
}
|
|
58362
|
+
if (Object.keys(overloaded_returns).length > 0) {
|
|
58363
|
+
for (const [i, expression] of (contents?.script.body ?? []).entries()) {
|
|
58364
|
+
if (expression.type !== "ExportNamedDeclaration" || expression.declaration?.type !== "TSDeclareFunction" || expression.declaration.id?.name !== "graphql") {
|
|
58365
|
+
continue;
|
|
58366
|
+
}
|
|
58367
|
+
for (const [queryString, returnValue] of Object.entries(overloaded_returns)) {
|
|
58368
|
+
const input = AST6.identifier("str");
|
|
58369
|
+
input.typeAnnotation = AST6.tsTypeAnnotation(
|
|
58370
|
+
AST6.tsLiteralType(AST6.stringLiteral(queryString))
|
|
58371
|
+
);
|
|
58372
|
+
contents?.script.body.splice(
|
|
58373
|
+
i,
|
|
58374
|
+
0,
|
|
58375
|
+
AST6.exportNamedDeclaration(
|
|
58376
|
+
AST6.tsDeclareFunction(
|
|
58377
|
+
AST6.identifier("graphql"),
|
|
58378
|
+
[input],
|
|
58379
|
+
AST6.tsTypeAnnotation(
|
|
58380
|
+
AST6.tsTypeReference(AST6.identifier(returnValue))
|
|
58381
|
+
)
|
|
58382
|
+
)
|
|
58383
|
+
)
|
|
58384
|
+
);
|
|
58385
|
+
}
|
|
58386
|
+
break;
|
|
58387
|
+
}
|
|
58388
|
+
await fs_exports.writeFile(indexPath, recast6.prettyPrint(contents.script).code);
|
|
58389
|
+
}
|
|
58390
|
+
}
|
|
58261
58391
|
}
|
|
58262
58392
|
async function generatePluginRuntime(config2, plugin) {
|
|
58263
58393
|
if (houdini_mode.is_testing) {
|
|
@@ -58292,20 +58422,20 @@ async function generatePluginRuntime(config2, plugin) {
|
|
|
58292
58422
|
}
|
|
58293
58423
|
|
|
58294
58424
|
// src/codegen/generators/typescript/index.ts
|
|
58295
|
-
var
|
|
58425
|
+
var recast12 = __toESM(require_main2(), 1);
|
|
58296
58426
|
|
|
58297
58427
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
58298
58428
|
var graphql15 = __toESM(require_graphql2(), 1);
|
|
58299
|
-
var
|
|
58429
|
+
var recast9 = __toESM(require_main2(), 1);
|
|
58300
58430
|
|
|
58301
58431
|
// src/codegen/generators/typescript/typeReference.ts
|
|
58302
58432
|
var graphql14 = __toESM(require_graphql2(), 1);
|
|
58303
|
-
var
|
|
58433
|
+
var recast8 = __toESM(require_main2(), 1);
|
|
58304
58434
|
|
|
58305
58435
|
// src/codegen/generators/typescript/types.ts
|
|
58306
58436
|
var graphql13 = __toESM(require_graphql2(), 1);
|
|
58307
|
-
var
|
|
58308
|
-
var
|
|
58437
|
+
var recast7 = __toESM(require_main2(), 1);
|
|
58438
|
+
var AST7 = recast7.types.builders;
|
|
58309
58439
|
function readonlyProperty(prop, enable = true) {
|
|
58310
58440
|
if (enable) {
|
|
58311
58441
|
prop.readonly = true;
|
|
@@ -58313,28 +58443,28 @@ function readonlyProperty(prop, enable = true) {
|
|
|
58313
58443
|
return prop;
|
|
58314
58444
|
}
|
|
58315
58445
|
function nullableField(inner, input = false) {
|
|
58316
|
-
const members = [inner,
|
|
58446
|
+
const members = [inner, AST7.tsNullKeyword()];
|
|
58317
58447
|
if (input) {
|
|
58318
|
-
members.push(
|
|
58448
|
+
members.push(AST7.tsUndefinedKeyword());
|
|
58319
58449
|
}
|
|
58320
|
-
return
|
|
58450
|
+
return AST7.tsUnionType(members);
|
|
58321
58451
|
}
|
|
58322
58452
|
function scalarPropertyValue(config2, missingScalars, target) {
|
|
58323
58453
|
switch (target.name) {
|
|
58324
58454
|
case "String": {
|
|
58325
|
-
return
|
|
58455
|
+
return AST7.tsStringKeyword();
|
|
58326
58456
|
}
|
|
58327
58457
|
case "Int": {
|
|
58328
|
-
return
|
|
58458
|
+
return AST7.tsNumberKeyword();
|
|
58329
58459
|
}
|
|
58330
58460
|
case "Float": {
|
|
58331
|
-
return
|
|
58461
|
+
return AST7.tsNumberKeyword();
|
|
58332
58462
|
}
|
|
58333
58463
|
case "Boolean": {
|
|
58334
|
-
return
|
|
58464
|
+
return AST7.tsBooleanKeyword();
|
|
58335
58465
|
}
|
|
58336
58466
|
case "ID": {
|
|
58337
|
-
return
|
|
58467
|
+
return AST7.tsStringKeyword();
|
|
58338
58468
|
}
|
|
58339
58469
|
default: {
|
|
58340
58470
|
if (graphql13.isNonNullType(target) && "ofType" in target) {
|
|
@@ -58345,23 +58475,23 @@ function scalarPropertyValue(config2, missingScalars, target) {
|
|
|
58345
58475
|
);
|
|
58346
58476
|
}
|
|
58347
58477
|
if (config2.scalars?.[target.name]) {
|
|
58348
|
-
return
|
|
58478
|
+
return AST7.tsTypeReference(AST7.identifier(config2.scalars?.[target.name].type));
|
|
58349
58479
|
}
|
|
58350
58480
|
missingScalars.add(target.name);
|
|
58351
|
-
return
|
|
58481
|
+
return AST7.tsAnyKeyword();
|
|
58352
58482
|
}
|
|
58353
58483
|
}
|
|
58354
58484
|
}
|
|
58355
58485
|
|
|
58356
58486
|
// src/codegen/generators/typescript/typeReference.ts
|
|
58357
|
-
var
|
|
58487
|
+
var AST8 = recast8.types.builders;
|
|
58358
58488
|
function tsTypeReference(config2, missingScalars, definition) {
|
|
58359
58489
|
const { type, wrappers } = unwrapType(config2, definition.type);
|
|
58360
58490
|
let result;
|
|
58361
58491
|
if (graphql14.isScalarType(type)) {
|
|
58362
58492
|
result = scalarPropertyValue(config2, missingScalars, type);
|
|
58363
58493
|
} else {
|
|
58364
|
-
result =
|
|
58494
|
+
result = AST8.tsTypeReference(AST8.identifier(type.name));
|
|
58365
58495
|
}
|
|
58366
58496
|
for (const toWrap of wrappers) {
|
|
58367
58497
|
if (toWrap === "NonNull" /* NonNull */) {
|
|
@@ -58369,14 +58499,14 @@ function tsTypeReference(config2, missingScalars, definition) {
|
|
|
58369
58499
|
} else if (toWrap === "Nullable" /* Nullable */) {
|
|
58370
58500
|
result = nullableField(result, true);
|
|
58371
58501
|
} else if (toWrap === "List" /* List */) {
|
|
58372
|
-
result =
|
|
58502
|
+
result = AST8.tsArrayType(AST8.tsParenthesizedType(result));
|
|
58373
58503
|
}
|
|
58374
58504
|
}
|
|
58375
58505
|
return result;
|
|
58376
58506
|
}
|
|
58377
58507
|
|
|
58378
58508
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
58379
|
-
var
|
|
58509
|
+
var AST9 = recast9.types.builders;
|
|
58380
58510
|
function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingScalars, rootType) {
|
|
58381
58511
|
const { type } = unwrapType(config2, rootType);
|
|
58382
58512
|
if (graphql15.isScalarType(type)) {
|
|
@@ -58403,20 +58533,267 @@ function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingS
|
|
|
58403
58533
|
for (const field of Object.values(type.getFields())) {
|
|
58404
58534
|
addReferencedInputTypes(config2, filepath, body, visitedTypes, missingScalars, field.type);
|
|
58405
58535
|
members.push(
|
|
58406
|
-
|
|
58407
|
-
|
|
58408
|
-
|
|
58536
|
+
AST9.tsPropertySignature(
|
|
58537
|
+
AST9.identifier(field.name),
|
|
58538
|
+
AST9.tsTypeAnnotation(tsTypeReference(config2, missingScalars, field)),
|
|
58409
58539
|
graphql15.isNullableType(field.type)
|
|
58410
58540
|
)
|
|
58411
58541
|
);
|
|
58412
58542
|
}
|
|
58413
|
-
body.push(
|
|
58543
|
+
body.push(AST9.tsTypeAliasDeclaration(AST9.identifier(type.name), AST9.tsTypeLiteral(members)));
|
|
58414
58544
|
}
|
|
58415
58545
|
|
|
58416
|
-
// src/codegen/generators/typescript/
|
|
58546
|
+
// src/codegen/generators/typescript/imperativeCache.ts
|
|
58417
58547
|
var graphql16 = __toESM(require_graphql2(), 1);
|
|
58418
|
-
var
|
|
58419
|
-
var
|
|
58548
|
+
var recast10 = __toESM(require_main2(), 1);
|
|
58549
|
+
var AST10 = recast10.types.builders;
|
|
58550
|
+
async function imperativeCacheTypef(config2, docs) {
|
|
58551
|
+
const target = path_exports.join(config2.runtimeDirectory, "generated.d.ts");
|
|
58552
|
+
const body = [];
|
|
58553
|
+
const declaration = AST10.tsTypeAliasDeclaration(
|
|
58554
|
+
AST10.identifier(CacheTypeDefName),
|
|
58555
|
+
AST10.tsTypeLiteral([
|
|
58556
|
+
AST10.tsPropertySignature(
|
|
58557
|
+
AST10.identifier("types"),
|
|
58558
|
+
AST10.tsTypeAnnotation(typeDefinitions(config2, body))
|
|
58559
|
+
),
|
|
58560
|
+
AST10.tsPropertySignature(
|
|
58561
|
+
AST10.identifier("lists"),
|
|
58562
|
+
AST10.tsTypeAnnotation(listDefinitions(config2, docs))
|
|
58563
|
+
)
|
|
58564
|
+
])
|
|
58565
|
+
);
|
|
58566
|
+
declaration.declare = true;
|
|
58567
|
+
const importRecord = AST10.importDeclaration(
|
|
58568
|
+
[AST10.importSpecifier(AST10.identifier("Record"))],
|
|
58569
|
+
AST10.stringLiteral("./public/record")
|
|
58570
|
+
);
|
|
58571
|
+
importRecord.importKind = "type";
|
|
58572
|
+
await fs_exports.writeFile(
|
|
58573
|
+
target,
|
|
58574
|
+
recast10.prettyPrint(
|
|
58575
|
+
AST10.program([importRecord, ...body, AST10.exportNamedDeclaration(declaration)])
|
|
58576
|
+
).code
|
|
58577
|
+
);
|
|
58578
|
+
}
|
|
58579
|
+
function typeDefinitions(config2, body) {
|
|
58580
|
+
const operationTypes = [config2.schema.getMutationType(), config2.schema.getSubscriptionType()].filter(Boolean).map((type) => type?.name);
|
|
58581
|
+
const visitedTypes = /* @__PURE__ */ new Set();
|
|
58582
|
+
const types14 = Object.values(config2.schema.getTypeMap()).filter(
|
|
58583
|
+
(type) => !graphql16.isAbstractType(type) && !graphql16.isScalarType(type) && !graphql16.isEnumType(type) && !graphql16.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
|
|
58584
|
+
);
|
|
58585
|
+
return AST10.tsTypeLiteral(
|
|
58586
|
+
types14.map((type) => {
|
|
58587
|
+
let typeName = type.name;
|
|
58588
|
+
if (config2.schema.getQueryType() && config2.schema.getQueryType()?.name === type.name) {
|
|
58589
|
+
typeName = "__ROOT__";
|
|
58590
|
+
}
|
|
58591
|
+
let idFields = AST10.tsNeverKeyword();
|
|
58592
|
+
const keys = keyFieldsForType(config2.configFile, type.name);
|
|
58593
|
+
if (graphql16.isObjectType(type) && keys.length > 0 && keys.every((key) => type.getFields()[key])) {
|
|
58594
|
+
idFields = AST10.tsTypeLiteral(
|
|
58595
|
+
keys.map((key) => {
|
|
58596
|
+
const fieldType = type.getFields()[key];
|
|
58597
|
+
const unwrapped = unwrapType(config2, fieldType.type);
|
|
58598
|
+
return AST10.tsPropertySignature(
|
|
58599
|
+
AST10.identifier(key),
|
|
58600
|
+
AST10.tsTypeAnnotation(
|
|
58601
|
+
scalarPropertyValue(config2, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
58602
|
+
)
|
|
58603
|
+
);
|
|
58604
|
+
})
|
|
58605
|
+
);
|
|
58606
|
+
} else if (typeName === "__ROOT__") {
|
|
58607
|
+
idFields = AST10.tsTypeLiteral([]);
|
|
58608
|
+
}
|
|
58609
|
+
let fields = AST10.tsTypeLiteral([]);
|
|
58610
|
+
if (graphql16.isObjectType(type)) {
|
|
58611
|
+
fields = AST10.tsTypeLiteral(
|
|
58612
|
+
Object.entries(type.getFields()).map(
|
|
58613
|
+
([key, fieldType]) => {
|
|
58614
|
+
const unwrapped = unwrapType(config2, fieldType.type);
|
|
58615
|
+
let typeOptions = AST10.tsUnionType([]);
|
|
58616
|
+
if (graphql16.isScalarType(unwrapped.type)) {
|
|
58617
|
+
typeOptions.types.push(
|
|
58618
|
+
scalarPropertyValue(config2, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
58619
|
+
);
|
|
58620
|
+
} else if (graphql16.isEnumType(unwrapped.type)) {
|
|
58621
|
+
typeOptions.types.push(
|
|
58622
|
+
AST10.tsTypeReference(AST10.identifier(unwrapped.type.name))
|
|
58623
|
+
);
|
|
58624
|
+
} else if (!graphql16.isAbstractType(unwrapped.type)) {
|
|
58625
|
+
typeOptions.types.push(record(unwrapped.type.name));
|
|
58626
|
+
} else {
|
|
58627
|
+
typeOptions.types.push(
|
|
58628
|
+
...config2.schema.getPossibleTypes(unwrapped.type).map((type2) => record(type2.name))
|
|
58629
|
+
);
|
|
58630
|
+
}
|
|
58631
|
+
for (const wrapper of unwrapped.wrappers) {
|
|
58632
|
+
if (wrapper === "Nullable" /* Nullable */) {
|
|
58633
|
+
typeOptions = AST10.tsParenthesizedType(
|
|
58634
|
+
AST10.tsUnionType([typeOptions, AST10.tsNullKeyword()])
|
|
58635
|
+
);
|
|
58636
|
+
} else if (wrapper === "List" /* List */) {
|
|
58637
|
+
typeOptions = AST10.tsArrayType(
|
|
58638
|
+
AST10.tsParenthesizedType(typeOptions)
|
|
58639
|
+
);
|
|
58640
|
+
}
|
|
58641
|
+
}
|
|
58642
|
+
if (typeOptions.type === "TSParenthesizedType") {
|
|
58643
|
+
typeOptions = typeOptions.typeAnnotation;
|
|
58644
|
+
}
|
|
58645
|
+
let args = AST10.tsNeverKeyword();
|
|
58646
|
+
if (fieldType.args?.length > 0) {
|
|
58647
|
+
args = AST10.tsTypeLiteral(
|
|
58648
|
+
fieldType.args.map((arg) => {
|
|
58649
|
+
addReferencedInputTypes(
|
|
58650
|
+
config2,
|
|
58651
|
+
"",
|
|
58652
|
+
body,
|
|
58653
|
+
visitedTypes,
|
|
58654
|
+
/* @__PURE__ */ new Set(),
|
|
58655
|
+
arg.type
|
|
58656
|
+
);
|
|
58657
|
+
const prop = AST10.tsPropertySignature(
|
|
58658
|
+
AST10.identifier(arg.name),
|
|
58659
|
+
AST10.tsTypeAnnotation(
|
|
58660
|
+
tsTypeReference(config2, /* @__PURE__ */ new Set(), arg)
|
|
58661
|
+
)
|
|
58662
|
+
);
|
|
58663
|
+
const unwrapped2 = unwrapType(config2, arg.type);
|
|
58664
|
+
prop.optional = unwrapped2.wrappers[unwrapped2.wrappers.length - 1] === "Nullable" /* Nullable */;
|
|
58665
|
+
return prop;
|
|
58666
|
+
})
|
|
58667
|
+
);
|
|
58668
|
+
}
|
|
58669
|
+
return AST10.tsPropertySignature(
|
|
58670
|
+
AST10.identifier(key),
|
|
58671
|
+
AST10.tsTypeAnnotation(
|
|
58672
|
+
AST10.tsTypeLiteral([
|
|
58673
|
+
AST10.tsPropertySignature(
|
|
58674
|
+
AST10.identifier("type"),
|
|
58675
|
+
AST10.tsTypeAnnotation(typeOptions)
|
|
58676
|
+
),
|
|
58677
|
+
AST10.tsPropertySignature(
|
|
58678
|
+
AST10.identifier("args"),
|
|
58679
|
+
AST10.tsTypeAnnotation(args)
|
|
58680
|
+
)
|
|
58681
|
+
])
|
|
58682
|
+
)
|
|
58683
|
+
);
|
|
58684
|
+
}
|
|
58685
|
+
)
|
|
58686
|
+
);
|
|
58687
|
+
}
|
|
58688
|
+
return AST10.tsPropertySignature(
|
|
58689
|
+
AST10.identifier(typeName),
|
|
58690
|
+
AST10.tsTypeAnnotation(
|
|
58691
|
+
AST10.tsTypeLiteral([
|
|
58692
|
+
AST10.tsPropertySignature(
|
|
58693
|
+
AST10.identifier("idFields"),
|
|
58694
|
+
AST10.tsTypeAnnotation(idFields)
|
|
58695
|
+
),
|
|
58696
|
+
AST10.tsPropertySignature(
|
|
58697
|
+
AST10.identifier("fields"),
|
|
58698
|
+
AST10.tsTypeAnnotation(fields)
|
|
58699
|
+
)
|
|
58700
|
+
])
|
|
58701
|
+
)
|
|
58702
|
+
);
|
|
58703
|
+
})
|
|
58704
|
+
);
|
|
58705
|
+
}
|
|
58706
|
+
function listDefinitions(config2, docs) {
|
|
58707
|
+
const lists = [];
|
|
58708
|
+
const visitedLists = /* @__PURE__ */ new Set();
|
|
58709
|
+
for (const doc of docs) {
|
|
58710
|
+
graphql16.visit(doc.document, {
|
|
58711
|
+
Directive(node, key, parent, path2, ancestors) {
|
|
58712
|
+
if (![config2.listDirective, config2.paginateDirective].includes(node.name.value)) {
|
|
58713
|
+
return;
|
|
58714
|
+
}
|
|
58715
|
+
const nameArg = node.arguments?.find((arg) => arg.name.value === "name");
|
|
58716
|
+
const nameValue = nameArg?.value?.value || "";
|
|
58717
|
+
if (!nameValue || visitedLists.has(nameValue)) {
|
|
58718
|
+
return;
|
|
58719
|
+
}
|
|
58720
|
+
visitedLists.add(nameValue);
|
|
58721
|
+
const parentType = parentTypeFromAncestors(
|
|
58722
|
+
config2.schema,
|
|
58723
|
+
doc.filename,
|
|
58724
|
+
ancestors.slice(0, -1)
|
|
58725
|
+
);
|
|
58726
|
+
const targetField = ancestors[ancestors.length - 1];
|
|
58727
|
+
const targetFieldDefinition = parentType.getFields()[targetField.name.value];
|
|
58728
|
+
const { type: listType } = unwrapType(config2, targetFieldDefinition.type);
|
|
58729
|
+
const possibleTypes = [];
|
|
58730
|
+
if (graphql16.isAbstractType(listType)) {
|
|
58731
|
+
possibleTypes.push(
|
|
58732
|
+
...config2.schema.getPossibleTypes(listType).map((possible) => possible.name)
|
|
58733
|
+
);
|
|
58734
|
+
} else {
|
|
58735
|
+
possibleTypes.push(listType.name);
|
|
58736
|
+
}
|
|
58737
|
+
lists.push(
|
|
58738
|
+
AST10.tsPropertySignature(
|
|
58739
|
+
AST10.identifier(nameValue),
|
|
58740
|
+
AST10.tsTypeAnnotation(
|
|
58741
|
+
AST10.tsTypeLiteral([
|
|
58742
|
+
AST10.tsPropertySignature(
|
|
58743
|
+
AST10.identifier("type"),
|
|
58744
|
+
AST10.tsTypeAnnotation(
|
|
58745
|
+
AST10.tsUnionType(
|
|
58746
|
+
possibleTypes.map(
|
|
58747
|
+
(possible) => AST10.tsLiteralType(AST10.stringLiteral(possible))
|
|
58748
|
+
)
|
|
58749
|
+
)
|
|
58750
|
+
)
|
|
58751
|
+
),
|
|
58752
|
+
AST10.tsPropertySignature(
|
|
58753
|
+
AST10.identifier("filters"),
|
|
58754
|
+
AST10.tsTypeAnnotation(
|
|
58755
|
+
targetFieldDefinition.args.length === 0 ? AST10.tsNeverKeyword() : AST10.tsTypeLiteral(
|
|
58756
|
+
targetFieldDefinition.args.map((arg) => {
|
|
58757
|
+
const argDef = AST10.tsPropertySignature(
|
|
58758
|
+
AST10.identifier(arg.name),
|
|
58759
|
+
AST10.tsTypeAnnotation(
|
|
58760
|
+
tsTypeReference(
|
|
58761
|
+
config2,
|
|
58762
|
+
/* @__PURE__ */ new Set(),
|
|
58763
|
+
arg
|
|
58764
|
+
)
|
|
58765
|
+
)
|
|
58766
|
+
);
|
|
58767
|
+
argDef.optional = true;
|
|
58768
|
+
return argDef;
|
|
58769
|
+
})
|
|
58770
|
+
)
|
|
58771
|
+
)
|
|
58772
|
+
)
|
|
58773
|
+
])
|
|
58774
|
+
)
|
|
58775
|
+
)
|
|
58776
|
+
);
|
|
58777
|
+
}
|
|
58778
|
+
});
|
|
58779
|
+
}
|
|
58780
|
+
return AST10.tsTypeLiteral(lists);
|
|
58781
|
+
}
|
|
58782
|
+
var CacheTypeDefName = "CacheTypeDef";
|
|
58783
|
+
function record(name2) {
|
|
58784
|
+
return AST10.tsTypeReference(
|
|
58785
|
+
AST10.identifier("Record"),
|
|
58786
|
+
AST10.tsTypeParameterInstantiation([
|
|
58787
|
+
AST10.tsTypeReference(AST10.identifier(CacheTypeDefName)),
|
|
58788
|
+
AST10.tsLiteralType(AST10.stringLiteral(name2))
|
|
58789
|
+
])
|
|
58790
|
+
);
|
|
58791
|
+
}
|
|
58792
|
+
|
|
58793
|
+
// src/codegen/generators/typescript/inlineType.ts
|
|
58794
|
+
var graphql17 = __toESM(require_graphql2(), 1);
|
|
58795
|
+
var recast11 = __toESM(require_main2(), 1);
|
|
58796
|
+
var AST11 = recast11.types.builders;
|
|
58420
58797
|
var fragmentKey = "$fragments";
|
|
58421
58798
|
function inlineType({
|
|
58422
58799
|
config: config2,
|
|
@@ -58433,9 +58810,9 @@ function inlineType({
|
|
|
58433
58810
|
}) {
|
|
58434
58811
|
const { type, wrappers } = unwrapType(config2, rootType);
|
|
58435
58812
|
let result;
|
|
58436
|
-
if (
|
|
58813
|
+
if (graphql17.isScalarType(type)) {
|
|
58437
58814
|
result = scalarPropertyValue(config2, missingScalars, type);
|
|
58438
|
-
} else if (
|
|
58815
|
+
} else if (graphql17.isEnumType(type)) {
|
|
58439
58816
|
if (!visitedTypes.has(type.name)) {
|
|
58440
58817
|
ensureImports({
|
|
58441
58818
|
config: config2,
|
|
@@ -58445,7 +58822,7 @@ function inlineType({
|
|
|
58445
58822
|
});
|
|
58446
58823
|
visitedTypes.add(type.name);
|
|
58447
58824
|
}
|
|
58448
|
-
result =
|
|
58825
|
+
result = AST11.tsTypeReference(AST11.identifier(type.name));
|
|
58449
58826
|
} else if (selections) {
|
|
58450
58827
|
const rootObj = type;
|
|
58451
58828
|
const inlineFragments = {};
|
|
@@ -58453,11 +58830,11 @@ function inlineType({
|
|
|
58453
58830
|
for (const selection2 of selections) {
|
|
58454
58831
|
if (selection2.kind === "InlineFragment" && selection2.typeCondition) {
|
|
58455
58832
|
const fragmentType = config2.schema.getType(selection2.typeCondition.name.value);
|
|
58456
|
-
if (!
|
|
58833
|
+
if (!graphql17.isInterfaceType(type) && !graphql17.isUnionType(type)) {
|
|
58457
58834
|
selectedFields.push(...selection2.selectionSet.selections);
|
|
58458
58835
|
continue;
|
|
58459
58836
|
}
|
|
58460
|
-
if (!
|
|
58837
|
+
if (!graphql17.isInterfaceType(fragmentType) && !graphql17.isUnionType(fragmentType)) {
|
|
58461
58838
|
if (!inlineFragments[fragmentType.name]) {
|
|
58462
58839
|
inlineFragments[fragmentType.name] = [];
|
|
58463
58840
|
}
|
|
@@ -58496,7 +58873,7 @@ function inlineType({
|
|
|
58496
58873
|
selectedFields.push(selection2);
|
|
58497
58874
|
}
|
|
58498
58875
|
}
|
|
58499
|
-
result =
|
|
58876
|
+
result = AST11.tsTypeLiteral([
|
|
58500
58877
|
...(selectedFields || []).filter(
|
|
58501
58878
|
(field) => field.kind === "Field"
|
|
58502
58879
|
).map((selection2) => {
|
|
@@ -58516,9 +58893,9 @@ function inlineType({
|
|
|
58516
58893
|
allOptional
|
|
58517
58894
|
});
|
|
58518
58895
|
const prop = readonlyProperty(
|
|
58519
|
-
|
|
58520
|
-
|
|
58521
|
-
|
|
58896
|
+
AST11.tsPropertySignature(
|
|
58897
|
+
AST11.identifier(attributeName),
|
|
58898
|
+
AST11.tsTypeAnnotation(attributeType)
|
|
58522
58899
|
),
|
|
58523
58900
|
allowReadonly
|
|
58524
58901
|
);
|
|
@@ -58532,15 +58909,15 @@ function inlineType({
|
|
|
58532
58909
|
if (includeFragments && fragmentSpreads && fragmentSpreads.length) {
|
|
58533
58910
|
result.members.push(
|
|
58534
58911
|
readonlyProperty(
|
|
58535
|
-
|
|
58536
|
-
|
|
58537
|
-
|
|
58538
|
-
|
|
58912
|
+
AST11.tsPropertySignature(
|
|
58913
|
+
AST11.identifier(fragmentKey),
|
|
58914
|
+
AST11.tsTypeAnnotation(
|
|
58915
|
+
AST11.tsTypeLiteral(
|
|
58539
58916
|
(fragmentSpreads || []).map(
|
|
58540
|
-
(fragmentSpread) =>
|
|
58541
|
-
|
|
58542
|
-
|
|
58543
|
-
|
|
58917
|
+
(fragmentSpread) => AST11.tsPropertySignature(
|
|
58918
|
+
AST11.identifier(fragmentSpread.name.value),
|
|
58919
|
+
AST11.tsTypeAnnotation(
|
|
58920
|
+
AST11.tsLiteralType(AST11.booleanLiteral(true))
|
|
58544
58921
|
)
|
|
58545
58922
|
)
|
|
58546
58923
|
)
|
|
@@ -58577,7 +58954,7 @@ function inlineType({
|
|
|
58577
58954
|
}
|
|
58578
58955
|
}
|
|
58579
58956
|
}
|
|
58580
|
-
if (objectType.type === "TSTypeLiteral" && !
|
|
58957
|
+
if (objectType.type === "TSTypeLiteral" && !graphql17.isInterfaceType(fragmentRootType) && !graphql17.isUnionType(fragmentRootType)) {
|
|
58581
58958
|
const existingTypenameIndex = objectType.members.findIndex(
|
|
58582
58959
|
(member) => member.type === "TSPropertySignature" && member.key.type === "Identifier" && member.key.name === "__typename"
|
|
58583
58960
|
);
|
|
@@ -58586,9 +58963,9 @@ function inlineType({
|
|
|
58586
58963
|
}
|
|
58587
58964
|
objectType.members.push(
|
|
58588
58965
|
readonlyProperty(
|
|
58589
|
-
|
|
58590
|
-
|
|
58591
|
-
|
|
58966
|
+
AST11.tsPropertySignature(
|
|
58967
|
+
AST11.identifier("__typename"),
|
|
58968
|
+
AST11.tsTypeAnnotation(AST11.tsLiteralType(AST11.stringLiteral(typeName)))
|
|
58592
58969
|
),
|
|
58593
58970
|
allowReadonly
|
|
58594
58971
|
)
|
|
@@ -58599,8 +58976,8 @@ function inlineType({
|
|
|
58599
58976
|
if (Object.keys(inlineFragmentSelections).length > 0) {
|
|
58600
58977
|
let selectionTypes = Object.entries(inlineFragmentSelections).map(
|
|
58601
58978
|
([typeName, { type: type2, tsType }]) => {
|
|
58602
|
-
return
|
|
58603
|
-
|
|
58979
|
+
return AST11.tsParenthesizedType(
|
|
58980
|
+
AST11.tsIntersectionType(
|
|
58604
58981
|
[tsType].flatMap((type3) => {
|
|
58605
58982
|
if (type3.type === "TSUnionType") {
|
|
58606
58983
|
return type3.types.filter(
|
|
@@ -58613,9 +58990,9 @@ function inlineType({
|
|
|
58613
58990
|
);
|
|
58614
58991
|
}
|
|
58615
58992
|
);
|
|
58616
|
-
result =
|
|
58993
|
+
result = AST11.tsIntersectionType([
|
|
58617
58994
|
result,
|
|
58618
|
-
|
|
58995
|
+
AST11.tsParenthesizedType(AST11.tsUnionType(selectionTypes))
|
|
58619
58996
|
]);
|
|
58620
58997
|
}
|
|
58621
58998
|
} else {
|
|
@@ -58627,7 +59004,7 @@ function inlineType({
|
|
|
58627
59004
|
} else if (toWrap === "NonNull" /* NonNull */) {
|
|
58628
59005
|
continue;
|
|
58629
59006
|
} else if (toWrap === "List" /* List */) {
|
|
58630
|
-
result =
|
|
59007
|
+
result = AST11.tsArrayType(AST11.tsParenthesizedType(result));
|
|
58631
59008
|
}
|
|
58632
59009
|
}
|
|
58633
59010
|
return result;
|
|
@@ -58644,7 +59021,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection2) {
|
|
|
58644
59021
|
},
|
|
58645
59022
|
type: schema.getType("String")
|
|
58646
59023
|
};
|
|
58647
|
-
} else if (
|
|
59024
|
+
} else if (graphql17.isNonNullType(rootType) && "getFields" in rootType.ofType) {
|
|
58648
59025
|
fields = rootType.ofType.getFields();
|
|
58649
59026
|
} else {
|
|
58650
59027
|
fields = rootType.getFields();
|
|
@@ -58656,7 +59033,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection2) {
|
|
|
58656
59033
|
message: `Could not find type information for field ${rootType.toString()}.${selectionName} ${field}`
|
|
58657
59034
|
});
|
|
58658
59035
|
}
|
|
58659
|
-
const fieldType =
|
|
59036
|
+
const fieldType = graphql17.getNamedType(field.type);
|
|
58660
59037
|
if (!fieldType) {
|
|
58661
59038
|
throw new HoudiniError({
|
|
58662
59039
|
filepath,
|
|
@@ -58672,7 +59049,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection2) {
|
|
|
58672
59049
|
}
|
|
58673
59050
|
|
|
58674
59051
|
// src/codegen/generators/typescript/index.ts
|
|
58675
|
-
var
|
|
59052
|
+
var AST12 = recast12.types.builders;
|
|
58676
59053
|
async function typescriptGenerator(config2, docs) {
|
|
58677
59054
|
const typePaths = [];
|
|
58678
59055
|
const fragmentDefinitions = {};
|
|
@@ -58690,7 +59067,7 @@ async function typescriptGenerator(config2, docs) {
|
|
|
58690
59067
|
return;
|
|
58691
59068
|
}
|
|
58692
59069
|
const typeDefPath = config2.artifactTypePath(originalDocument);
|
|
58693
|
-
const program =
|
|
59070
|
+
const program = AST12.program([]);
|
|
58694
59071
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
58695
59072
|
let definition = originalDocument.definitions.find(
|
|
58696
59073
|
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value === name2
|
|
@@ -58723,21 +59100,21 @@ async function typescriptGenerator(config2, docs) {
|
|
|
58723
59100
|
missingScalars
|
|
58724
59101
|
);
|
|
58725
59102
|
}
|
|
58726
|
-
await fs_exports.writeFile(typeDefPath,
|
|
59103
|
+
await fs_exports.writeFile(typeDefPath, recast12.print(program).code);
|
|
58727
59104
|
typePaths.push(typeDefPath);
|
|
58728
59105
|
})
|
|
58729
59106
|
);
|
|
58730
|
-
const typeIndex =
|
|
59107
|
+
const typeIndex = AST12.program(
|
|
58731
59108
|
typePaths.sort((a, b) => a.localeCompare(b)).map((typePath) => {
|
|
58732
|
-
return
|
|
58733
|
-
|
|
59109
|
+
return AST12.exportAllDeclaration(
|
|
59110
|
+
AST12.literal(
|
|
58734
59111
|
"./" + path_exports.relative(path_exports.resolve(config2.typeIndexPath, ".."), typePath).replace(/\.[^/.]+\.[^/.]+$/, "")
|
|
58735
59112
|
),
|
|
58736
59113
|
null
|
|
58737
59114
|
);
|
|
58738
59115
|
}).concat([
|
|
58739
|
-
|
|
58740
|
-
|
|
59116
|
+
AST12.exportAllDeclaration(AST12.literal("./runtime"), null),
|
|
59117
|
+
AST12.exportAllDeclaration(AST12.literal("./graphql"), null)
|
|
58741
59118
|
])
|
|
58742
59119
|
);
|
|
58743
59120
|
const export_default_as = ({ module, as }) => `
|
|
@@ -58746,7 +59123,7 @@ export { default as ${as} } from "${module}"
|
|
|
58746
59123
|
const export_star_from = ({ module }) => `
|
|
58747
59124
|
export * from "${module}"
|
|
58748
59125
|
`;
|
|
58749
|
-
let indexContent =
|
|
59126
|
+
let indexContent = recast12.print(typeIndex).code;
|
|
58750
59127
|
for (const plugin of config2.plugins) {
|
|
58751
59128
|
if (!plugin.index_file) {
|
|
58752
59129
|
continue;
|
|
@@ -58767,6 +59144,7 @@ export * from "${module}"
|
|
|
58767
59144
|
}
|
|
58768
59145
|
}
|
|
58769
59146
|
await fs_exports.writeFile(config2.typeIndexPath, indexContent);
|
|
59147
|
+
await imperativeCacheTypef(config2, docs);
|
|
58770
59148
|
if (missingScalars.size > 0) {
|
|
58771
59149
|
console.warn(`\u26A0\uFE0F Missing definitions for the following scalars: ${[...missingScalars].join(
|
|
58772
59150
|
", "
|
|
@@ -58808,23 +59186,23 @@ async function generateOperationTypeDefs(config2, filepath, body, definition, se
|
|
|
58808
59186
|
const optimisticTypeName = `${definition.name.value}$optimistic`;
|
|
58809
59187
|
const hasInputs = definition.variableDefinitions && definition.variableDefinitions.length > 0;
|
|
58810
59188
|
body.push(
|
|
58811
|
-
|
|
58812
|
-
|
|
58813
|
-
|
|
58814
|
-
|
|
59189
|
+
AST12.exportNamedDeclaration(
|
|
59190
|
+
AST12.tsTypeAliasDeclaration(
|
|
59191
|
+
AST12.identifier(definition.name.value),
|
|
59192
|
+
AST12.tsTypeLiteral([
|
|
58815
59193
|
readonlyProperty(
|
|
58816
|
-
|
|
58817
|
-
|
|
58818
|
-
|
|
59194
|
+
AST12.tsPropertySignature(
|
|
59195
|
+
AST12.stringLiteral("input"),
|
|
59196
|
+
AST12.tsTypeAnnotation(AST12.tsTypeReference(AST12.identifier(inputTypeName)))
|
|
58819
59197
|
)
|
|
58820
59198
|
),
|
|
58821
59199
|
readonlyProperty(
|
|
58822
|
-
|
|
58823
|
-
|
|
58824
|
-
|
|
58825
|
-
definition.operation === "mutation" ?
|
|
58826
|
-
|
|
58827
|
-
|
|
59200
|
+
AST12.tsPropertySignature(
|
|
59201
|
+
AST12.stringLiteral("result"),
|
|
59202
|
+
AST12.tsTypeAnnotation(
|
|
59203
|
+
definition.operation === "mutation" ? AST12.tsTypeReference(AST12.identifier(shapeTypeName)) : AST12.tsUnionType([
|
|
59204
|
+
AST12.tsTypeReference(AST12.identifier(shapeTypeName)),
|
|
59205
|
+
AST12.tsUndefinedKeyword()
|
|
58828
59206
|
])
|
|
58829
59207
|
)
|
|
58830
59208
|
)
|
|
@@ -58832,9 +59210,9 @@ async function generateOperationTypeDefs(config2, filepath, body, definition, se
|
|
|
58832
59210
|
])
|
|
58833
59211
|
)
|
|
58834
59212
|
),
|
|
58835
|
-
|
|
58836
|
-
|
|
58837
|
-
|
|
59213
|
+
AST12.exportNamedDeclaration(
|
|
59214
|
+
AST12.tsTypeAliasDeclaration(
|
|
59215
|
+
AST12.identifier(shapeTypeName),
|
|
58838
59216
|
inlineType({
|
|
58839
59217
|
config: config2,
|
|
58840
59218
|
filepath,
|
|
@@ -58862,15 +59240,15 @@ async function generateOperationTypeDefs(config2, filepath, body, definition, se
|
|
|
58862
59240
|
);
|
|
58863
59241
|
}
|
|
58864
59242
|
body.push(
|
|
58865
|
-
|
|
58866
|
-
|
|
58867
|
-
|
|
58868
|
-
|
|
59243
|
+
AST12.exportNamedDeclaration(
|
|
59244
|
+
AST12.tsTypeAliasDeclaration(
|
|
59245
|
+
AST12.identifier(inputTypeName),
|
|
59246
|
+
AST12.tsTypeLiteral(
|
|
58869
59247
|
(definition.variableDefinitions || []).map(
|
|
58870
59248
|
(definition2) => {
|
|
58871
|
-
return
|
|
58872
|
-
|
|
58873
|
-
|
|
59249
|
+
return AST12.tsPropertySignature(
|
|
59250
|
+
AST12.identifier(definition2.variable.name.value),
|
|
59251
|
+
AST12.tsTypeAnnotation(
|
|
58874
59252
|
tsTypeReference(config2, missingScalars, definition2)
|
|
58875
59253
|
),
|
|
58876
59254
|
definition2.type.kind !== "NonNullType"
|
|
@@ -58883,16 +59261,16 @@ async function generateOperationTypeDefs(config2, filepath, body, definition, se
|
|
|
58883
59261
|
);
|
|
58884
59262
|
} else {
|
|
58885
59263
|
body.push(
|
|
58886
|
-
|
|
58887
|
-
|
|
59264
|
+
AST12.exportNamedDeclaration(
|
|
59265
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(inputTypeName), AST12.tsNullKeyword())
|
|
58888
59266
|
)
|
|
58889
59267
|
);
|
|
58890
59268
|
}
|
|
58891
59269
|
if (definition.operation === "mutation") {
|
|
58892
59270
|
body.push(
|
|
58893
|
-
|
|
58894
|
-
|
|
58895
|
-
|
|
59271
|
+
AST12.exportNamedDeclaration(
|
|
59272
|
+
AST12.tsTypeAliasDeclaration(
|
|
59273
|
+
AST12.identifier(optimisticTypeName),
|
|
58896
59274
|
inlineType({
|
|
58897
59275
|
config: config2,
|
|
58898
59276
|
filepath,
|
|
@@ -58923,28 +59301,28 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
58923
59301
|
throw new Error("Should not get here");
|
|
58924
59302
|
}
|
|
58925
59303
|
body.push(
|
|
58926
|
-
|
|
58927
|
-
|
|
58928
|
-
|
|
58929
|
-
|
|
59304
|
+
AST12.exportNamedDeclaration(
|
|
59305
|
+
AST12.tsTypeAliasDeclaration(
|
|
59306
|
+
AST12.identifier(propTypeName),
|
|
59307
|
+
AST12.tsTypeLiteral([
|
|
58930
59308
|
readonlyProperty(
|
|
58931
|
-
|
|
58932
|
-
|
|
58933
|
-
|
|
58934
|
-
|
|
59309
|
+
AST12.tsPropertySignature(
|
|
59310
|
+
AST12.stringLiteral("shape"),
|
|
59311
|
+
AST12.tsTypeAnnotation(
|
|
59312
|
+
AST12.tsTypeReference(AST12.identifier(shapeTypeName))
|
|
58935
59313
|
),
|
|
58936
59314
|
true
|
|
58937
59315
|
)
|
|
58938
59316
|
),
|
|
58939
59317
|
readonlyProperty(
|
|
58940
|
-
|
|
58941
|
-
|
|
58942
|
-
|
|
58943
|
-
|
|
58944
|
-
|
|
58945
|
-
|
|
58946
|
-
|
|
58947
|
-
|
|
59318
|
+
AST12.tsPropertySignature(
|
|
59319
|
+
AST12.stringLiteral(fragmentKey),
|
|
59320
|
+
AST12.tsTypeAnnotation(
|
|
59321
|
+
AST12.tsTypeLiteral([
|
|
59322
|
+
AST12.tsPropertySignature(
|
|
59323
|
+
AST12.stringLiteral(propTypeName),
|
|
59324
|
+
AST12.tsTypeAnnotation(
|
|
59325
|
+
AST12.tsLiteralType(AST12.booleanLiteral(true))
|
|
58948
59326
|
)
|
|
58949
59327
|
)
|
|
58950
59328
|
])
|
|
@@ -58954,9 +59332,9 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
58954
59332
|
])
|
|
58955
59333
|
)
|
|
58956
59334
|
),
|
|
58957
|
-
|
|
58958
|
-
|
|
58959
|
-
|
|
59335
|
+
AST12.exportNamedDeclaration(
|
|
59336
|
+
AST12.tsTypeAliasDeclaration(
|
|
59337
|
+
AST12.identifier(shapeTypeName),
|
|
58960
59338
|
inlineType({
|
|
58961
59339
|
config: config2,
|
|
58962
59340
|
filepath,
|
|
@@ -58976,7 +59354,7 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
58976
59354
|
}
|
|
58977
59355
|
|
|
58978
59356
|
// src/codegen/generators/persistedQueries/index.ts
|
|
58979
|
-
var
|
|
59357
|
+
var graphql18 = __toESM(require_graphql2(), 1);
|
|
58980
59358
|
async function persistOutputGenerator(config2, docs) {
|
|
58981
59359
|
if (typeof config2.persistedQueryPath !== "string" || config2.persistedQueryPath.length === 0)
|
|
58982
59360
|
return;
|
|
@@ -58988,8 +59366,8 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
58988
59366
|
if (!generateArtifact) {
|
|
58989
59367
|
return acc;
|
|
58990
59368
|
}
|
|
58991
|
-
let rawString =
|
|
58992
|
-
|
|
59369
|
+
let rawString = graphql18.print(
|
|
59370
|
+
graphql18.visit(document, {
|
|
58993
59371
|
Directive(node) {
|
|
58994
59372
|
if (config2.isInternalDirective(node)) {
|
|
58995
59373
|
return null;
|
|
@@ -58998,7 +59376,7 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
58998
59376
|
})
|
|
58999
59377
|
);
|
|
59000
59378
|
const operations = document.definitions.filter(
|
|
59001
|
-
({ kind }) => kind ===
|
|
59379
|
+
({ kind }) => kind === graphql18.Kind.OPERATION_DEFINITION
|
|
59002
59380
|
);
|
|
59003
59381
|
if (operations.length > 0 && operations[0].kind === "OperationDefinition") {
|
|
59004
59382
|
acc[hashDocument(rawString)] = rawString;
|
|
@@ -59011,26 +59389,26 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
59011
59389
|
}
|
|
59012
59390
|
|
|
59013
59391
|
// src/codegen/generators/definitions/enums.ts
|
|
59014
|
-
var
|
|
59015
|
-
var
|
|
59016
|
-
var
|
|
59392
|
+
var graphql19 = __toESM(require_graphql2(), 1);
|
|
59393
|
+
var recast13 = __toESM(require_main2(), 1);
|
|
59394
|
+
var AST13 = recast13.types.builders;
|
|
59017
59395
|
async function definitionsGenerator(config2) {
|
|
59018
|
-
const enums =
|
|
59396
|
+
const enums = graphql19.parse(graphql19.printSchema(config2.schema)).definitions.filter(
|
|
59019
59397
|
(definition) => definition.kind === "EnumTypeDefinition"
|
|
59020
59398
|
).filter((def) => !config2.isInternalEnum(def));
|
|
59021
|
-
const runtimeDefinitions =
|
|
59022
|
-
|
|
59399
|
+
const runtimeDefinitions = recast13.print(
|
|
59400
|
+
AST13.program(
|
|
59023
59401
|
enums.map((defn) => {
|
|
59024
59402
|
const name2 = defn.name.value;
|
|
59025
59403
|
return moduleExport(
|
|
59026
59404
|
config2,
|
|
59027
59405
|
name2,
|
|
59028
|
-
|
|
59406
|
+
AST13.objectExpression(
|
|
59029
59407
|
defn.values?.map((value) => {
|
|
59030
59408
|
const str = value.name.value;
|
|
59031
|
-
return
|
|
59032
|
-
|
|
59033
|
-
|
|
59409
|
+
return AST13.objectProperty(
|
|
59410
|
+
AST13.stringLiteral(str),
|
|
59411
|
+
AST13.stringLiteral(str)
|
|
59034
59412
|
);
|
|
59035
59413
|
}) || []
|
|
59036
59414
|
)
|
|
@@ -59038,7 +59416,7 @@ async function definitionsGenerator(config2) {
|
|
|
59038
59416
|
})
|
|
59039
59417
|
)
|
|
59040
59418
|
).code;
|
|
59041
|
-
const
|
|
59419
|
+
const typeDefinitions2 = enums.sort((a, b) => a.name.value.localeCompare(b.name.value)).map(
|
|
59042
59420
|
(definition) => `
|
|
59043
59421
|
export declare enum ${definition.name.value} {
|
|
59044
59422
|
${definition.values?.map((value) => ` ${value.name.value} = "${value.name.value}"`).join(",\n")}
|
|
@@ -59049,7 +59427,7 @@ ${definition.values?.map((value) => ` ${value.name.value} = "${value.name.val
|
|
|
59049
59427
|
export * from './enums.js'
|
|
59050
59428
|
`;
|
|
59051
59429
|
await Promise.all([
|
|
59052
|
-
fs_exports.writeFile(config2.enumTypesDefinitionsPath,
|
|
59430
|
+
fs_exports.writeFile(config2.enumTypesDefinitionsPath, typeDefinitions2),
|
|
59053
59431
|
fs_exports.writeFile(config2.enumRuntimeDefinitionsPath, runtimeDefinitions),
|
|
59054
59432
|
fs_exports.writeFile(path_exports.join(config2.definitionsDirectory, "index.js"), definitionsIndex),
|
|
59055
59433
|
fs_exports.writeFile(path_exports.join(config2.definitionsDirectory, "index.d.ts"), definitionsIndex)
|
|
@@ -59188,7 +59566,7 @@ function flattenFragments(filepath, operation, fragments) {
|
|
|
59188
59566
|
}
|
|
59189
59567
|
|
|
59190
59568
|
// src/codegen/transforms/schema.ts
|
|
59191
|
-
var
|
|
59569
|
+
var graphql21 = __toESM(require_graphql2(), 1);
|
|
59192
59570
|
async function graphqlExtensions(config2, documents) {
|
|
59193
59571
|
const internalSchema = `
|
|
59194
59572
|
enum CachePolicy {
|
|
@@ -59266,19 +59644,19 @@ directive @${config2.maskEnableDirective} on FRAGMENT_SPREAD
|
|
|
59266
59644
|
"""
|
|
59267
59645
|
directive @${config2.maskDisableDirective} on FRAGMENT_SPREAD
|
|
59268
59646
|
`;
|
|
59269
|
-
let currentSchema =
|
|
59647
|
+
let currentSchema = graphql21.printSchema(config2.schema);
|
|
59270
59648
|
if (!currentSchema.includes(`directive @${config2.listDirective}`)) {
|
|
59271
59649
|
currentSchema += internalSchema;
|
|
59272
59650
|
}
|
|
59273
59651
|
config2.newSchema += internalSchema;
|
|
59274
|
-
config2.schema =
|
|
59652
|
+
config2.schema = graphql21.buildSchema(currentSchema);
|
|
59275
59653
|
}
|
|
59276
59654
|
|
|
59277
59655
|
// src/codegen/transforms/typename.ts
|
|
59278
|
-
var
|
|
59656
|
+
var graphql22 = __toESM(require_graphql2(), 1);
|
|
59279
59657
|
async function addTypename(config2, documents) {
|
|
59280
59658
|
for (const doc of documents) {
|
|
59281
|
-
doc.document =
|
|
59659
|
+
doc.document = graphql22.visit(doc.document, {
|
|
59282
59660
|
Field(node, key, parent, path2, ancestors) {
|
|
59283
59661
|
if (!node.selectionSet) {
|
|
59284
59662
|
return;
|
|
@@ -59290,7 +59668,7 @@ async function addTypename(config2, documents) {
|
|
|
59290
59668
|
);
|
|
59291
59669
|
const field = type.getFields()[node.name.value];
|
|
59292
59670
|
const fieldType = unwrapType(config2, field.type).type;
|
|
59293
|
-
if (
|
|
59671
|
+
if (graphql22.isInterfaceType(fieldType) || graphql22.isUnionType(fieldType)) {
|
|
59294
59672
|
return {
|
|
59295
59673
|
...node,
|
|
59296
59674
|
selectionSet: {
|
|
@@ -59298,9 +59676,9 @@ async function addTypename(config2, documents) {
|
|
|
59298
59676
|
selections: [
|
|
59299
59677
|
...node.selectionSet.selections,
|
|
59300
59678
|
{
|
|
59301
|
-
kind:
|
|
59679
|
+
kind: graphql22.Kind.FIELD,
|
|
59302
59680
|
name: {
|
|
59303
|
-
kind:
|
|
59681
|
+
kind: graphql22.Kind.NAME,
|
|
59304
59682
|
value: "__typename"
|
|
59305
59683
|
}
|
|
59306
59684
|
}
|
|
@@ -59314,10 +59692,10 @@ async function addTypename(config2, documents) {
|
|
|
59314
59692
|
}
|
|
59315
59693
|
|
|
59316
59694
|
// src/codegen/transforms/addID.ts
|
|
59317
|
-
var
|
|
59695
|
+
var graphql23 = __toESM(require_graphql2(), 1);
|
|
59318
59696
|
async function addID(config2, documents) {
|
|
59319
59697
|
for (const doc of documents) {
|
|
59320
|
-
doc.document =
|
|
59698
|
+
doc.document = graphql23.visit(doc.document, {
|
|
59321
59699
|
Field(node, key, parent, path2, ancestors) {
|
|
59322
59700
|
if (!node.selectionSet) {
|
|
59323
59701
|
return;
|
|
@@ -59330,7 +59708,7 @@ async function addID(config2, documents) {
|
|
|
59330
59708
|
const field = type.getFields()[node.name.value];
|
|
59331
59709
|
const fieldType = unwrapType(config2, field.type).type;
|
|
59332
59710
|
if (node.selectionSet?.selections.length > 0) {
|
|
59333
|
-
if (!
|
|
59711
|
+
if (!graphql23.isObjectType(fieldType) && !graphql23.isInterfaceType(fieldType)) {
|
|
59334
59712
|
return;
|
|
59335
59713
|
}
|
|
59336
59714
|
const keyFields = config2.keyFieldsForType(fieldType.name);
|
|
@@ -59345,9 +59723,9 @@ async function addID(config2, documents) {
|
|
|
59345
59723
|
continue;
|
|
59346
59724
|
}
|
|
59347
59725
|
selections.push({
|
|
59348
|
-
kind:
|
|
59726
|
+
kind: graphql23.Kind.FIELD,
|
|
59349
59727
|
name: {
|
|
59350
|
-
kind:
|
|
59728
|
+
kind: graphql23.Kind.NAME,
|
|
59351
59729
|
value: keyField
|
|
59352
59730
|
}
|
|
59353
59731
|
});
|
|
@@ -59366,8 +59744,8 @@ async function addID(config2, documents) {
|
|
|
59366
59744
|
}
|
|
59367
59745
|
|
|
59368
59746
|
// src/codegen/transforms/fragmentVariables.ts
|
|
59369
|
-
var
|
|
59370
|
-
var GraphqlKinds2 =
|
|
59747
|
+
var graphql24 = __toESM(require_graphql2(), 1);
|
|
59748
|
+
var GraphqlKinds2 = graphql24.Kind;
|
|
59371
59749
|
async function fragmentVariables(config2, documents) {
|
|
59372
59750
|
const fragments = collectFragments(config2, documents);
|
|
59373
59751
|
const generatedFragments = {};
|
|
@@ -59390,7 +59768,7 @@ async function fragmentVariables(config2, documents) {
|
|
|
59390
59768
|
});
|
|
59391
59769
|
}
|
|
59392
59770
|
const doc = {
|
|
59393
|
-
kind:
|
|
59771
|
+
kind: graphql24.Kind.DOCUMENT,
|
|
59394
59772
|
definitions: Object.values(generatedFragments)
|
|
59395
59773
|
};
|
|
59396
59774
|
documents.push({
|
|
@@ -59426,7 +59804,7 @@ function inlineFragmentArgs({
|
|
|
59426
59804
|
filepath,
|
|
59427
59805
|
document
|
|
59428
59806
|
).reduce((acc, arg) => ({ ...acc, [arg.name]: arg }), {});
|
|
59429
|
-
const result =
|
|
59807
|
+
const result = graphql24.visit(document, {
|
|
59430
59808
|
FragmentSpread(node) {
|
|
59431
59809
|
const { definition } = fragmentDefinitions[node.name.value];
|
|
59432
59810
|
let { args, hash } = collectWithArguments(config2, filepath, node, scope);
|
|
@@ -59514,7 +59892,7 @@ function inlineFragmentArgs({
|
|
|
59514
59892
|
});
|
|
59515
59893
|
if (newName) {
|
|
59516
59894
|
result.name = {
|
|
59517
|
-
kind:
|
|
59895
|
+
kind: graphql24.Kind.NAME,
|
|
59518
59896
|
value: newName
|
|
59519
59897
|
};
|
|
59520
59898
|
}
|
|
@@ -59626,7 +60004,7 @@ function operationScope(operation) {
|
|
|
59626
60004
|
}
|
|
59627
60005
|
|
|
59628
60006
|
// src/codegen/validators/typeCheck.ts
|
|
59629
|
-
var
|
|
60007
|
+
var graphql25 = __toESM(require_graphql2(), 1);
|
|
59630
60008
|
async function typeCheck(config2, docs) {
|
|
59631
60009
|
const errors = [];
|
|
59632
60010
|
const freeLists = [];
|
|
@@ -59634,11 +60012,11 @@ async function typeCheck(config2, docs) {
|
|
|
59634
60012
|
const listTypes = [];
|
|
59635
60013
|
const fragments = {};
|
|
59636
60014
|
for (const { document: parsed, filename } of docs) {
|
|
59637
|
-
|
|
59638
|
-
[
|
|
60015
|
+
graphql25.visit(parsed, {
|
|
60016
|
+
[graphql25.Kind.FRAGMENT_DEFINITION](definition) {
|
|
59639
60017
|
fragments[definition.name.value] = definition;
|
|
59640
60018
|
},
|
|
59641
|
-
[
|
|
60019
|
+
[graphql25.Kind.DIRECTIVE](directive, _, parent, __, ancestors) {
|
|
59642
60020
|
if (![config2.listDirective, config2.paginateDirective].includes(directive.name.value)) {
|
|
59643
60021
|
return;
|
|
59644
60022
|
}
|
|
@@ -59684,14 +60062,14 @@ async function typeCheck(config2, docs) {
|
|
|
59684
60062
|
);
|
|
59685
60063
|
return;
|
|
59686
60064
|
}
|
|
59687
|
-
if (
|
|
60065
|
+
if (graphql25.isListType(rootType) || graphql25.isNonNullType(rootType) && graphql25.isListType(rootType.ofType)) {
|
|
59688
60066
|
needsParent = true;
|
|
59689
60067
|
break;
|
|
59690
60068
|
}
|
|
59691
|
-
if (
|
|
60069
|
+
if (graphql25.isNonNullType(rootType) && "ofType" in rootType) {
|
|
59692
60070
|
rootType = rootType.ofType;
|
|
59693
60071
|
}
|
|
59694
|
-
if (
|
|
60072
|
+
if (graphql25.isScalarType(rootType)) {
|
|
59695
60073
|
break;
|
|
59696
60074
|
}
|
|
59697
60075
|
rootType = rootType?.getFields()[parent2.name.value]?.type;
|
|
@@ -59767,9 +60145,9 @@ async function typeCheck(config2, docs) {
|
|
|
59767
60145
|
);
|
|
59768
60146
|
}
|
|
59769
60147
|
let targetTypes = [type];
|
|
59770
|
-
if (
|
|
60148
|
+
if (graphql25.isUnionType(type)) {
|
|
59771
60149
|
targetTypes = config2.schema.getPossibleTypes(type);
|
|
59772
|
-
} else if (
|
|
60150
|
+
} else if (graphql25.isInterfaceType(type)) {
|
|
59773
60151
|
try {
|
|
59774
60152
|
for (const key of config2.keyFieldsForType(type.name)) {
|
|
59775
60153
|
if (!type.getFields()[key]) {
|
|
@@ -59807,13 +60185,13 @@ async function typeCheck(config2, docs) {
|
|
|
59807
60185
|
if (errors.length > 0) {
|
|
59808
60186
|
throw errors;
|
|
59809
60187
|
}
|
|
59810
|
-
const rules = (filepath) => [...
|
|
60188
|
+
const rules = (filepath) => [...graphql25.specifiedRules].filter(
|
|
59811
60189
|
(rule) => ![
|
|
59812
|
-
|
|
59813
|
-
|
|
59814
|
-
|
|
59815
|
-
|
|
59816
|
-
|
|
60190
|
+
graphql25.NoUnusedFragmentsRule,
|
|
60191
|
+
graphql25.KnownFragmentNamesRule,
|
|
60192
|
+
graphql25.ExecutableDefinitionsRule,
|
|
60193
|
+
graphql25.KnownDirectivesRule,
|
|
60194
|
+
graphql25.KnownArgumentNamesRule
|
|
59817
60195
|
].includes(rule)
|
|
59818
60196
|
).concat(
|
|
59819
60197
|
validateLists({
|
|
@@ -59832,7 +60210,7 @@ async function typeCheck(config2, docs) {
|
|
|
59832
60210
|
noUnusedFragmentArguments(config2)
|
|
59833
60211
|
);
|
|
59834
60212
|
for (const { filename, document: parsed } of docs) {
|
|
59835
|
-
for (const error of
|
|
60213
|
+
for (const error of graphql25.validate(config2.schema, parsed, rules(filename))) {
|
|
59836
60214
|
errors.push(
|
|
59837
60215
|
new HoudiniError({
|
|
59838
60216
|
filepath: filename,
|
|
@@ -59858,7 +60236,7 @@ var validateLists = ({
|
|
|
59858
60236
|
if (!config2.isListFragment(node.name.value)) {
|
|
59859
60237
|
if (!fragments[node.name.value]) {
|
|
59860
60238
|
ctx.reportError(
|
|
59861
|
-
new
|
|
60239
|
+
new graphql25.GraphQLError(
|
|
59862
60240
|
"Encountered unknown fragment: " + node.name.value
|
|
59863
60241
|
)
|
|
59864
60242
|
);
|
|
@@ -59868,7 +60246,7 @@ var validateLists = ({
|
|
|
59868
60246
|
const listName = config2.listNameFromFragment(node.name.value);
|
|
59869
60247
|
if (!lists.includes(listName)) {
|
|
59870
60248
|
ctx.reportError(
|
|
59871
|
-
new
|
|
60249
|
+
new graphql25.GraphQLError(
|
|
59872
60250
|
"Encountered fragment referencing unknown list: " + listName
|
|
59873
60251
|
)
|
|
59874
60252
|
);
|
|
@@ -59893,7 +60271,7 @@ var validateLists = ({
|
|
|
59893
60271
|
);
|
|
59894
60272
|
if (parentArg) {
|
|
59895
60273
|
ctx.reportError(
|
|
59896
|
-
new
|
|
60274
|
+
new graphql25.GraphQLError(
|
|
59897
60275
|
`@${config2.deprecatedlistDirectiveParentIDArg} should be defined only in it's own directive now`
|
|
59898
60276
|
)
|
|
59899
60277
|
);
|
|
@@ -59909,7 +60287,7 @@ var validateLists = ({
|
|
|
59909
60287
|
return;
|
|
59910
60288
|
}
|
|
59911
60289
|
ctx.reportError(
|
|
59912
|
-
new
|
|
60290
|
+
new graphql25.GraphQLError(
|
|
59913
60291
|
`For this list fragment, you need to add or @${config2.listParentDirective} or @${config2.listAllListsDirective} directive to specify the behavior`
|
|
59914
60292
|
)
|
|
59915
60293
|
);
|
|
@@ -59919,7 +60297,7 @@ var validateLists = ({
|
|
|
59919
60297
|
const directiveName = node.name.value;
|
|
59920
60298
|
if (directiveName === "connection") {
|
|
59921
60299
|
ctx.reportError(
|
|
59922
|
-
new
|
|
60300
|
+
new graphql25.GraphQLError(
|
|
59923
60301
|
"@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."
|
|
59924
60302
|
)
|
|
59925
60303
|
);
|
|
@@ -59928,7 +60306,7 @@ var validateLists = ({
|
|
|
59928
60306
|
if (!config2.isInternalDirective(node)) {
|
|
59929
60307
|
if (!config2.schema.getDirective(directiveName)) {
|
|
59930
60308
|
ctx.reportError(
|
|
59931
|
-
new
|
|
60309
|
+
new graphql25.GraphQLError(
|
|
59932
60310
|
"Encountered unknown directive: " + directiveName
|
|
59933
60311
|
)
|
|
59934
60312
|
);
|
|
@@ -59937,7 +60315,7 @@ var validateLists = ({
|
|
|
59937
60315
|
}
|
|
59938
60316
|
if (config2.isListOperationDirective(directiveName) && !listTypes.includes(config2.listNameFromDirective(directiveName))) {
|
|
59939
60317
|
ctx.reportError(
|
|
59940
|
-
new
|
|
60318
|
+
new graphql25.GraphQLError(
|
|
59941
60319
|
"Encountered directive referencing unknown list: " + directiveName
|
|
59942
60320
|
)
|
|
59943
60321
|
);
|
|
@@ -59948,7 +60326,7 @@ var validateLists = ({
|
|
|
59948
60326
|
};
|
|
59949
60327
|
function knownArguments(config2) {
|
|
59950
60328
|
return function(ctx) {
|
|
59951
|
-
const nativeValidator =
|
|
60329
|
+
const nativeValidator = graphql25.KnownArgumentNamesRule(ctx);
|
|
59952
60330
|
return {
|
|
59953
60331
|
...nativeValidator,
|
|
59954
60332
|
Directive(directiveNode) {
|
|
@@ -59981,7 +60359,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
59981
60359
|
for (const arg of node.arguments || []) {
|
|
59982
60360
|
if (arg.value.kind !== "ObjectValue") {
|
|
59983
60361
|
ctx.reportError(
|
|
59984
|
-
new
|
|
60362
|
+
new graphql25.GraphQLError("values in @arguments must be an object")
|
|
59985
60363
|
);
|
|
59986
60364
|
return;
|
|
59987
60365
|
}
|
|
@@ -59991,13 +60369,13 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
59991
60369
|
);
|
|
59992
60370
|
if (!typeArg) {
|
|
59993
60371
|
ctx.reportError(
|
|
59994
|
-
new
|
|
60372
|
+
new graphql25.GraphQLError("missing type field for @arguments directive")
|
|
59995
60373
|
);
|
|
59996
60374
|
return;
|
|
59997
60375
|
}
|
|
59998
|
-
if (typeArg.value.kind !==
|
|
60376
|
+
if (typeArg.value.kind !== graphql25.Kind.STRING) {
|
|
59999
60377
|
ctx.reportError(
|
|
60000
|
-
new
|
|
60378
|
+
new graphql25.GraphQLError("type field to @arguments must be a string")
|
|
60001
60379
|
);
|
|
60002
60380
|
return;
|
|
60003
60381
|
}
|
|
@@ -60010,7 +60388,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60010
60388
|
);
|
|
60011
60389
|
if (typeArg.value.value !== defaultValueType) {
|
|
60012
60390
|
ctx.reportError(
|
|
60013
|
-
new
|
|
60391
|
+
new graphql25.GraphQLError(
|
|
60014
60392
|
`Invalid default value provided for ${arg.name.value}. Expected ${typeArg.value.value}, found ${defaultValueType}`
|
|
60015
60393
|
)
|
|
60016
60394
|
);
|
|
@@ -60028,7 +60406,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60028
60406
|
try {
|
|
60029
60407
|
args = fragmentArguments(config2, filepath, fragments[fragmentName]);
|
|
60030
60408
|
} catch (e) {
|
|
60031
|
-
ctx.reportError(new
|
|
60409
|
+
ctx.reportError(new graphql25.GraphQLError(e.message));
|
|
60032
60410
|
return;
|
|
60033
60411
|
}
|
|
60034
60412
|
fragmentArguments2[fragmentName] = args;
|
|
@@ -60051,7 +60429,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60051
60429
|
);
|
|
60052
60430
|
if (missing.length > 0) {
|
|
60053
60431
|
ctx.reportError(
|
|
60054
|
-
new
|
|
60432
|
+
new graphql25.GraphQLError(
|
|
60055
60433
|
"The following arguments are missing from this fragment: " + JSON.stringify(missing)
|
|
60056
60434
|
)
|
|
60057
60435
|
);
|
|
@@ -60062,7 +60440,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60062
60440
|
);
|
|
60063
60441
|
if (unknown.length > 0) {
|
|
60064
60442
|
ctx.reportError(
|
|
60065
|
-
new
|
|
60443
|
+
new graphql25.GraphQLError(
|
|
60066
60444
|
"Encountered unknown arguments: " + JSON.stringify(unknown)
|
|
60067
60445
|
)
|
|
60068
60446
|
);
|
|
@@ -60074,7 +60452,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60074
60452
|
]
|
|
60075
60453
|
);
|
|
60076
60454
|
for (const [applied, target] of zipped) {
|
|
60077
|
-
if (applied.value.kind ===
|
|
60455
|
+
if (applied.value.kind === graphql25.Kind.VARIABLE || applied.value.kind === graphql25.Kind.LIST || applied.value.kind === graphql25.Kind.OBJECT) {
|
|
60078
60456
|
continue;
|
|
60079
60457
|
}
|
|
60080
60458
|
const appliedType = applied.value.kind.substring(
|
|
@@ -60083,7 +60461,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
60083
60461
|
);
|
|
60084
60462
|
if (appliedType !== target) {
|
|
60085
60463
|
ctx.reportError(
|
|
60086
|
-
new
|
|
60464
|
+
new graphql25.GraphQLError(
|
|
60087
60465
|
`Invalid argument type. Expected ${target}, found ${appliedType}`
|
|
60088
60466
|
)
|
|
60089
60467
|
);
|
|
@@ -60104,7 +60482,7 @@ function paginateArgs(config2, filepath) {
|
|
|
60104
60482
|
}
|
|
60105
60483
|
if (alreadyPaginated) {
|
|
60106
60484
|
ctx.reportError(
|
|
60107
|
-
new
|
|
60485
|
+
new graphql25.GraphQLError(
|
|
60108
60486
|
`@${config2.paginateDirective} can only appear in a document once.`
|
|
60109
60487
|
)
|
|
60110
60488
|
);
|
|
@@ -60119,7 +60497,7 @@ function paginateArgs(config2, filepath) {
|
|
|
60119
60497
|
const hasRequiredArgs = definitionArgs.find((arg) => arg.required);
|
|
60120
60498
|
if (hasRequiredArgs) {
|
|
60121
60499
|
ctx.reportError(
|
|
60122
|
-
new
|
|
60500
|
+
new graphql25.GraphQLError(
|
|
60123
60501
|
"@paginate cannot appear on a document with required args"
|
|
60124
60502
|
)
|
|
60125
60503
|
);
|
|
@@ -60151,14 +60529,14 @@ function paginateArgs(config2, filepath) {
|
|
|
60151
60529
|
const backwards = appliedArgs.has("last");
|
|
60152
60530
|
if (!forward && !backwards) {
|
|
60153
60531
|
ctx.reportError(
|
|
60154
|
-
new
|
|
60532
|
+
new graphql25.GraphQLError(
|
|
60155
60533
|
"A field with cursor-based pagination must have a first or last argument"
|
|
60156
60534
|
)
|
|
60157
60535
|
);
|
|
60158
60536
|
}
|
|
60159
60537
|
if (forward && backwards) {
|
|
60160
60538
|
ctx.reportError(
|
|
60161
|
-
new
|
|
60539
|
+
new graphql25.GraphQLError(
|
|
60162
60540
|
`A field with cursor pagination cannot go forwards an backwards simultaneously`
|
|
60163
60541
|
)
|
|
60164
60542
|
);
|
|
@@ -60172,7 +60550,7 @@ function paginateArgs(config2, filepath) {
|
|
|
60172
60550
|
);
|
|
60173
60551
|
if (!appliedLimitArg) {
|
|
60174
60552
|
ctx.reportError(
|
|
60175
|
-
new
|
|
60553
|
+
new graphql25.GraphQLError(
|
|
60176
60554
|
"A field with offset-based pagination must have a limit argument"
|
|
60177
60555
|
)
|
|
60178
60556
|
);
|
|
@@ -60188,20 +60566,20 @@ function noUnusedFragmentArguments(config2) {
|
|
|
60188
60566
|
const args = /* @__PURE__ */ new Set();
|
|
60189
60567
|
return {
|
|
60190
60568
|
enter(node) {
|
|
60191
|
-
if (node.kind ===
|
|
60569
|
+
if (node.kind === graphql25.Kind.FRAGMENT_DEFINITION) {
|
|
60192
60570
|
const definitionArguments = node.directives?.filter((directive) => directive.name.value === config2.argumentsDirective).flatMap((directive) => directive.arguments);
|
|
60193
60571
|
for (const arg of definitionArguments?.map((arg2) => arg2?.name.value) || []) {
|
|
60194
60572
|
args.add(arg);
|
|
60195
60573
|
}
|
|
60196
|
-
} else if (node.kind ===
|
|
60574
|
+
} else if (node.kind === graphql25.Kind.VARIABLE) {
|
|
60197
60575
|
args.delete(node.name.value);
|
|
60198
60576
|
}
|
|
60199
60577
|
},
|
|
60200
60578
|
leave(node) {
|
|
60201
|
-
if (node.kind ===
|
|
60579
|
+
if (node.kind === graphql25.Kind.FRAGMENT_DEFINITION) {
|
|
60202
60580
|
if (args.size > 0) {
|
|
60203
60581
|
ctx.reportError(
|
|
60204
|
-
new
|
|
60582
|
+
new graphql25.GraphQLError(
|
|
60205
60583
|
"Encountered unused fragment arguments: " + [...args].join(",")
|
|
60206
60584
|
)
|
|
60207
60585
|
);
|
|
@@ -60237,7 +60615,7 @@ function nodeDirectives(config2, directives) {
|
|
|
60237
60615
|
if (definition.kind === "OperationDefinition") {
|
|
60238
60616
|
if (definition.operation !== "query") {
|
|
60239
60617
|
ctx.reportError(
|
|
60240
|
-
new
|
|
60618
|
+
new graphql25.GraphQLError(
|
|
60241
60619
|
`@${node.name.value} must fall on a fragment or query document`
|
|
60242
60620
|
)
|
|
60243
60621
|
);
|
|
@@ -60249,7 +60627,7 @@ function nodeDirectives(config2, directives) {
|
|
|
60249
60627
|
}
|
|
60250
60628
|
if (!possibleNodes.includes(definitionType)) {
|
|
60251
60629
|
ctx.reportError(
|
|
60252
|
-
new
|
|
60630
|
+
new graphql25.GraphQLError(paginateOnNonNodeMessage(config2, node.name.value))
|
|
60253
60631
|
);
|
|
60254
60632
|
}
|
|
60255
60633
|
}
|
|
@@ -60268,7 +60646,7 @@ function checkMutationOperation(config2) {
|
|
|
60268
60646
|
);
|
|
60269
60647
|
if (append && prepend) {
|
|
60270
60648
|
ctx.reportError(
|
|
60271
|
-
new
|
|
60649
|
+
new graphql25.GraphQLError(
|
|
60272
60650
|
`You can't apply both @${config2.listPrependDirective} and @${config2.listAppendDirective} at the same time`
|
|
60273
60651
|
)
|
|
60274
60652
|
);
|
|
@@ -60282,7 +60660,7 @@ function checkMutationOperation(config2) {
|
|
|
60282
60660
|
);
|
|
60283
60661
|
if (parentId && allLists) {
|
|
60284
60662
|
ctx.reportError(
|
|
60285
|
-
new
|
|
60663
|
+
new graphql25.GraphQLError(
|
|
60286
60664
|
`You can't apply both @${config2.listParentDirective} and @${config2.listAllListsDirective} at the same time`
|
|
60287
60665
|
)
|
|
60288
60666
|
);
|
|
@@ -60304,7 +60682,7 @@ function checkMaskDirective(config2) {
|
|
|
60304
60682
|
);
|
|
60305
60683
|
if (maskEnableDirective && maskDisableDirective) {
|
|
60306
60684
|
ctx.reportError(
|
|
60307
|
-
new
|
|
60685
|
+
new graphql25.GraphQLError(
|
|
60308
60686
|
`You can't apply both @${config2.maskEnableDirective} and @${config2.maskDisableDirective} at the same time`
|
|
60309
60687
|
)
|
|
60310
60688
|
);
|
|
@@ -60320,7 +60698,7 @@ function getAndVerifyNodeInterface(config2) {
|
|
|
60320
60698
|
if (!nodeInterface) {
|
|
60321
60699
|
return null;
|
|
60322
60700
|
}
|
|
60323
|
-
if (!
|
|
60701
|
+
if (!graphql25.isInterfaceType(nodeInterface)) {
|
|
60324
60702
|
displayInvalidNodeFieldMessage(config2.logLevel);
|
|
60325
60703
|
return null;
|
|
60326
60704
|
}
|
|
@@ -60418,11 +60796,11 @@ async function uniqueDocumentNames(config2, docs) {
|
|
|
60418
60796
|
}
|
|
60419
60797
|
|
|
60420
60798
|
// src/codegen/validators/noIDAlias.ts
|
|
60421
|
-
var
|
|
60799
|
+
var graphql26 = __toESM(require_graphql2(), 1);
|
|
60422
60800
|
async function noIDAlias(config2, docs) {
|
|
60423
60801
|
const errors = [];
|
|
60424
60802
|
for (const { filename, document } of docs) {
|
|
60425
|
-
|
|
60803
|
+
graphql26.visit(document, {
|
|
60426
60804
|
Field(node, _, __, ___, ancestors) {
|
|
60427
60805
|
const fieldType = parentTypeFromAncestors(config2.schema, filename, ancestors).name;
|
|
60428
60806
|
if (config2.keyFieldsForType(fieldType).includes(node.alias?.value || "")) {
|
|
@@ -60564,8 +60942,8 @@ async function collectDocuments(config2) {
|
|
|
60564
60942
|
}
|
|
60565
60943
|
}
|
|
60566
60944
|
}
|
|
60567
|
-
const graphql_extractor = (filepath, content) => [content];
|
|
60568
|
-
const javascript_extractor = (
|
|
60945
|
+
const graphql_extractor = (config3, filepath, content) => [content];
|
|
60946
|
+
const javascript_extractor = (fconfig, ilepath, content) => processJSFile(config2, content);
|
|
60569
60947
|
extractors[".ts"].push(javascript_extractor);
|
|
60570
60948
|
extractors[".js"].push(javascript_extractor);
|
|
60571
60949
|
extractors[".graphql"].push(graphql_extractor);
|
|
@@ -60589,7 +60967,7 @@ async function collectDocuments(config2) {
|
|
|
60589
60967
|
if (!extractor) {
|
|
60590
60968
|
continue;
|
|
60591
60969
|
}
|
|
60592
|
-
const found = await extractor(filepath, contents);
|
|
60970
|
+
const found = await extractor(config2, filepath, contents);
|
|
60593
60971
|
if (found.length > 0) {
|
|
60594
60972
|
documents.push(...found.map((document) => ({ filepath, document })));
|
|
60595
60973
|
}
|
|
@@ -60620,12 +60998,12 @@ async function processJSFile(config2, contents) {
|
|
|
60620
60998
|
return documents;
|
|
60621
60999
|
}
|
|
60622
61000
|
async function processGraphQLDocument(config2, filepath, document) {
|
|
60623
|
-
const parsedDoc =
|
|
61001
|
+
const parsedDoc = graphql27.parse(document);
|
|
60624
61002
|
const operations = parsedDoc.definitions.filter(
|
|
60625
|
-
({ kind: kind2 }) => kind2 ===
|
|
61003
|
+
({ kind: kind2 }) => kind2 === graphql27.Kind.OPERATION_DEFINITION
|
|
60626
61004
|
);
|
|
60627
61005
|
const fragments = parsedDoc.definitions.filter(
|
|
60628
|
-
({ kind: kind2 }) => kind2 ===
|
|
61006
|
+
({ kind: kind2 }) => kind2 === graphql27.Kind.FRAGMENT_DEFINITION
|
|
60629
61007
|
);
|
|
60630
61008
|
if (operations.length > 1) {
|
|
60631
61009
|
throw new HoudiniError({
|