houdini 0.18.3 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cmd-cjs/index.js +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
package/build/cmd-esm/index.js
CHANGED
|
@@ -3731,12 +3731,12 @@ var require_parser = __commonJS({
|
|
|
3731
3731
|
return [];
|
|
3732
3732
|
}
|
|
3733
3733
|
if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {
|
|
3734
|
-
var
|
|
3734
|
+
var types16 = [];
|
|
3735
3735
|
this.expectOptionalToken(_tokenKind.TokenKind.AMP);
|
|
3736
3736
|
do {
|
|
3737
|
-
|
|
3737
|
+
types16.push(this.parseNamedType());
|
|
3738
3738
|
} while (this.expectOptionalToken(_tokenKind.TokenKind.AMP) || this.peek(_tokenKind.TokenKind.NAME));
|
|
3739
|
-
return
|
|
3739
|
+
return types16;
|
|
3740
3740
|
}
|
|
3741
3741
|
return this.delimitedMany(_tokenKind.TokenKind.AMP, this.parseNamedType);
|
|
3742
3742
|
};
|
|
@@ -3815,13 +3815,13 @@ var require_parser = __commonJS({
|
|
|
3815
3815
|
this.expectKeyword("union");
|
|
3816
3816
|
var name2 = this.parseName();
|
|
3817
3817
|
var directives = this.parseDirectives(true);
|
|
3818
|
-
var
|
|
3818
|
+
var types16 = this.parseUnionMemberTypes();
|
|
3819
3819
|
return {
|
|
3820
3820
|
kind: _kinds.Kind.UNION_TYPE_DEFINITION,
|
|
3821
3821
|
description,
|
|
3822
3822
|
name: name2,
|
|
3823
3823
|
directives,
|
|
3824
|
-
types:
|
|
3824
|
+
types: types16,
|
|
3825
3825
|
loc: this.loc(start)
|
|
3826
3826
|
};
|
|
3827
3827
|
};
|
|
@@ -3979,15 +3979,15 @@ var require_parser = __commonJS({
|
|
|
3979
3979
|
this.expectKeyword("union");
|
|
3980
3980
|
var name2 = this.parseName();
|
|
3981
3981
|
var directives = this.parseDirectives(true);
|
|
3982
|
-
var
|
|
3983
|
-
if (directives.length === 0 &&
|
|
3982
|
+
var types16 = this.parseUnionMemberTypes();
|
|
3983
|
+
if (directives.length === 0 && types16.length === 0) {
|
|
3984
3984
|
throw this.unexpected();
|
|
3985
3985
|
}
|
|
3986
3986
|
return {
|
|
3987
3987
|
kind: _kinds.Kind.UNION_TYPE_EXTENSION,
|
|
3988
3988
|
name: name2,
|
|
3989
3989
|
directives,
|
|
3990
|
-
types:
|
|
3990
|
+
types: types16,
|
|
3991
3991
|
loc: this.loc(start)
|
|
3992
3992
|
};
|
|
3993
3993
|
};
|
|
@@ -4157,7 +4157,7 @@ var require_visitor = __commonJS({
|
|
|
4157
4157
|
Object.defineProperty(exports, "__esModule", {
|
|
4158
4158
|
value: true
|
|
4159
4159
|
});
|
|
4160
|
-
exports.visit =
|
|
4160
|
+
exports.visit = visit13;
|
|
4161
4161
|
exports.visitInParallel = visitInParallel;
|
|
4162
4162
|
exports.getVisitFn = getVisitFn;
|
|
4163
4163
|
exports.BREAK = exports.QueryDocumentKeys = void 0;
|
|
@@ -4220,7 +4220,7 @@ var require_visitor = __commonJS({
|
|
|
4220
4220
|
exports.QueryDocumentKeys = QueryDocumentKeys;
|
|
4221
4221
|
var BREAK = Object.freeze({});
|
|
4222
4222
|
exports.BREAK = BREAK;
|
|
4223
|
-
function
|
|
4223
|
+
function visit13(root, visitor) {
|
|
4224
4224
|
var visitorKeys = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : QueryDocumentKeys;
|
|
4225
4225
|
var stack = void 0;
|
|
4226
4226
|
var inArray = Array.isArray(root);
|
|
@@ -4965,8 +4965,8 @@ var require_printer = __commonJS({
|
|
|
4965
4965
|
return join3(["interface", name2, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block2(fields)], " ");
|
|
4966
4966
|
}),
|
|
4967
4967
|
UnionTypeDefinition: addDescription2(function(_ref27) {
|
|
4968
|
-
var name2 = _ref27.name, directives = _ref27.directives,
|
|
4969
|
-
return join3(["union", name2, join3(directives, " "),
|
|
4968
|
+
var name2 = _ref27.name, directives = _ref27.directives, types16 = _ref27.types;
|
|
4969
|
+
return join3(["union", name2, join3(directives, " "), types16 && types16.length !== 0 ? "= " + join3(types16, " | ") : ""], " ");
|
|
4970
4970
|
}),
|
|
4971
4971
|
EnumTypeDefinition: addDescription2(function(_ref28) {
|
|
4972
4972
|
var name2 = _ref28.name, directives = _ref28.directives, values = _ref28.values;
|
|
@@ -5001,8 +5001,8 @@ var require_printer = __commonJS({
|
|
|
5001
5001
|
return join3(["extend interface", name2, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block2(fields)], " ");
|
|
5002
5002
|
},
|
|
5003
5003
|
UnionTypeExtension: function UnionTypeExtension(_ref36) {
|
|
5004
|
-
var name2 = _ref36.name, directives = _ref36.directives,
|
|
5005
|
-
return join3(["extend union", name2, join3(directives, " "),
|
|
5004
|
+
var name2 = _ref36.name, directives = _ref36.directives, types16 = _ref36.types;
|
|
5005
|
+
return join3(["extend union", name2, join3(directives, " "), types16 && types16.length !== 0 ? "= " + join3(types16, " | ") : ""], " ");
|
|
5006
5006
|
},
|
|
5007
5007
|
EnumTypeExtension: function EnumTypeExtension(_ref37) {
|
|
5008
5008
|
var name2 = _ref37.name, directives = _ref37.directives, values = _ref37.values;
|
|
@@ -5098,17 +5098,17 @@ var require_definition = __commonJS({
|
|
|
5098
5098
|
});
|
|
5099
5099
|
exports.isType = isType;
|
|
5100
5100
|
exports.assertType = assertType;
|
|
5101
|
-
exports.isScalarType =
|
|
5101
|
+
exports.isScalarType = isScalarType13;
|
|
5102
5102
|
exports.assertScalarType = assertScalarType;
|
|
5103
|
-
exports.isObjectType =
|
|
5103
|
+
exports.isObjectType = isObjectType12;
|
|
5104
5104
|
exports.assertObjectType = assertObjectType;
|
|
5105
5105
|
exports.isInterfaceType = isInterfaceType12;
|
|
5106
5106
|
exports.assertInterfaceType = assertInterfaceType;
|
|
5107
5107
|
exports.isUnionType = isUnionType13;
|
|
5108
5108
|
exports.assertUnionType = assertUnionType;
|
|
5109
|
-
exports.isEnumType =
|
|
5109
|
+
exports.isEnumType = isEnumType10;
|
|
5110
5110
|
exports.assertEnumType = assertEnumType;
|
|
5111
|
-
exports.isInputObjectType =
|
|
5111
|
+
exports.isInputObjectType = isInputObjectType8;
|
|
5112
5112
|
exports.assertInputObjectType = assertInputObjectType;
|
|
5113
5113
|
exports.isListType = isListType8;
|
|
5114
5114
|
exports.assertListType = assertListType;
|
|
@@ -5122,7 +5122,7 @@ var require_definition = __commonJS({
|
|
|
5122
5122
|
exports.assertLeafType = assertLeafType;
|
|
5123
5123
|
exports.isCompositeType = isCompositeType;
|
|
5124
5124
|
exports.assertCompositeType = assertCompositeType;
|
|
5125
|
-
exports.isAbstractType =
|
|
5125
|
+
exports.isAbstractType = isAbstractType3;
|
|
5126
5126
|
exports.assertAbstractType = assertAbstractType;
|
|
5127
5127
|
exports.GraphQLList = GraphQLList6;
|
|
5128
5128
|
exports.GraphQLNonNull = GraphQLNonNull6;
|
|
@@ -5177,7 +5177,7 @@ var require_definition = __commonJS({
|
|
|
5177
5177
|
return Constructor;
|
|
5178
5178
|
}
|
|
5179
5179
|
function isType(type) {
|
|
5180
|
-
return
|
|
5180
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType10(type) || isInputObjectType8(type) || isListType8(type) || isNonNullType10(type);
|
|
5181
5181
|
}
|
|
5182
5182
|
function assertType(type) {
|
|
5183
5183
|
if (!isType(type)) {
|
|
@@ -5185,20 +5185,20 @@ var require_definition = __commonJS({
|
|
|
5185
5185
|
}
|
|
5186
5186
|
return type;
|
|
5187
5187
|
}
|
|
5188
|
-
function
|
|
5188
|
+
function isScalarType13(type) {
|
|
5189
5189
|
return (0, _instanceOf.default)(type, GraphQLScalarType4);
|
|
5190
5190
|
}
|
|
5191
5191
|
function assertScalarType(type) {
|
|
5192
|
-
if (!
|
|
5192
|
+
if (!isScalarType13(type)) {
|
|
5193
5193
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Scalar type."));
|
|
5194
5194
|
}
|
|
5195
5195
|
return type;
|
|
5196
5196
|
}
|
|
5197
|
-
function
|
|
5197
|
+
function isObjectType12(type) {
|
|
5198
5198
|
return (0, _instanceOf.default)(type, GraphQLObjectType6);
|
|
5199
5199
|
}
|
|
5200
5200
|
function assertObjectType(type) {
|
|
5201
|
-
if (!
|
|
5201
|
+
if (!isObjectType12(type)) {
|
|
5202
5202
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Object type."));
|
|
5203
5203
|
}
|
|
5204
5204
|
return type;
|
|
@@ -5221,20 +5221,20 @@ var require_definition = __commonJS({
|
|
|
5221
5221
|
}
|
|
5222
5222
|
return type;
|
|
5223
5223
|
}
|
|
5224
|
-
function
|
|
5224
|
+
function isEnumType10(type) {
|
|
5225
5225
|
return (0, _instanceOf.default)(type, GraphQLEnumType4);
|
|
5226
5226
|
}
|
|
5227
5227
|
function assertEnumType(type) {
|
|
5228
|
-
if (!
|
|
5228
|
+
if (!isEnumType10(type)) {
|
|
5229
5229
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Enum type."));
|
|
5230
5230
|
}
|
|
5231
5231
|
return type;
|
|
5232
5232
|
}
|
|
5233
|
-
function
|
|
5233
|
+
function isInputObjectType8(type) {
|
|
5234
5234
|
return (0, _instanceOf.default)(type, GraphQLInputObjectType4);
|
|
5235
5235
|
}
|
|
5236
5236
|
function assertInputObjectType(type) {
|
|
5237
|
-
if (!
|
|
5237
|
+
if (!isInputObjectType8(type)) {
|
|
5238
5238
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Input Object type."));
|
|
5239
5239
|
}
|
|
5240
5240
|
return type;
|
|
@@ -5258,7 +5258,7 @@ var require_definition = __commonJS({
|
|
|
5258
5258
|
return type;
|
|
5259
5259
|
}
|
|
5260
5260
|
function isInputType(type) {
|
|
5261
|
-
return
|
|
5261
|
+
return isScalarType13(type) || isEnumType10(type) || isInputObjectType8(type) || isWrappingType(type) && isInputType(type.ofType);
|
|
5262
5262
|
}
|
|
5263
5263
|
function assertInputType(type) {
|
|
5264
5264
|
if (!isInputType(type)) {
|
|
@@ -5267,7 +5267,7 @@ var require_definition = __commonJS({
|
|
|
5267
5267
|
return type;
|
|
5268
5268
|
}
|
|
5269
5269
|
function isOutputType(type) {
|
|
5270
|
-
return
|
|
5270
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType10(type) || isWrappingType(type) && isOutputType(type.ofType);
|
|
5271
5271
|
}
|
|
5272
5272
|
function assertOutputType(type) {
|
|
5273
5273
|
if (!isOutputType(type)) {
|
|
@@ -5276,7 +5276,7 @@ var require_definition = __commonJS({
|
|
|
5276
5276
|
return type;
|
|
5277
5277
|
}
|
|
5278
5278
|
function isLeafType4(type) {
|
|
5279
|
-
return
|
|
5279
|
+
return isScalarType13(type) || isEnumType10(type);
|
|
5280
5280
|
}
|
|
5281
5281
|
function assertLeafType(type) {
|
|
5282
5282
|
if (!isLeafType4(type)) {
|
|
@@ -5285,7 +5285,7 @@ var require_definition = __commonJS({
|
|
|
5285
5285
|
return type;
|
|
5286
5286
|
}
|
|
5287
5287
|
function isCompositeType(type) {
|
|
5288
|
-
return
|
|
5288
|
+
return isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type);
|
|
5289
5289
|
}
|
|
5290
5290
|
function assertCompositeType(type) {
|
|
5291
5291
|
if (!isCompositeType(type)) {
|
|
@@ -5293,11 +5293,11 @@ var require_definition = __commonJS({
|
|
|
5293
5293
|
}
|
|
5294
5294
|
return type;
|
|
5295
5295
|
}
|
|
5296
|
-
function
|
|
5296
|
+
function isAbstractType3(type) {
|
|
5297
5297
|
return isInterfaceType12(type) || isUnionType13(type);
|
|
5298
5298
|
}
|
|
5299
5299
|
function assertAbstractType(type) {
|
|
5300
|
-
if (!
|
|
5300
|
+
if (!isAbstractType3(type)) {
|
|
5301
5301
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL abstract type."));
|
|
5302
5302
|
}
|
|
5303
5303
|
return type;
|
|
@@ -5364,7 +5364,7 @@ var require_definition = __commonJS({
|
|
|
5364
5364
|
}
|
|
5365
5365
|
}
|
|
5366
5366
|
function isNamedType4(type) {
|
|
5367
|
-
return
|
|
5367
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType10(type) || isInputObjectType8(type);
|
|
5368
5368
|
}
|
|
5369
5369
|
function assertNamedType(type) {
|
|
5370
5370
|
if (!isNamedType4(type)) {
|
|
@@ -5673,9 +5673,9 @@ var require_definition = __commonJS({
|
|
|
5673
5673
|
exports.GraphQLUnionType = GraphQLUnionType3;
|
|
5674
5674
|
(0, _defineInspect.default)(GraphQLUnionType3);
|
|
5675
5675
|
function defineTypes(config2) {
|
|
5676
|
-
var
|
|
5677
|
-
Array.isArray(
|
|
5678
|
-
return
|
|
5676
|
+
var types16 = resolveThunk(config2.types);
|
|
5677
|
+
Array.isArray(types16) || (0, _devAssert.default)(0, "Must provide Array of types or a function which returns such an array for Union ".concat(config2.name, "."));
|
|
5678
|
+
return types16;
|
|
5679
5679
|
}
|
|
5680
5680
|
var GraphQLEnumType4 = /* @__PURE__ */ function() {
|
|
5681
5681
|
function GraphQLEnumType5(config2) {
|
|
@@ -11513,7 +11513,7 @@ var require_graphql = __commonJS({
|
|
|
11513
11513
|
Object.defineProperty(exports, "__esModule", {
|
|
11514
11514
|
value: true
|
|
11515
11515
|
});
|
|
11516
|
-
exports.graphql =
|
|
11516
|
+
exports.graphql = graphql30;
|
|
11517
11517
|
exports.graphqlSync = graphqlSync;
|
|
11518
11518
|
var _isPromise = _interopRequireDefault(require_isPromise());
|
|
11519
11519
|
var _parser = require_parser();
|
|
@@ -11523,7 +11523,7 @@ var require_graphql = __commonJS({
|
|
|
11523
11523
|
function _interopRequireDefault(obj) {
|
|
11524
11524
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
11525
11525
|
}
|
|
11526
|
-
function
|
|
11526
|
+
function graphql30(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) {
|
|
11527
11527
|
var _arguments = arguments;
|
|
11528
11528
|
return new Promise(function(resolve2) {
|
|
11529
11529
|
return resolve2(
|
|
@@ -13312,7 +13312,7 @@ var require_buildClientSchema = __commonJS({
|
|
|
13312
13312
|
return new _definition.GraphQLUnionType({
|
|
13313
13313
|
name: unionIntrospection.name,
|
|
13314
13314
|
description: unionIntrospection.description,
|
|
13315
|
-
types: function
|
|
13315
|
+
types: function types16() {
|
|
13316
13316
|
return unionIntrospection.possibleTypes.map(getObjectType);
|
|
13317
13317
|
}
|
|
13318
13318
|
});
|
|
@@ -13657,7 +13657,7 @@ var require_extendSchema = __commonJS({
|
|
|
13657
13657
|
var config2 = type.toConfig();
|
|
13658
13658
|
var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
|
|
13659
13659
|
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config2), {}, {
|
|
13660
|
-
types: function
|
|
13660
|
+
types: function types16() {
|
|
13661
13661
|
return [].concat(type.getTypes().map(replaceNamedType), buildUnionTypes(extensions));
|
|
13662
13662
|
},
|
|
13663
13663
|
extensionASTNodes: config2.extensionASTNodes.concat(extensions)
|
|
@@ -13805,17 +13805,17 @@ var require_extendSchema = __commonJS({
|
|
|
13805
13805
|
return interfaces;
|
|
13806
13806
|
}
|
|
13807
13807
|
function buildUnionTypes(nodes) {
|
|
13808
|
-
var
|
|
13808
|
+
var types16 = [];
|
|
13809
13809
|
for (var _i32 = 0; _i32 < nodes.length; _i32++) {
|
|
13810
13810
|
var _node$types;
|
|
13811
13811
|
var node = nodes[_i32];
|
|
13812
13812
|
var typeNodes = (_node$types = node.types) !== null && _node$types !== void 0 ? _node$types : [];
|
|
13813
13813
|
for (var _i34 = 0; _i34 < typeNodes.length; _i34++) {
|
|
13814
13814
|
var type = typeNodes[_i34];
|
|
13815
|
-
|
|
13815
|
+
types16.push(getNamedType5(type));
|
|
13816
13816
|
}
|
|
13817
13817
|
}
|
|
13818
|
-
return
|
|
13818
|
+
return types16;
|
|
13819
13819
|
}
|
|
13820
13820
|
function buildType(astNode) {
|
|
13821
13821
|
var _typeExtensionsMap$na;
|
|
@@ -13872,7 +13872,7 @@ var require_extendSchema = __commonJS({
|
|
|
13872
13872
|
return new _definition.GraphQLUnionType({
|
|
13873
13873
|
name: name3,
|
|
13874
13874
|
description,
|
|
13875
|
-
types: function
|
|
13875
|
+
types: function types16() {
|
|
13876
13876
|
return buildUnionTypes(_allNodes3);
|
|
13877
13877
|
},
|
|
13878
13878
|
astNode,
|
|
@@ -14170,7 +14170,7 @@ var require_lexicographicSortSchema = __commonJS({
|
|
|
14170
14170
|
if ((0, _definition.isUnionType)(type)) {
|
|
14171
14171
|
var _config22 = type.toConfig();
|
|
14172
14172
|
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, _config22), {}, {
|
|
14173
|
-
types: function
|
|
14173
|
+
types: function types16() {
|
|
14174
14174
|
return sortTypes(_config22.types);
|
|
14175
14175
|
}
|
|
14176
14176
|
}));
|
|
@@ -14255,10 +14255,10 @@ var require_printSchema = __commonJS({
|
|
|
14255
14255
|
}
|
|
14256
14256
|
function printFilteredSchema(schema, directiveFilter, typeFilter, options) {
|
|
14257
14257
|
var directives = schema.getDirectives().filter(directiveFilter);
|
|
14258
|
-
var
|
|
14258
|
+
var types16 = (0, _objectValues.default)(schema.getTypeMap()).filter(typeFilter);
|
|
14259
14259
|
return [printSchemaDefinition(schema)].concat(directives.map(function(directive) {
|
|
14260
14260
|
return printDirective(directive, options);
|
|
14261
|
-
}),
|
|
14261
|
+
}), types16.map(function(type) {
|
|
14262
14262
|
return printType(type, options);
|
|
14263
14263
|
})).filter(Boolean).join("\n\n") + "\n";
|
|
14264
14264
|
}
|
|
@@ -14333,8 +14333,8 @@ var require_printSchema = __commonJS({
|
|
|
14333
14333
|
return printDescription(options, type) + "interface ".concat(type.name) + printImplementedInterfaces(type) + printFields(options, type);
|
|
14334
14334
|
}
|
|
14335
14335
|
function printUnion(type, options) {
|
|
14336
|
-
var
|
|
14337
|
-
var possibleTypes =
|
|
14336
|
+
var types16 = type.getTypes();
|
|
14337
|
+
var possibleTypes = types16.length ? " = " + types16.join(" | ") : "";
|
|
14338
14338
|
return printDescription(options, type) + "union " + type.name + possibleTypes;
|
|
14339
14339
|
}
|
|
14340
14340
|
function printEnum(type, options) {
|
|
@@ -30011,14 +30011,14 @@ var require_lib3 = __commonJS({
|
|
|
30011
30011
|
this.preserveSpace = !!preserveSpace;
|
|
30012
30012
|
}
|
|
30013
30013
|
};
|
|
30014
|
-
var
|
|
30014
|
+
var types16 = {
|
|
30015
30015
|
brace: new TokContext("{"),
|
|
30016
30016
|
j_oTag: new TokContext("<tag"),
|
|
30017
30017
|
j_cTag: new TokContext("</tag"),
|
|
30018
30018
|
j_expr: new TokContext("<tag>...</tag>", true)
|
|
30019
30019
|
};
|
|
30020
30020
|
{
|
|
30021
|
-
|
|
30021
|
+
types16.template = new TokContext("`", true);
|
|
30022
30022
|
}
|
|
30023
30023
|
var beforeExpr = true;
|
|
30024
30024
|
var startsExpr = true;
|
|
@@ -30550,17 +30550,17 @@ var require_lib3 = __commonJS({
|
|
|
30550
30550
|
context.pop();
|
|
30551
30551
|
};
|
|
30552
30552
|
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
|
|
30553
|
-
context.push(
|
|
30553
|
+
context.push(types16.brace);
|
|
30554
30554
|
};
|
|
30555
30555
|
tokenTypes[22].updateContext = (context) => {
|
|
30556
|
-
if (context[context.length - 1] ===
|
|
30556
|
+
if (context[context.length - 1] === types16.template) {
|
|
30557
30557
|
context.pop();
|
|
30558
30558
|
} else {
|
|
30559
|
-
context.push(
|
|
30559
|
+
context.push(types16.template);
|
|
30560
30560
|
}
|
|
30561
30561
|
};
|
|
30562
30562
|
tokenTypes[140].updateContext = (context) => {
|
|
30563
|
-
context.push(
|
|
30563
|
+
context.push(types16.j_expr, types16.j_oTag);
|
|
30564
30564
|
};
|
|
30565
30565
|
}
|
|
30566
30566
|
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";
|
|
@@ -31201,7 +31201,7 @@ var require_lib3 = __commonJS({
|
|
|
31201
31201
|
this.lastTokEndLoc = null;
|
|
31202
31202
|
this.lastTokStartLoc = null;
|
|
31203
31203
|
this.lastTokStart = 0;
|
|
31204
|
-
this.context = [
|
|
31204
|
+
this.context = [types16.brace];
|
|
31205
31205
|
this.canStartJSXElement = true;
|
|
31206
31206
|
this.containsEsc = false;
|
|
31207
31207
|
this.firstInvalidTemplateEscapePos = null;
|
|
@@ -35125,7 +35125,7 @@ var require_lib3 = __commonJS({
|
|
|
35125
35125
|
context
|
|
35126
35126
|
} = this.state;
|
|
35127
35127
|
const currentContext = context[context.length - 1];
|
|
35128
|
-
if (currentContext ===
|
|
35128
|
+
if (currentContext === types16.j_oTag || currentContext === types16.j_expr) {
|
|
35129
35129
|
context.pop();
|
|
35130
35130
|
}
|
|
35131
35131
|
}
|
|
@@ -36185,9 +36185,9 @@ var require_lib3 = __commonJS({
|
|
|
36185
36185
|
switch (this.state.type) {
|
|
36186
36186
|
case 5:
|
|
36187
36187
|
node = this.startNode();
|
|
36188
|
-
this.setContext(
|
|
36188
|
+
this.setContext(types16.brace);
|
|
36189
36189
|
this.next();
|
|
36190
|
-
node = this.jsxParseExpressionContainer(node,
|
|
36190
|
+
node = this.jsxParseExpressionContainer(node, types16.j_oTag);
|
|
36191
36191
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
36192
36192
|
this.raise(JsxErrors.AttributeIsEmpty, {
|
|
36193
36193
|
at: node
|
|
@@ -36210,7 +36210,7 @@ var require_lib3 = __commonJS({
|
|
|
36210
36210
|
jsxParseSpreadChild(node) {
|
|
36211
36211
|
this.next();
|
|
36212
36212
|
node.expression = this.parseExpression();
|
|
36213
|
-
this.setContext(
|
|
36213
|
+
this.setContext(types16.j_expr);
|
|
36214
36214
|
this.state.canStartJSXElement = true;
|
|
36215
36215
|
this.expect(8);
|
|
36216
36216
|
return this.finishNode(node, "JSXSpreadChild");
|
|
@@ -36230,11 +36230,11 @@ var require_lib3 = __commonJS({
|
|
|
36230
36230
|
jsxParseAttribute() {
|
|
36231
36231
|
const node = this.startNode();
|
|
36232
36232
|
if (this.match(5)) {
|
|
36233
|
-
this.setContext(
|
|
36233
|
+
this.setContext(types16.brace);
|
|
36234
36234
|
this.next();
|
|
36235
36235
|
this.expect(21);
|
|
36236
36236
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
36237
|
-
this.setContext(
|
|
36237
|
+
this.setContext(types16.j_oTag);
|
|
36238
36238
|
this.state.canStartJSXElement = true;
|
|
36239
36239
|
this.expect(8);
|
|
36240
36240
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
@@ -36293,12 +36293,12 @@ var require_lib3 = __commonJS({
|
|
|
36293
36293
|
break;
|
|
36294
36294
|
case 5: {
|
|
36295
36295
|
const node2 = this.startNode();
|
|
36296
|
-
this.setContext(
|
|
36296
|
+
this.setContext(types16.brace);
|
|
36297
36297
|
this.next();
|
|
36298
36298
|
if (this.match(21)) {
|
|
36299
36299
|
children.push(this.jsxParseSpreadChild(node2));
|
|
36300
36300
|
} else {
|
|
36301
|
-
children.push(this.jsxParseExpressionContainer(node2,
|
|
36301
|
+
children.push(this.jsxParseExpressionContainer(node2, types16.j_expr));
|
|
36302
36302
|
}
|
|
36303
36303
|
break;
|
|
36304
36304
|
}
|
|
@@ -36369,10 +36369,10 @@ var require_lib3 = __commonJS({
|
|
|
36369
36369
|
}
|
|
36370
36370
|
getTokenFromCode(code) {
|
|
36371
36371
|
const context = this.curContext();
|
|
36372
|
-
if (context ===
|
|
36372
|
+
if (context === types16.j_expr) {
|
|
36373
36373
|
return this.jsxReadToken();
|
|
36374
36374
|
}
|
|
36375
|
-
if (context ===
|
|
36375
|
+
if (context === types16.j_oTag || context === types16.j_cTag) {
|
|
36376
36376
|
if (isIdentifierStart(code)) {
|
|
36377
36377
|
return this.jsxReadWord();
|
|
36378
36378
|
}
|
|
@@ -36380,7 +36380,7 @@ var require_lib3 = __commonJS({
|
|
|
36380
36380
|
++this.state.pos;
|
|
36381
36381
|
return this.finishToken(141);
|
|
36382
36382
|
}
|
|
36383
|
-
if ((code === 34 || code === 39) && context ===
|
|
36383
|
+
if ((code === 34 || code === 39) && context === types16.j_oTag) {
|
|
36384
36384
|
return this.jsxReadString(code);
|
|
36385
36385
|
}
|
|
36386
36386
|
}
|
|
@@ -36396,17 +36396,17 @@ var require_lib3 = __commonJS({
|
|
|
36396
36396
|
type
|
|
36397
36397
|
} = this.state;
|
|
36398
36398
|
if (type === 56 && prevType === 140) {
|
|
36399
|
-
context.splice(-2, 2,
|
|
36399
|
+
context.splice(-2, 2, types16.j_cTag);
|
|
36400
36400
|
this.state.canStartJSXElement = false;
|
|
36401
36401
|
} else if (type === 140) {
|
|
36402
|
-
context.push(
|
|
36402
|
+
context.push(types16.j_oTag);
|
|
36403
36403
|
} else if (type === 141) {
|
|
36404
36404
|
const out = context[context.length - 1];
|
|
36405
|
-
if (out ===
|
|
36405
|
+
if (out === types16.j_oTag && prevType === 56 || out === types16.j_cTag) {
|
|
36406
36406
|
context.pop();
|
|
36407
|
-
this.state.canStartJSXElement = context[context.length - 1] ===
|
|
36407
|
+
this.state.canStartJSXElement = context[context.length - 1] === types16.j_expr;
|
|
36408
36408
|
} else {
|
|
36409
|
-
this.setContext(
|
|
36409
|
+
this.setContext(types16.j_expr);
|
|
36410
36410
|
this.state.canStartJSXElement = true;
|
|
36411
36411
|
}
|
|
36412
36412
|
} else {
|
|
@@ -37413,14 +37413,14 @@ var require_lib3 = __commonJS({
|
|
|
37413
37413
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
37414
37414
|
const node = this.startNode();
|
|
37415
37415
|
const hasLeadingOperator = this.eat(operator);
|
|
37416
|
-
const
|
|
37416
|
+
const types17 = [];
|
|
37417
37417
|
do {
|
|
37418
|
-
|
|
37418
|
+
types17.push(parseConstituentType());
|
|
37419
37419
|
} while (this.eat(operator));
|
|
37420
|
-
if (
|
|
37421
|
-
return
|
|
37420
|
+
if (types17.length === 1 && !hasLeadingOperator) {
|
|
37421
|
+
return types17[0];
|
|
37422
37422
|
}
|
|
37423
|
-
node.types =
|
|
37423
|
+
node.types = types17;
|
|
37424
37424
|
return this.finishNode(node, kind);
|
|
37425
37425
|
}
|
|
37426
37426
|
tsParseIntersectionTypeOrHigher() {
|
|
@@ -38636,7 +38636,7 @@ var require_lib3 = __commonJS({
|
|
|
38636
38636
|
context
|
|
38637
38637
|
} = this.state;
|
|
38638
38638
|
const currentContext = context[context.length - 1];
|
|
38639
|
-
if (currentContext ===
|
|
38639
|
+
if (currentContext === types16.j_oTag || currentContext === types16.j_expr) {
|
|
38640
38640
|
context.pop();
|
|
38641
38641
|
}
|
|
38642
38642
|
}
|
|
@@ -44208,9 +44208,9 @@ var require_shared = __commonJS({
|
|
|
44208
44208
|
var tslib_1 = require_tslib();
|
|
44209
44209
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
44210
44210
|
function default_1(fork) {
|
|
44211
|
-
var
|
|
44212
|
-
var Type =
|
|
44213
|
-
var builtin =
|
|
44211
|
+
var types16 = fork.use(types_1.default);
|
|
44212
|
+
var Type = types16.Type;
|
|
44213
|
+
var builtin = types16.builtInTypes;
|
|
44214
44214
|
var isNumber = builtin.number;
|
|
44215
44215
|
function geq(than) {
|
|
44216
44216
|
return Type.from(function(value) {
|
|
@@ -44360,9 +44360,9 @@ var require_types = __commonJS({
|
|
|
44360
44360
|
}(BaseType);
|
|
44361
44361
|
var OrType = function(_super) {
|
|
44362
44362
|
tslib_1.__extends(OrType2, _super);
|
|
44363
|
-
function OrType2(
|
|
44363
|
+
function OrType2(types16) {
|
|
44364
44364
|
var _this = _super.call(this) || this;
|
|
44365
|
-
_this.types =
|
|
44365
|
+
_this.types = types16;
|
|
44366
44366
|
_this.kind = "OrType";
|
|
44367
44367
|
return _this;
|
|
44368
44368
|
}
|
|
@@ -44503,11 +44503,11 @@ var require_types = __commonJS({
|
|
|
44503
44503
|
function typesPlugin(_fork) {
|
|
44504
44504
|
var Type = {
|
|
44505
44505
|
or: function() {
|
|
44506
|
-
var
|
|
44506
|
+
var types16 = [];
|
|
44507
44507
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
44508
|
-
|
|
44508
|
+
types16[_i] = arguments[_i];
|
|
44509
44509
|
}
|
|
44510
|
-
return new OrType(
|
|
44510
|
+
return new OrType(types16.map(function(type) {
|
|
44511
44511
|
return Type.from(type);
|
|
44512
44512
|
}));
|
|
44513
44513
|
},
|
|
@@ -44952,9 +44952,9 @@ var require_path2 = __commonJS({
|
|
|
44952
44952
|
var Op = Object.prototype;
|
|
44953
44953
|
var hasOwn = Op.hasOwnProperty;
|
|
44954
44954
|
function pathPlugin(fork) {
|
|
44955
|
-
var
|
|
44956
|
-
var isArray =
|
|
44957
|
-
var isNumber =
|
|
44955
|
+
var types16 = fork.use(types_1.default);
|
|
44956
|
+
var isArray = types16.builtInTypes.array;
|
|
44957
|
+
var isNumber = types16.builtInTypes.number;
|
|
44958
44958
|
var Path = function Path2(value, parentPath, name2) {
|
|
44959
44959
|
if (!(this instanceof Path2)) {
|
|
44960
44960
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
@@ -45256,13 +45256,13 @@ var require_scope = __commonJS({
|
|
|
45256
45256
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
45257
45257
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
45258
45258
|
function scopePlugin(fork) {
|
|
45259
|
-
var
|
|
45260
|
-
var Type =
|
|
45261
|
-
var namedTypes =
|
|
45259
|
+
var types16 = fork.use(types_1.default);
|
|
45260
|
+
var Type = types16.Type;
|
|
45261
|
+
var namedTypes = types16.namedTypes;
|
|
45262
45262
|
var Node = namedTypes.Node;
|
|
45263
45263
|
var Expression = namedTypes.Expression;
|
|
45264
|
-
var isArray =
|
|
45265
|
-
var b =
|
|
45264
|
+
var isArray = types16.builtInTypes.array;
|
|
45265
|
+
var b = types16.builders;
|
|
45266
45266
|
var Scope = function Scope2(path2, parentScope) {
|
|
45267
45267
|
if (!(this instanceof Scope2)) {
|
|
45268
45268
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
@@ -45325,7 +45325,7 @@ var require_scope = __commonJS({
|
|
|
45325
45325
|
++index;
|
|
45326
45326
|
}
|
|
45327
45327
|
var name2 = prefix + index;
|
|
45328
|
-
return this.bindings[name2] =
|
|
45328
|
+
return this.bindings[name2] = types16.builders.identifier(name2);
|
|
45329
45329
|
};
|
|
45330
45330
|
Sp.injectTemporary = function(identifier, init2) {
|
|
45331
45331
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -45401,7 +45401,7 @@ var require_scope = __commonJS({
|
|
|
45401
45401
|
bindings
|
|
45402
45402
|
);
|
|
45403
45403
|
} else if (Node.check(node) && !Expression.check(node)) {
|
|
45404
|
-
|
|
45404
|
+
types16.eachField(node, function(name2, child) {
|
|
45405
45405
|
var childPath = path2.get(name2);
|
|
45406
45406
|
if (!pathHasValue(childPath, child)) {
|
|
45407
45407
|
throw new Error("");
|
|
@@ -45479,24 +45479,24 @@ var require_scope = __commonJS({
|
|
|
45479
45479
|
addPattern(patternPath.get("argument"), bindings);
|
|
45480
45480
|
}
|
|
45481
45481
|
}
|
|
45482
|
-
function addTypePattern(patternPath,
|
|
45482
|
+
function addTypePattern(patternPath, types17) {
|
|
45483
45483
|
var pattern = patternPath.value;
|
|
45484
45484
|
namedTypes.Pattern.assert(pattern);
|
|
45485
45485
|
if (namedTypes.Identifier.check(pattern)) {
|
|
45486
|
-
if (hasOwn.call(
|
|
45487
|
-
|
|
45486
|
+
if (hasOwn.call(types17, pattern.name)) {
|
|
45487
|
+
types17[pattern.name].push(patternPath);
|
|
45488
45488
|
} else {
|
|
45489
|
-
|
|
45489
|
+
types17[pattern.name] = [patternPath];
|
|
45490
45490
|
}
|
|
45491
45491
|
}
|
|
45492
45492
|
}
|
|
45493
|
-
function addTypeParameter(parameterPath,
|
|
45493
|
+
function addTypeParameter(parameterPath, types17) {
|
|
45494
45494
|
var parameter = parameterPath.value;
|
|
45495
45495
|
FlowOrTSTypeParameterType.assert(parameter);
|
|
45496
|
-
if (hasOwn.call(
|
|
45497
|
-
|
|
45496
|
+
if (hasOwn.call(types17, parameter.name)) {
|
|
45497
|
+
types17[parameter.name].push(parameterPath);
|
|
45498
45498
|
} else {
|
|
45499
|
-
|
|
45499
|
+
types17[parameter.name] = [parameterPath];
|
|
45500
45500
|
}
|
|
45501
45501
|
}
|
|
45502
45502
|
Sp.lookup = function(name2) {
|
|
@@ -45537,11 +45537,11 @@ var require_node_path = __commonJS({
|
|
|
45537
45537
|
var scope_1 = tslib_1.__importDefault(require_scope());
|
|
45538
45538
|
var shared_1 = require_shared();
|
|
45539
45539
|
function nodePathPlugin(fork) {
|
|
45540
|
-
var
|
|
45541
|
-
var n =
|
|
45542
|
-
var b =
|
|
45543
|
-
var isNumber =
|
|
45544
|
-
var isArray =
|
|
45540
|
+
var types16 = fork.use(types_1.default);
|
|
45541
|
+
var n = types16.namedTypes;
|
|
45542
|
+
var b = types16.builders;
|
|
45543
|
+
var isNumber = types16.builtInTypes.number;
|
|
45544
|
+
var isArray = types16.builtInTypes.array;
|
|
45545
45545
|
var Path = fork.use(path_1.default);
|
|
45546
45546
|
var Scope = fork.use(scope_1.default);
|
|
45547
45547
|
var NodePath = function NodePath2(value, parentPath, name2) {
|
|
@@ -45632,7 +45632,7 @@ var require_node_path = __commonJS({
|
|
|
45632
45632
|
return scope || null;
|
|
45633
45633
|
};
|
|
45634
45634
|
NPp.getValueProperty = function(name2) {
|
|
45635
|
-
return
|
|
45635
|
+
return types16.getFieldValue(this.value, name2);
|
|
45636
45636
|
};
|
|
45637
45637
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
45638
45638
|
var pp = this.parentPath;
|
|
@@ -45774,7 +45774,7 @@ var require_node_path = __commonJS({
|
|
|
45774
45774
|
return node.some(containsCallExpression);
|
|
45775
45775
|
}
|
|
45776
45776
|
if (n.Node.check(node)) {
|
|
45777
|
-
return
|
|
45777
|
+
return types16.someField(node, function(_name, child) {
|
|
45778
45778
|
return containsCallExpression(child);
|
|
45779
45779
|
});
|
|
45780
45780
|
}
|
|
@@ -45895,11 +45895,11 @@ var require_path_visitor = __commonJS({
|
|
|
45895
45895
|
var shared_1 = require_shared();
|
|
45896
45896
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
45897
45897
|
function pathVisitorPlugin(fork) {
|
|
45898
|
-
var
|
|
45898
|
+
var types16 = fork.use(types_1.default);
|
|
45899
45899
|
var NodePath = fork.use(node_path_1.default);
|
|
45900
|
-
var isArray =
|
|
45901
|
-
var isObject2 =
|
|
45902
|
-
var isFunction =
|
|
45900
|
+
var isArray = types16.builtInTypes.array;
|
|
45901
|
+
var isObject2 = types16.builtInTypes.object;
|
|
45902
|
+
var isFunction = types16.builtInTypes.function;
|
|
45903
45903
|
var undefined2;
|
|
45904
45904
|
var PathVisitor = function PathVisitor2() {
|
|
45905
45905
|
if (!(this instanceof PathVisitor2)) {
|
|
@@ -45919,7 +45919,7 @@ var require_path_visitor = __commonJS({
|
|
|
45919
45919
|
typeNames[methodName.slice("visit".length)] = true;
|
|
45920
45920
|
}
|
|
45921
45921
|
}
|
|
45922
|
-
var supertypeTable =
|
|
45922
|
+
var supertypeTable = types16.computeSupertypeLookupTable(typeNames);
|
|
45923
45923
|
var methodNameTable = /* @__PURE__ */ Object.create(null);
|
|
45924
45924
|
var typeNameKeys = Object.keys(supertypeTable);
|
|
45925
45925
|
var typeNameCount = typeNameKeys.length;
|
|
@@ -45961,7 +45961,7 @@ var require_path_visitor = __commonJS({
|
|
|
45961
45961
|
}
|
|
45962
45962
|
return target;
|
|
45963
45963
|
}
|
|
45964
|
-
PathVisitor.visit = function
|
|
45964
|
+
PathVisitor.visit = function visit13(node, methods) {
|
|
45965
45965
|
return PathVisitor.fromMethodsObject(methods).visit(node);
|
|
45966
45966
|
};
|
|
45967
45967
|
var PVp = PathVisitor.prototype;
|
|
@@ -46038,7 +46038,7 @@ var require_path_visitor = __commonJS({
|
|
|
46038
46038
|
path2.each(visitor.visitWithoutReset, visitor);
|
|
46039
46039
|
} else if (!isObject2.check(value)) {
|
|
46040
46040
|
} else {
|
|
46041
|
-
var childNames =
|
|
46041
|
+
var childNames = types16.getFieldNames(value);
|
|
46042
46042
|
if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
|
|
46043
46043
|
childNames.push("comments");
|
|
46044
46044
|
}
|
|
@@ -46047,7 +46047,7 @@ var require_path_visitor = __commonJS({
|
|
|
46047
46047
|
for (var i2 = 0; i2 < childCount; ++i2) {
|
|
46048
46048
|
var childName = childNames[i2];
|
|
46049
46049
|
if (!hasOwn.call(value, childName)) {
|
|
46050
|
-
value[childName] =
|
|
46050
|
+
value[childName] = types16.getFieldValue(value, childName);
|
|
46051
46051
|
}
|
|
46052
46052
|
childPaths.push(path2.get(childName));
|
|
46053
46053
|
}
|
|
@@ -46152,7 +46152,7 @@ var require_path_visitor = __commonJS({
|
|
|
46152
46152
|
this.needToCallTraverse = false;
|
|
46153
46153
|
return visitChildren(path2, PathVisitor.fromMethodsObject(newVisitor || this.visitor));
|
|
46154
46154
|
};
|
|
46155
|
-
sharedContextProtoMethods.visit = function
|
|
46155
|
+
sharedContextProtoMethods.visit = function visit13(path2, newVisitor) {
|
|
46156
46156
|
if (!(this instanceof this.Context)) {
|
|
46157
46157
|
throw new Error("");
|
|
46158
46158
|
}
|
|
@@ -46190,13 +46190,13 @@ var require_equiv = __commonJS({
|
|
|
46190
46190
|
var shared_1 = require_shared();
|
|
46191
46191
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
46192
46192
|
function default_1(fork) {
|
|
46193
|
-
var
|
|
46194
|
-
var getFieldNames =
|
|
46195
|
-
var getFieldValue =
|
|
46196
|
-
var isArray =
|
|
46197
|
-
var isObject2 =
|
|
46198
|
-
var isDate =
|
|
46199
|
-
var isRegExp =
|
|
46193
|
+
var types16 = fork.use(types_1.default);
|
|
46194
|
+
var getFieldNames = types16.getFieldNames;
|
|
46195
|
+
var getFieldValue = types16.getFieldValue;
|
|
46196
|
+
var isArray = types16.builtInTypes.array;
|
|
46197
|
+
var isObject2 = types16.builtInTypes.object;
|
|
46198
|
+
var isDate = types16.builtInTypes.Date;
|
|
46199
|
+
var isRegExp = types16.builtInTypes.RegExp;
|
|
46200
46200
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
46201
46201
|
function astNodesAreEquivalent(a, b, problemPath) {
|
|
46202
46202
|
if (isArray.check(problemPath)) {
|
|
@@ -46349,24 +46349,24 @@ var require_fork = __commonJS({
|
|
|
46349
46349
|
var shared_1 = require_shared();
|
|
46350
46350
|
function default_1(plugins) {
|
|
46351
46351
|
var fork = createFork();
|
|
46352
|
-
var
|
|
46352
|
+
var types16 = fork.use(types_1.default);
|
|
46353
46353
|
plugins.forEach(fork.use);
|
|
46354
|
-
|
|
46354
|
+
types16.finalize();
|
|
46355
46355
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
46356
46356
|
return {
|
|
46357
|
-
Type:
|
|
46358
|
-
builtInTypes:
|
|
46359
|
-
namedTypes:
|
|
46360
|
-
builders:
|
|
46361
|
-
defineMethod:
|
|
46362
|
-
getFieldNames:
|
|
46363
|
-
getFieldValue:
|
|
46364
|
-
eachField:
|
|
46365
|
-
someField:
|
|
46366
|
-
getSupertypeNames:
|
|
46367
|
-
getBuilderName:
|
|
46357
|
+
Type: types16.Type,
|
|
46358
|
+
builtInTypes: types16.builtInTypes,
|
|
46359
|
+
namedTypes: types16.namedTypes,
|
|
46360
|
+
builders: types16.builders,
|
|
46361
|
+
defineMethod: types16.defineMethod,
|
|
46362
|
+
getFieldNames: types16.getFieldNames,
|
|
46363
|
+
getFieldValue: types16.getFieldValue,
|
|
46364
|
+
eachField: types16.eachField,
|
|
46365
|
+
someField: types16.someField,
|
|
46366
|
+
getSupertypeNames: types16.getSupertypeNames,
|
|
46367
|
+
getBuilderName: types16.getBuilderName,
|
|
46368
46368
|
astNodesAreEquivalent: fork.use(equiv_1.default),
|
|
46369
|
-
finalize:
|
|
46369
|
+
finalize: types16.finalize,
|
|
46370
46370
|
Path: fork.use(path_1.default),
|
|
46371
46371
|
NodePath: fork.use(node_path_1.default),
|
|
46372
46372
|
PathVisitor,
|
|
@@ -46536,8 +46536,8 @@ var require_core2 = __commonJS({
|
|
|
46536
46536
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
46537
46537
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46538
46538
|
function default_1(fork) {
|
|
46539
|
-
var
|
|
46540
|
-
var Type =
|
|
46539
|
+
var types16 = fork.use(types_1.default);
|
|
46540
|
+
var Type = types16.Type;
|
|
46541
46541
|
var def = Type.def;
|
|
46542
46542
|
var or = Type.or;
|
|
46543
46543
|
var shared = fork.use(shared_1.default);
|
|
@@ -46629,9 +46629,9 @@ var require_es6 = __commonJS({
|
|
|
46629
46629
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46630
46630
|
function default_1(fork) {
|
|
46631
46631
|
fork.use(core_1.default);
|
|
46632
|
-
var
|
|
46633
|
-
var def =
|
|
46634
|
-
var or =
|
|
46632
|
+
var types16 = fork.use(types_1.default);
|
|
46633
|
+
var def = types16.Type.def;
|
|
46634
|
+
var or = types16.Type.or;
|
|
46635
46635
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46636
46636
|
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"]);
|
|
46637
46637
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
@@ -46721,8 +46721,8 @@ var require_es2017 = __commonJS({
|
|
|
46721
46721
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46722
46722
|
function default_1(fork) {
|
|
46723
46723
|
fork.use(es2016_1.default);
|
|
46724
|
-
var
|
|
46725
|
-
var def =
|
|
46724
|
+
var types16 = fork.use(types_1.default);
|
|
46725
|
+
var def = types16.Type.def;
|
|
46726
46726
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46727
46727
|
def("Function").field("async", Boolean, defaults["false"]);
|
|
46728
46728
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
@@ -46745,9 +46745,9 @@ var require_es2018 = __commonJS({
|
|
|
46745
46745
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46746
46746
|
function default_1(fork) {
|
|
46747
46747
|
fork.use(es2017_1.default);
|
|
46748
|
-
var
|
|
46749
|
-
var def =
|
|
46750
|
-
var or =
|
|
46748
|
+
var types16 = fork.use(types_1.default);
|
|
46749
|
+
var def = types16.Type.def;
|
|
46750
|
+
var or = types16.Type.or;
|
|
46751
46751
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46752
46752
|
def("ForOfStatement").field("await", Boolean, defaults["false"]);
|
|
46753
46753
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -46778,9 +46778,9 @@ var require_es2019 = __commonJS({
|
|
|
46778
46778
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46779
46779
|
function default_1(fork) {
|
|
46780
46780
|
fork.use(es2018_1.default);
|
|
46781
|
-
var
|
|
46782
|
-
var def =
|
|
46783
|
-
var or =
|
|
46781
|
+
var types16 = fork.use(types_1.default);
|
|
46782
|
+
var def = types16.Type.def;
|
|
46783
|
+
var or = types16.Type.or;
|
|
46784
46784
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46785
46785
|
def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]);
|
|
46786
46786
|
}
|
|
@@ -46804,9 +46804,9 @@ var require_es20202 = __commonJS({
|
|
|
46804
46804
|
function default_1(fork) {
|
|
46805
46805
|
fork.use(es2020_1.default);
|
|
46806
46806
|
fork.use(es2019_1.default);
|
|
46807
|
-
var
|
|
46808
|
-
var def =
|
|
46809
|
-
var or =
|
|
46807
|
+
var types16 = fork.use(types_1.default);
|
|
46808
|
+
var def = types16.Type.def;
|
|
46809
|
+
var or = types16.Type.or;
|
|
46810
46810
|
var shared = fork.use(shared_1.default);
|
|
46811
46811
|
var defaults = shared.defaults;
|
|
46812
46812
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
@@ -46856,8 +46856,8 @@ var require_es2022 = __commonJS({
|
|
|
46856
46856
|
var shared_1 = require_shared();
|
|
46857
46857
|
function default_1(fork) {
|
|
46858
46858
|
fork.use(es2021_1.default);
|
|
46859
|
-
var
|
|
46860
|
-
var def =
|
|
46859
|
+
var types16 = fork.use(types_1.default);
|
|
46860
|
+
var def = types16.Type.def;
|
|
46861
46861
|
def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
|
|
46862
46862
|
}
|
|
46863
46863
|
exports.default = default_1;
|
|
@@ -46878,9 +46878,9 @@ var require_es_proposals = __commonJS({
|
|
|
46878
46878
|
var es2022_1 = tslib_1.__importDefault(require_es2022());
|
|
46879
46879
|
function default_1(fork) {
|
|
46880
46880
|
fork.use(es2022_1.default);
|
|
46881
|
-
var
|
|
46882
|
-
var Type =
|
|
46883
|
-
var def =
|
|
46881
|
+
var types16 = fork.use(types_1.default);
|
|
46882
|
+
var Type = types16.Type;
|
|
46883
|
+
var def = types16.Type.def;
|
|
46884
46884
|
var or = Type.or;
|
|
46885
46885
|
var shared = fork.use(shared_1.default);
|
|
46886
46886
|
var defaults = shared.defaults;
|
|
@@ -46920,9 +46920,9 @@ var require_jsx = __commonJS({
|
|
|
46920
46920
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46921
46921
|
function default_1(fork) {
|
|
46922
46922
|
fork.use(es_proposals_1.default);
|
|
46923
|
-
var
|
|
46924
|
-
var def =
|
|
46925
|
-
var or =
|
|
46923
|
+
var types16 = fork.use(types_1.default);
|
|
46924
|
+
var def = types16.Type.def;
|
|
46925
|
+
var or = types16.Type.or;
|
|
46926
46926
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46927
46927
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
46928
46928
|
def("Literal"),
|
|
@@ -46980,9 +46980,9 @@ var require_type_annotations = __commonJS({
|
|
|
46980
46980
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
46981
46981
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46982
46982
|
function default_1(fork) {
|
|
46983
|
-
var
|
|
46984
|
-
var def =
|
|
46985
|
-
var or =
|
|
46983
|
+
var types16 = fork.use(types_1.default);
|
|
46984
|
+
var def = types16.Type.def;
|
|
46985
|
+
var or = types16.Type.or;
|
|
46986
46986
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46987
46987
|
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
|
|
46988
46988
|
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
|
|
@@ -47017,9 +47017,9 @@ var require_flow = __commonJS({
|
|
|
47017
47017
|
function default_1(fork) {
|
|
47018
47018
|
fork.use(es_proposals_1.default);
|
|
47019
47019
|
fork.use(type_annotations_1.default);
|
|
47020
|
-
var
|
|
47021
|
-
var def =
|
|
47022
|
-
var or =
|
|
47020
|
+
var types16 = fork.use(types_1.default);
|
|
47021
|
+
var def = types16.Type.def;
|
|
47022
|
+
var or = types16.Type.or;
|
|
47023
47023
|
var defaults = fork.use(shared_1.default).defaults;
|
|
47024
47024
|
def("Flow").bases("Node");
|
|
47025
47025
|
def("FlowType").bases("Flow");
|
|
@@ -47133,10 +47133,10 @@ var require_esprima = __commonJS({
|
|
|
47133
47133
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
47134
47134
|
function default_1(fork) {
|
|
47135
47135
|
fork.use(es_proposals_1.default);
|
|
47136
|
-
var
|
|
47136
|
+
var types16 = fork.use(types_1.default);
|
|
47137
47137
|
var defaults = fork.use(shared_1.default).defaults;
|
|
47138
|
-
var def =
|
|
47139
|
-
var or =
|
|
47138
|
+
var def = types16.Type.def;
|
|
47139
|
+
var or = types16.Type.or;
|
|
47140
47140
|
def("VariableDeclaration").field("declarations", [or(
|
|
47141
47141
|
def("VariableDeclarator"),
|
|
47142
47142
|
def("Identifier")
|
|
@@ -47181,11 +47181,11 @@ var require_babel_core = __commonJS({
|
|
|
47181
47181
|
function default_1(fork) {
|
|
47182
47182
|
var _a, _b, _c, _d, _e;
|
|
47183
47183
|
fork.use(es_proposals_1.default);
|
|
47184
|
-
var
|
|
47184
|
+
var types16 = fork.use(types_1.default);
|
|
47185
47185
|
var defaults = fork.use(shared_1.default).defaults;
|
|
47186
|
-
var def =
|
|
47187
|
-
var or =
|
|
47188
|
-
var isUndefined =
|
|
47186
|
+
var def = types16.Type.def;
|
|
47187
|
+
var or = types16.Type.or;
|
|
47188
|
+
var isUndefined = types16.builtInTypes.undefined;
|
|
47189
47189
|
def("Noop").bases("Statement").build();
|
|
47190
47190
|
def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
|
|
47191
47191
|
def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
|
|
@@ -47210,7 +47210,7 @@ var require_babel_core = __commonJS({
|
|
|
47210
47210
|
raw: String
|
|
47211
47211
|
},
|
|
47212
47212
|
function getDefault() {
|
|
47213
|
-
var value =
|
|
47213
|
+
var value = types16.getFieldValue(this, "value");
|
|
47214
47214
|
return {
|
|
47215
47215
|
rawValue: value,
|
|
47216
47216
|
raw: toRaw ? toRaw(value) : String(value)
|
|
@@ -47313,8 +47313,8 @@ var require_babel = __commonJS({
|
|
|
47313
47313
|
var flow_1 = tslib_1.__importDefault(require_flow());
|
|
47314
47314
|
var shared_1 = require_shared();
|
|
47315
47315
|
function default_1(fork) {
|
|
47316
|
-
var
|
|
47317
|
-
var def =
|
|
47316
|
+
var types16 = fork.use(types_1.default);
|
|
47317
|
+
var def = types16.Type.def;
|
|
47318
47318
|
fork.use(babel_core_1.default);
|
|
47319
47319
|
fork.use(flow_1.default);
|
|
47320
47320
|
def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
|
|
@@ -47340,12 +47340,12 @@ var require_typescript = __commonJS({
|
|
|
47340
47340
|
function default_1(fork) {
|
|
47341
47341
|
fork.use(babel_core_1.default);
|
|
47342
47342
|
fork.use(type_annotations_1.default);
|
|
47343
|
-
var
|
|
47344
|
-
var n =
|
|
47345
|
-
var def =
|
|
47346
|
-
var or =
|
|
47343
|
+
var types16 = fork.use(types_1.default);
|
|
47344
|
+
var n = types16.namedTypes;
|
|
47345
|
+
var def = types16.Type.def;
|
|
47346
|
+
var or = types16.Type.or;
|
|
47347
47347
|
var defaults = fork.use(shared_1.default).defaults;
|
|
47348
|
-
var StringLiteral =
|
|
47348
|
+
var StringLiteral = types16.Type.from(function(value, deep) {
|
|
47349
47349
|
if (n.StringLiteral && n.StringLiteral.check(value, deep)) {
|
|
47350
47350
|
return true;
|
|
47351
47351
|
}
|
|
@@ -47545,7 +47545,7 @@ var require_main = __commonJS({
|
|
|
47545
47545
|
var someField = _a.someField;
|
|
47546
47546
|
var Type = _a.Type;
|
|
47547
47547
|
var use = _a.use;
|
|
47548
|
-
var
|
|
47548
|
+
var visit13 = _a.visit;
|
|
47549
47549
|
exports.astNodesAreEquivalent = astNodesAreEquivalent;
|
|
47550
47550
|
exports.builders = builders;
|
|
47551
47551
|
exports.builtInTypes = builtInTypes;
|
|
@@ -47562,7 +47562,7 @@ var require_main = __commonJS({
|
|
|
47562
47562
|
exports.someField = someField;
|
|
47563
47563
|
exports.Type = Type;
|
|
47564
47564
|
exports.use = use;
|
|
47565
|
-
exports.visit =
|
|
47565
|
+
exports.visit = visit13;
|
|
47566
47566
|
Object.assign(namedTypes_1.namedTypes, n);
|
|
47567
47567
|
}
|
|
47568
47568
|
});
|
|
@@ -49321,8 +49321,8 @@ var require_util2 = __commonJS({
|
|
|
49321
49321
|
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;
|
|
49322
49322
|
var tslib_1 = require_tslib();
|
|
49323
49323
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
49324
|
-
var
|
|
49325
|
-
var n =
|
|
49324
|
+
var types16 = tslib_1.__importStar(require_main());
|
|
49325
|
+
var n = types16.namedTypes;
|
|
49326
49326
|
var source_map_1 = tslib_1.__importDefault(require_source_map());
|
|
49327
49327
|
var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
|
|
49328
49328
|
var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
|
|
@@ -56640,10 +56640,10 @@ var require_comments = __commonJS({
|
|
|
56640
56640
|
exports.printComments = exports.attach = void 0;
|
|
56641
56641
|
var tslib_1 = require_tslib();
|
|
56642
56642
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
56643
|
-
var
|
|
56644
|
-
var n =
|
|
56645
|
-
var isArray =
|
|
56646
|
-
var isObject2 =
|
|
56643
|
+
var types16 = tslib_1.__importStar(require_main());
|
|
56644
|
+
var n = types16.namedTypes;
|
|
56645
|
+
var isArray = types16.builtInTypes.array;
|
|
56646
|
+
var isObject2 = types16.builtInTypes.object;
|
|
56647
56647
|
var lines_1 = require_lines();
|
|
56648
56648
|
var util_1 = require_util2();
|
|
56649
56649
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -56674,7 +56674,7 @@ var require_comments = __commonJS({
|
|
|
56674
56674
|
if (isArray.check(node)) {
|
|
56675
56675
|
names = Object.keys(node);
|
|
56676
56676
|
} else if (isObject2.check(node)) {
|
|
56677
|
-
names =
|
|
56677
|
+
names = types16.getFieldNames(node);
|
|
56678
56678
|
} else {
|
|
56679
56679
|
return resultArray;
|
|
56680
56680
|
}
|
|
@@ -56852,7 +56852,7 @@ var require_comments = __commonJS({
|
|
|
56852
56852
|
function printComments(path2, print12) {
|
|
56853
56853
|
var value = path2.getValue();
|
|
56854
56854
|
var innerLines = print12(path2);
|
|
56855
|
-
var comments = n.Node.check(value) &&
|
|
56855
|
+
var comments = n.Node.check(value) && types16.getFieldValue(value, "comments");
|
|
56856
56856
|
if (!comments || comments.length === 0) {
|
|
56857
56857
|
return innerLines;
|
|
56858
56858
|
}
|
|
@@ -56860,8 +56860,8 @@ var require_comments = __commonJS({
|
|
|
56860
56860
|
var trailingParts = [innerLines];
|
|
56861
56861
|
path2.each(function(commentPath) {
|
|
56862
56862
|
var comment = commentPath.getValue();
|
|
56863
|
-
var leading =
|
|
56864
|
-
var trailing =
|
|
56863
|
+
var leading = types16.getFieldValue(comment, "leading");
|
|
56864
|
+
var trailing = types16.getFieldValue(comment, "trailing");
|
|
56865
56865
|
if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
56866
56866
|
leadingParts.push(printLeadingComment(commentPath, print12));
|
|
56867
56867
|
} else if (trailing) {
|
|
@@ -56883,10 +56883,10 @@ var require_parser2 = __commonJS({
|
|
|
56883
56883
|
exports.parse = void 0;
|
|
56884
56884
|
var tslib_1 = require_tslib();
|
|
56885
56885
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
56886
|
-
var
|
|
56887
|
-
var b =
|
|
56888
|
-
var isObject2 =
|
|
56889
|
-
var isArray =
|
|
56886
|
+
var types16 = tslib_1.__importStar(require_main());
|
|
56887
|
+
var b = types16.builders;
|
|
56888
|
+
var isObject2 = types16.builtInTypes.object;
|
|
56889
|
+
var isArray = types16.builtInTypes.array;
|
|
56890
56890
|
var options_1 = require_options();
|
|
56891
56891
|
var lines_1 = require_lines();
|
|
56892
56892
|
var comments_1 = require_comments();
|
|
@@ -57072,11 +57072,11 @@ var require_fast_path = __commonJS({
|
|
|
57072
57072
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57073
57073
|
var tslib_1 = require_tslib();
|
|
57074
57074
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
57075
|
-
var
|
|
57075
|
+
var types16 = tslib_1.__importStar(require_main());
|
|
57076
57076
|
var util = tslib_1.__importStar(require_util2());
|
|
57077
|
-
var n =
|
|
57078
|
-
var isArray =
|
|
57079
|
-
var isNumber =
|
|
57077
|
+
var n = types16.namedTypes;
|
|
57078
|
+
var isArray = types16.builtInTypes.array;
|
|
57079
|
+
var isNumber = types16.builtInTypes.number;
|
|
57080
57080
|
var PRECEDENCE = {};
|
|
57081
57081
|
[
|
|
57082
57082
|
["??"],
|
|
@@ -57105,7 +57105,7 @@ var require_fast_path = __commonJS({
|
|
|
57105
57105
|
if (obj instanceof FastPath) {
|
|
57106
57106
|
return obj.copy();
|
|
57107
57107
|
}
|
|
57108
|
-
if (obj instanceof
|
|
57108
|
+
if (obj instanceof types16.NodePath) {
|
|
57109
57109
|
var copy = Object.create(FastPath.prototype);
|
|
57110
57110
|
var stack = [obj.value];
|
|
57111
57111
|
for (var pp = void 0; pp = obj.parentPath; obj = pp)
|
|
@@ -57416,7 +57416,7 @@ var require_fast_path = __commonJS({
|
|
|
57416
57416
|
return node.some(containsCallExpression);
|
|
57417
57417
|
}
|
|
57418
57418
|
if (n.Node.check(node)) {
|
|
57419
|
-
return
|
|
57419
|
+
return types16.someField(node, function(_name, child) {
|
|
57420
57420
|
return containsCallExpression(child);
|
|
57421
57421
|
});
|
|
57422
57422
|
}
|
|
@@ -57506,16 +57506,16 @@ var require_patcher = __commonJS({
|
|
|
57506
57506
|
var tslib_1 = require_tslib();
|
|
57507
57507
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
57508
57508
|
var linesModule = tslib_1.__importStar(require_lines());
|
|
57509
|
-
var
|
|
57510
|
-
var Printable =
|
|
57511
|
-
var Expression =
|
|
57512
|
-
var ReturnStatement =
|
|
57513
|
-
var SourceLocation =
|
|
57509
|
+
var types16 = tslib_1.__importStar(require_main());
|
|
57510
|
+
var Printable = types16.namedTypes.Printable;
|
|
57511
|
+
var Expression = types16.namedTypes.Expression;
|
|
57512
|
+
var ReturnStatement = types16.namedTypes.ReturnStatement;
|
|
57513
|
+
var SourceLocation = types16.namedTypes.SourceLocation;
|
|
57514
57514
|
var util_1 = require_util2();
|
|
57515
57515
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
57516
|
-
var isObject2 =
|
|
57517
|
-
var isArray =
|
|
57518
|
-
var isString =
|
|
57516
|
+
var isObject2 = types16.builtInTypes.object;
|
|
57517
|
+
var isArray = types16.builtInTypes.array;
|
|
57518
|
+
var isString = types16.builtInTypes.string;
|
|
57519
57519
|
var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
|
|
57520
57520
|
var Patcher = function Patcher2(lines) {
|
|
57521
57521
|
assert_1.default.ok(this instanceof Patcher2);
|
|
@@ -57785,8 +57785,8 @@ var require_patcher = __commonJS({
|
|
|
57785
57785
|
if (k.charAt(0) === "_") {
|
|
57786
57786
|
continue;
|
|
57787
57787
|
}
|
|
57788
|
-
newPath.stack.push(k,
|
|
57789
|
-
oldPath.stack.push(k,
|
|
57788
|
+
newPath.stack.push(k, types16.getFieldValue(newNode, k));
|
|
57789
|
+
oldPath.stack.push(k, types16.getFieldValue(oldNode, k));
|
|
57790
57790
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
57791
57791
|
newPath.stack.length -= 2;
|
|
57792
57792
|
oldPath.stack.length -= 2;
|
|
@@ -57810,16 +57810,16 @@ var require_printer2 = __commonJS({
|
|
|
57810
57810
|
exports.Printer = void 0;
|
|
57811
57811
|
var tslib_1 = require_tslib();
|
|
57812
57812
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
57813
|
-
var
|
|
57813
|
+
var types16 = tslib_1.__importStar(require_main());
|
|
57814
57814
|
var comments_1 = require_comments();
|
|
57815
57815
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
57816
57816
|
var lines_1 = require_lines();
|
|
57817
57817
|
var options_1 = require_options();
|
|
57818
57818
|
var patcher_1 = require_patcher();
|
|
57819
57819
|
var util = tslib_1.__importStar(require_util2());
|
|
57820
|
-
var namedTypes =
|
|
57821
|
-
var isString =
|
|
57822
|
-
var isObject2 =
|
|
57820
|
+
var namedTypes = types16.namedTypes;
|
|
57821
|
+
var isString = types16.builtInTypes.string;
|
|
57822
|
+
var isObject2 = types16.builtInTypes.object;
|
|
57823
57823
|
var PrintResult = function PrintResult2(code, sourceMap) {
|
|
57824
57824
|
assert_1.default.ok(this instanceof PrintResult2);
|
|
57825
57825
|
isString.assert(code);
|
|
@@ -57981,7 +57981,7 @@ var require_printer2 = __commonJS({
|
|
|
57981
57981
|
case "OptionalMemberExpression": {
|
|
57982
57982
|
parts.push(path2.call(print12, "object"));
|
|
57983
57983
|
var property = path2.call(print12, "property");
|
|
57984
|
-
var optional =
|
|
57984
|
+
var optional = types16.getFieldValue(n, "optional");
|
|
57985
57985
|
if (n.computed) {
|
|
57986
57986
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
57987
57987
|
} else {
|
|
@@ -58252,7 +58252,7 @@ var require_printer2 = __commonJS({
|
|
|
58252
58252
|
if (n.typeArguments) {
|
|
58253
58253
|
parts.push(path2.call(print12, "typeArguments"));
|
|
58254
58254
|
}
|
|
58255
|
-
if (
|
|
58255
|
+
if (types16.getFieldValue(n, "optional")) {
|
|
58256
58256
|
parts.push("?.");
|
|
58257
58257
|
}
|
|
58258
58258
|
parts.push(printArgumentsList(path2, options, print12));
|
|
@@ -59931,8 +59931,8 @@ var require_printer2 = __commonJS({
|
|
|
59931
59931
|
});
|
|
59932
59932
|
}
|
|
59933
59933
|
function getPossibleRaw(node) {
|
|
59934
|
-
var value =
|
|
59935
|
-
var extra =
|
|
59934
|
+
var value = types16.getFieldValue(node, "value");
|
|
59935
|
+
var extra = types16.getFieldValue(node, "extra");
|
|
59936
59936
|
if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
|
|
59937
59937
|
return extra.raw;
|
|
59938
59938
|
}
|
|
@@ -59980,8 +59980,8 @@ var require_main2 = __commonJS({
|
|
|
59980
59980
|
exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
|
|
59981
59981
|
var tslib_1 = require_tslib();
|
|
59982
59982
|
var fs_1 = tslib_1.__importDefault(__require("fs"));
|
|
59983
|
-
var
|
|
59984
|
-
exports.types =
|
|
59983
|
+
var types16 = tslib_1.__importStar(require_main());
|
|
59984
|
+
exports.types = types16;
|
|
59985
59985
|
var parser_1 = require_parser2();
|
|
59986
59986
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
|
|
59987
59987
|
return parser_1.parse;
|
|
@@ -59995,10 +59995,10 @@ var require_main2 = __commonJS({
|
|
|
59995
59995
|
return new printer_1.Printer(options).print(node);
|
|
59996
59996
|
}
|
|
59997
59997
|
exports.print = print12;
|
|
59998
|
-
function
|
|
59998
|
+
function prettyPrint3(node, options) {
|
|
59999
59999
|
return new printer_1.Printer(options).printGenerically(node);
|
|
60000
60000
|
}
|
|
60001
|
-
exports.prettyPrint =
|
|
60001
|
+
exports.prettyPrint = prettyPrint3;
|
|
60002
60002
|
function run(transformer, options) {
|
|
60003
60003
|
return runFile(process.argv[2], transformer, options);
|
|
60004
60004
|
}
|
|
@@ -65954,7 +65954,7 @@ var printDocASTReducer = {
|
|
|
65954
65954
|
leave: ({ name: name2, interfaces, directives, fields }) => join(["interface", name2, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
65955
65955
|
},
|
|
65956
65956
|
UnionTypeDefinition: {
|
|
65957
|
-
leave: ({ name: name2, directives, types:
|
|
65957
|
+
leave: ({ name: name2, directives, types: types16 }) => join(["union", name2, join(directives, " "), wrap("= ", join(types16, " | "))], " ")
|
|
65958
65958
|
},
|
|
65959
65959
|
EnumTypeDefinition: {
|
|
65960
65960
|
leave: ({ name: name2, directives, values }) => join(["enum", name2, join(directives, " "), block(values)], " ")
|
|
@@ -65981,7 +65981,7 @@ var printDocASTReducer = {
|
|
|
65981
65981
|
leave: ({ name: name2, interfaces, directives, fields }) => join(["extend interface", name2, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
65982
65982
|
},
|
|
65983
65983
|
UnionTypeExtension: {
|
|
65984
|
-
leave: ({ name: name2, directives, types:
|
|
65984
|
+
leave: ({ name: name2, directives, types: types16 }) => join(["extend union", name2, join(directives, " "), wrap("= ", join(types16, " | "))], " ")
|
|
65985
65985
|
},
|
|
65986
65986
|
EnumTypeExtension: {
|
|
65987
65987
|
leave: ({ name: name2, directives, values }) => join(["extend enum", name2, join(directives, " "), block(values)], " ")
|
|
@@ -66861,8 +66861,8 @@ function healTypes(originalTypeMap, directives) {
|
|
|
66861
66861
|
}
|
|
66862
66862
|
}
|
|
66863
66863
|
function healUnderlyingTypes(type) {
|
|
66864
|
-
const
|
|
66865
|
-
|
|
66864
|
+
const types16 = type.getTypes();
|
|
66865
|
+
types16.push(...types16.splice(0).map((t2) => healType(t2)).filter(Boolean));
|
|
66866
66866
|
}
|
|
66867
66867
|
function healType(type) {
|
|
66868
66868
|
if ((0, import_graphql11.isListType)(type)) {
|
|
@@ -67646,11 +67646,11 @@ function mergeEnum(e1, e2, config2) {
|
|
|
67646
67646
|
|
|
67647
67647
|
// ../../node_modules/.pnpm/@graphql-tools+merge@8.3.14_graphql@15.8.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/utils.js
|
|
67648
67648
|
var import_graphql20 = __toESM(require_graphql2(), 1);
|
|
67649
|
-
function isStringTypes(
|
|
67650
|
-
return typeof
|
|
67649
|
+
function isStringTypes(types16) {
|
|
67650
|
+
return typeof types16 === "string";
|
|
67651
67651
|
}
|
|
67652
|
-
function isSourceTypes(
|
|
67653
|
-
return
|
|
67652
|
+
function isSourceTypes(types16) {
|
|
67653
|
+
return types16 instanceof import_graphql20.Source;
|
|
67654
67654
|
}
|
|
67655
67655
|
function extractType(type) {
|
|
67656
67656
|
let visitedType = type;
|
|
@@ -68676,8 +68676,8 @@ var List = class {
|
|
|
68676
68676
|
} else {
|
|
68677
68677
|
entries = this.cache._internal_unstable.storage.get(value, "edges").value;
|
|
68678
68678
|
}
|
|
68679
|
-
for (let
|
|
68680
|
-
yield
|
|
68679
|
+
for (let record2 of entries) {
|
|
68680
|
+
yield record2;
|
|
68681
68681
|
}
|
|
68682
68682
|
}
|
|
68683
68683
|
};
|
|
@@ -68726,6 +68726,46 @@ var ListCollection = class {
|
|
|
68726
68726
|
}
|
|
68727
68727
|
};
|
|
68728
68728
|
|
|
68729
|
+
// src/runtime/cache/schema.ts
|
|
68730
|
+
var SchemaManager = class {
|
|
68731
|
+
cache;
|
|
68732
|
+
fieldTypes = {};
|
|
68733
|
+
constructor(cache) {
|
|
68734
|
+
this.cache = cache;
|
|
68735
|
+
}
|
|
68736
|
+
setFieldType({
|
|
68737
|
+
parent,
|
|
68738
|
+
key,
|
|
68739
|
+
type,
|
|
68740
|
+
nullable = false,
|
|
68741
|
+
link
|
|
68742
|
+
}) {
|
|
68743
|
+
let parensIndex = key.indexOf("(");
|
|
68744
|
+
if (parensIndex !== -1) {
|
|
68745
|
+
key = key.substring(0, parensIndex);
|
|
68746
|
+
}
|
|
68747
|
+
if (parent === rootID) {
|
|
68748
|
+
parent = "Query";
|
|
68749
|
+
} else if (parent.includes(":")) {
|
|
68750
|
+
parent = parent.substring(0, parent.indexOf(":"));
|
|
68751
|
+
}
|
|
68752
|
+
if (!this.fieldTypes[parent]) {
|
|
68753
|
+
this.fieldTypes[parent] = {};
|
|
68754
|
+
}
|
|
68755
|
+
this.fieldTypes[parent][key] = {
|
|
68756
|
+
type,
|
|
68757
|
+
nullable,
|
|
68758
|
+
link: !!link
|
|
68759
|
+
};
|
|
68760
|
+
}
|
|
68761
|
+
fieldType(type, field) {
|
|
68762
|
+
return this.fieldTypes[type]?.[field] || null;
|
|
68763
|
+
}
|
|
68764
|
+
get config() {
|
|
68765
|
+
return this.cache._internal_unstable.config;
|
|
68766
|
+
}
|
|
68767
|
+
};
|
|
68768
|
+
|
|
68729
68769
|
// src/runtime/cache/storage.ts
|
|
68730
68770
|
var InMemoryStorage = class {
|
|
68731
68771
|
data;
|
|
@@ -69293,7 +69333,7 @@ var InMemorySubscriptions = class {
|
|
|
69293
69333
|
};
|
|
69294
69334
|
|
|
69295
69335
|
// src/runtime/cache/cache.ts
|
|
69296
|
-
var
|
|
69336
|
+
var Cache3 = class {
|
|
69297
69337
|
_internal_unstable;
|
|
69298
69338
|
constructor(config2) {
|
|
69299
69339
|
this._internal_unstable = new CacheInternal({
|
|
@@ -69301,7 +69341,8 @@ var Cache2 = class {
|
|
|
69301
69341
|
storage: new InMemoryStorage(),
|
|
69302
69342
|
subscriptions: new InMemorySubscriptions(this),
|
|
69303
69343
|
lists: new ListManager(this, rootID),
|
|
69304
|
-
lifetimes: new GarbageCollector(this)
|
|
69344
|
+
lifetimes: new GarbageCollector(this),
|
|
69345
|
+
schema: new SchemaManager(this)
|
|
69305
69346
|
});
|
|
69306
69347
|
if (config2) {
|
|
69307
69348
|
this.setConfig(defaultConfigValues(config2));
|
|
@@ -69387,18 +69428,21 @@ var CacheInternal = class {
|
|
|
69387
69428
|
lists;
|
|
69388
69429
|
cache;
|
|
69389
69430
|
lifetimes;
|
|
69431
|
+
schema;
|
|
69390
69432
|
constructor({
|
|
69391
69433
|
storage,
|
|
69392
69434
|
subscriptions,
|
|
69393
69435
|
lists,
|
|
69394
69436
|
cache,
|
|
69395
|
-
lifetimes
|
|
69437
|
+
lifetimes,
|
|
69438
|
+
schema
|
|
69396
69439
|
}) {
|
|
69397
69440
|
this.storage = storage;
|
|
69398
69441
|
this.subscriptions = subscriptions;
|
|
69399
69442
|
this.lists = lists;
|
|
69400
69443
|
this.cache = cache;
|
|
69401
69444
|
this.lifetimes = lifetimes;
|
|
69445
|
+
this.schema = schema;
|
|
69402
69446
|
this._disabled = typeof globalThis.window === "undefined";
|
|
69403
69447
|
try {
|
|
69404
69448
|
if (process.env.HOUDINI_TEST === "true") {
|
|
@@ -69414,7 +69458,6 @@ var CacheInternal = class {
|
|
|
69414
69458
|
data,
|
|
69415
69459
|
selection: selection2,
|
|
69416
69460
|
variables = {},
|
|
69417
|
-
root = rootID,
|
|
69418
69461
|
parent = rootID,
|
|
69419
69462
|
applyUpdates = false,
|
|
69420
69463
|
layer,
|
|
@@ -69437,9 +69480,17 @@ var CacheInternal = class {
|
|
|
69437
69480
|
selection: fieldSelection,
|
|
69438
69481
|
operations,
|
|
69439
69482
|
abstract: isAbstract,
|
|
69440
|
-
update
|
|
69483
|
+
update,
|
|
69484
|
+
nullable
|
|
69441
69485
|
} = targetSelection[field];
|
|
69442
69486
|
const key = evaluateKey(keyRaw, variables);
|
|
69487
|
+
this.schema.setFieldType({
|
|
69488
|
+
parent,
|
|
69489
|
+
key: keyRaw,
|
|
69490
|
+
type: linkedType,
|
|
69491
|
+
nullable,
|
|
69492
|
+
link: !!fieldSelection
|
|
69493
|
+
});
|
|
69443
69494
|
const currentSubscribers = this.subscriptions.get(parent, key);
|
|
69444
69495
|
const { value: previousValue, displayLayers } = this.storage.get(parent, key);
|
|
69445
69496
|
const displayLayer = layer.isDisplayLayer(displayLayers);
|
|
@@ -69508,7 +69559,6 @@ var CacheInternal = class {
|
|
|
69508
69559
|
}
|
|
69509
69560
|
if (linkedID) {
|
|
69510
69561
|
this.writeSelection({
|
|
69511
|
-
root,
|
|
69512
69562
|
selection: fieldSelection,
|
|
69513
69563
|
parent: linkedID,
|
|
69514
69564
|
data: value,
|
|
@@ -69899,7 +69949,7 @@ var CacheInternal = class {
|
|
|
69899
69949
|
var rootID = "_ROOT_";
|
|
69900
69950
|
|
|
69901
69951
|
// src/runtime/cache/index.ts
|
|
69902
|
-
var cache_default = new
|
|
69952
|
+
var cache_default = new Cache3();
|
|
69903
69953
|
|
|
69904
69954
|
// src/runtime/lib/types.ts
|
|
69905
69955
|
var CompiledFragmentKind = "HoudiniFragment" /* Fragment */;
|
|
@@ -70091,6 +70141,7 @@ async function writeFile(filepath, data) {
|
|
|
70091
70141
|
return;
|
|
70092
70142
|
}
|
|
70093
70143
|
if (houdini_mode.is_testing) {
|
|
70144
|
+
import_memfs.fs.mkdirpSync(dirname(filepath));
|
|
70094
70145
|
return import_memfs.fs.writeFileSync(filepath, data);
|
|
70095
70146
|
}
|
|
70096
70147
|
return await fs.writeFile(filepath, data, "utf8");
|
|
@@ -71457,7 +71508,6 @@ var Config = class {
|
|
|
71457
71508
|
rootDir;
|
|
71458
71509
|
projectRoot;
|
|
71459
71510
|
schema;
|
|
71460
|
-
apiUrl;
|
|
71461
71511
|
schemaPath;
|
|
71462
71512
|
persistedQueryPath;
|
|
71463
71513
|
exclude;
|
|
@@ -71497,7 +71547,6 @@ var Config = class {
|
|
|
71497
71547
|
schema,
|
|
71498
71548
|
schemaPath = "./schema.graphql",
|
|
71499
71549
|
exclude = [],
|
|
71500
|
-
apiUrl,
|
|
71501
71550
|
module = "esm",
|
|
71502
71551
|
scalars,
|
|
71503
71552
|
cacheBufferSize,
|
|
@@ -71507,7 +71556,7 @@ var Config = class {
|
|
|
71507
71556
|
defaultListPosition = "append",
|
|
71508
71557
|
defaultListTarget = null,
|
|
71509
71558
|
defaultKeys,
|
|
71510
|
-
types:
|
|
71559
|
+
types: types16 = {},
|
|
71511
71560
|
logLevel,
|
|
71512
71561
|
defaultFragmentMasking = "enable",
|
|
71513
71562
|
schemaPollInterval = 2e3,
|
|
@@ -71528,11 +71577,6 @@ var Config = class {
|
|
|
71528
71577
|
logLevel = LogLevel.Summary;
|
|
71529
71578
|
}
|
|
71530
71579
|
this.schemaPath = schemaPath;
|
|
71531
|
-
if (apiUrl && apiUrl.startsWith("env:")) {
|
|
71532
|
-
this.apiUrl = process.env[apiUrl.slice("env:".length)];
|
|
71533
|
-
} else {
|
|
71534
|
-
this.apiUrl = apiUrl;
|
|
71535
|
-
}
|
|
71536
71580
|
this.filepath = filepath;
|
|
71537
71581
|
this.exclude = Array.isArray(exclude) ? exclude : [exclude];
|
|
71538
71582
|
this.module = module;
|
|
@@ -71555,13 +71599,20 @@ var Config = class {
|
|
|
71555
71599
|
if (defaultKeys) {
|
|
71556
71600
|
this.defaultKeys = defaultKeys;
|
|
71557
71601
|
}
|
|
71558
|
-
if (
|
|
71602
|
+
if (types16) {
|
|
71559
71603
|
this.typeConfig = {
|
|
71560
71604
|
...this.typeConfig,
|
|
71561
|
-
...
|
|
71605
|
+
...types16
|
|
71562
71606
|
};
|
|
71563
71607
|
}
|
|
71564
71608
|
}
|
|
71609
|
+
async apiURL() {
|
|
71610
|
+
if (!this.configFile.apiUrl) {
|
|
71611
|
+
return "";
|
|
71612
|
+
}
|
|
71613
|
+
const env = await this.getEnv();
|
|
71614
|
+
return this.processEnvValues(env, this.configFile.apiUrl);
|
|
71615
|
+
}
|
|
71565
71616
|
get include() {
|
|
71566
71617
|
if (this.configFile.include) {
|
|
71567
71618
|
return Array.isArray(this.configFile.include) ? this.configFile.include : [this.configFile.include];
|
|
@@ -71574,23 +71625,43 @@ var Config = class {
|
|
|
71574
71625
|
pluginConfig(name2) {
|
|
71575
71626
|
return this.configFile.plugins?.[name2] ?? {};
|
|
71576
71627
|
}
|
|
71577
|
-
|
|
71578
|
-
|
|
71628
|
+
async getEnv() {
|
|
71629
|
+
let env = process.env;
|
|
71630
|
+
for (const plugin of this.plugins) {
|
|
71631
|
+
if (plugin.env) {
|
|
71632
|
+
env = {
|
|
71633
|
+
...await plugin.env({ config: this, env })
|
|
71634
|
+
};
|
|
71635
|
+
}
|
|
71636
|
+
}
|
|
71637
|
+
return env;
|
|
71638
|
+
}
|
|
71639
|
+
processEnvValues(env, value) {
|
|
71640
|
+
let headerValue;
|
|
71641
|
+
if (typeof value === "function") {
|
|
71642
|
+
headerValue = value(env);
|
|
71643
|
+
} else if (value.startsWith("env:")) {
|
|
71644
|
+
headerValue = env[value.slice("env:".length)];
|
|
71645
|
+
} else {
|
|
71646
|
+
headerValue = value;
|
|
71647
|
+
}
|
|
71648
|
+
return headerValue;
|
|
71649
|
+
}
|
|
71650
|
+
async pullHeaders() {
|
|
71651
|
+
const env = await this.getEnv();
|
|
71652
|
+
if (typeof this.schemaPollHeaders === "function") {
|
|
71653
|
+
return this.schemaPollHeaders(env);
|
|
71654
|
+
}
|
|
71655
|
+
const headers = Object.fromEntries(
|
|
71579
71656
|
Object.entries(this.schemaPollHeaders || {}).map(([key, value]) => {
|
|
71580
|
-
|
|
71581
|
-
if (typeof value === "function") {
|
|
71582
|
-
headerValue = value(process.env);
|
|
71583
|
-
} else if (value.startsWith("env:")) {
|
|
71584
|
-
headerValue = process.env[value.slice("env:".length)];
|
|
71585
|
-
} else {
|
|
71586
|
-
headerValue = value;
|
|
71587
|
-
}
|
|
71657
|
+
const headerValue = this.processEnvValues(env, value);
|
|
71588
71658
|
if (!headerValue) {
|
|
71589
71659
|
return [];
|
|
71590
71660
|
}
|
|
71591
71661
|
return [key, headerValue];
|
|
71592
|
-
})
|
|
71662
|
+
}).filter(([key]) => key)
|
|
71593
71663
|
);
|
|
71664
|
+
return headers;
|
|
71594
71665
|
}
|
|
71595
71666
|
async sourceFiles() {
|
|
71596
71667
|
return [
|
|
@@ -71996,9 +72067,10 @@ async function getConfig({
|
|
|
71996
72067
|
...extraConfig,
|
|
71997
72068
|
filepath: configPath
|
|
71998
72069
|
});
|
|
72070
|
+
const apiURL = await _config.apiURL();
|
|
71999
72071
|
if (_config.schemaPath && !_config.schema) {
|
|
72000
72072
|
let schemaOk = true;
|
|
72001
|
-
if (
|
|
72073
|
+
if (apiURL) {
|
|
72002
72074
|
if (glob.hasMagic(_config.schemaPath)) {
|
|
72003
72075
|
console.log(
|
|
72004
72076
|
`\u26A0\uFE0F Your houdini configuration contains an apiUrl and a path pointing to multiple files.
|
|
@@ -72006,7 +72078,7 @@ This will prevent your schema from being pulled.`
|
|
|
72006
72078
|
);
|
|
72007
72079
|
} else if (!await readFile(_config.schemaPath)) {
|
|
72008
72080
|
console.log("\u231B Pulling schema from api");
|
|
72009
|
-
schemaOk = await pullSchema(
|
|
72081
|
+
schemaOk = await pullSchema(apiURL, _config.schemaPath);
|
|
72010
72082
|
}
|
|
72011
72083
|
}
|
|
72012
72084
|
if (schemaOk && !noSchema) {
|
|
@@ -72017,10 +72089,11 @@ This will prevent your schema from being pulled.`
|
|
|
72017
72089
|
reject(e2);
|
|
72018
72090
|
throw e2;
|
|
72019
72091
|
}
|
|
72092
|
+
const plugins = [];
|
|
72020
72093
|
for (const [pluginName, plugin_config] of Object.entries(_config.configFile.plugins ?? {})) {
|
|
72021
72094
|
try {
|
|
72022
72095
|
const pluginDirectory = _config.findModule(pluginName);
|
|
72023
|
-
const { default:
|
|
72096
|
+
const { default: pluginFactory } = await import(pathToFileURL(pluginDirectory).toString() + "/build/plugin-esm/index.js");
|
|
72024
72097
|
let include_runtime = false;
|
|
72025
72098
|
try {
|
|
72026
72099
|
await stat(join2(pluginDirectory, "build", "runtime-esm"));
|
|
@@ -72037,8 +72110,8 @@ This will prevent your schema from being pulled.`
|
|
|
72037
72110
|
version = packageJSON.version;
|
|
72038
72111
|
} catch {
|
|
72039
72112
|
}
|
|
72040
|
-
|
|
72041
|
-
...await
|
|
72113
|
+
plugins.push({
|
|
72114
|
+
...await pluginFactory(plugin_config),
|
|
72042
72115
|
name: pluginName,
|
|
72043
72116
|
include_runtime,
|
|
72044
72117
|
version,
|
|
@@ -72050,6 +72123,7 @@ This will prevent your schema from being pulled.`
|
|
|
72050
72123
|
);
|
|
72051
72124
|
}
|
|
72052
72125
|
}
|
|
72126
|
+
_config.plugins = orderedPlugins(plugins);
|
|
72053
72127
|
await Promise.all(_config.plugins.map((plugin) => plugin.after_load?.(_config)));
|
|
72054
72128
|
resolve2(_config);
|
|
72055
72129
|
return _config;
|
|
@@ -72061,6 +72135,16 @@ var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
|
72061
72135
|
LogLevel2["Quiet"] = "quiet";
|
|
72062
72136
|
return LogLevel2;
|
|
72063
72137
|
})(LogLevel || {});
|
|
72138
|
+
var orderedPlugins = (plugins) => {
|
|
72139
|
+
const ordered = plugins.filter(
|
|
72140
|
+
(plugin) => plugin.order === "before" || plugin.order === void 0
|
|
72141
|
+
);
|
|
72142
|
+
ordered.push(
|
|
72143
|
+
...plugins.filter((plugin) => plugin.order === "core"),
|
|
72144
|
+
...plugins.filter((plugin) => plugin.order === "after")
|
|
72145
|
+
);
|
|
72146
|
+
return ordered;
|
|
72147
|
+
};
|
|
72064
72148
|
|
|
72065
72149
|
// src/lib/graphql.ts
|
|
72066
72150
|
var graphql3 = __toESM(require_graphql2(), 1);
|
|
@@ -72348,53 +72432,75 @@ var graphql4 = __toESM(require_graphql2(), 1);
|
|
|
72348
72432
|
async function find_graphql(config2, parsedScript, walker) {
|
|
72349
72433
|
await asyncWalk(parsedScript, {
|
|
72350
72434
|
async enter(node, parent) {
|
|
72351
|
-
if (node.type
|
|
72435
|
+
if (node.type !== "TaggedTemplateExpression" && node.type !== "CallExpression") {
|
|
72436
|
+
return;
|
|
72437
|
+
}
|
|
72438
|
+
let documentString;
|
|
72439
|
+
if (node.type === "TaggedTemplateExpression") {
|
|
72352
72440
|
const expr = node;
|
|
72353
|
-
|
|
72354
|
-
const parsedTag = graphql4.parse(tagContent);
|
|
72355
|
-
if (walker.where && !walker.where(parsedTag)) {
|
|
72441
|
+
if (expr.tag.type !== "Identifier" || expr.tag.name !== "graphql") {
|
|
72356
72442
|
return;
|
|
72357
72443
|
}
|
|
72358
|
-
|
|
72359
|
-
|
|
72360
|
-
|
|
72361
|
-
|
|
72444
|
+
documentString = expr.quasi.quasis[0].value.raw;
|
|
72445
|
+
} else if (node.type === "CallExpression") {
|
|
72446
|
+
const expr = node;
|
|
72447
|
+
if (expr.callee.type !== "Identifier" || expr.callee.name !== "graphql" || expr.arguments.length !== 1) {
|
|
72448
|
+
return;
|
|
72362
72449
|
}
|
|
72363
|
-
|
|
72364
|
-
if (
|
|
72365
|
-
|
|
72450
|
+
const argument = expr.arguments[0];
|
|
72451
|
+
if (argument.type === "TemplateLiteral") {
|
|
72452
|
+
documentString = argument.quasis[0].value.raw;
|
|
72453
|
+
} else if (argument.type === "StringLiteral") {
|
|
72454
|
+
documentString = argument.value;
|
|
72366
72455
|
} else {
|
|
72367
|
-
|
|
72368
|
-
kind = CompiledQueryKind;
|
|
72369
|
-
} else if (definition.operation === "mutation") {
|
|
72370
|
-
kind = CompiledMutationKind;
|
|
72371
|
-
} else {
|
|
72372
|
-
kind = CompiledSubscriptionKind;
|
|
72373
|
-
}
|
|
72456
|
+
return;
|
|
72374
72457
|
}
|
|
72375
|
-
|
|
72376
|
-
|
|
72377
|
-
|
|
72378
|
-
|
|
72379
|
-
|
|
72380
|
-
|
|
72381
|
-
remove: this.remove,
|
|
72382
|
-
replaceWith: this.replace
|
|
72383
|
-
},
|
|
72384
|
-
artifact: {
|
|
72385
|
-
name: name2,
|
|
72386
|
-
kind
|
|
72387
|
-
},
|
|
72388
|
-
parent,
|
|
72389
|
-
tagContent
|
|
72390
|
-
});
|
|
72458
|
+
} else {
|
|
72459
|
+
return;
|
|
72460
|
+
}
|
|
72461
|
+
const parsedTag = graphql4.parse(documentString);
|
|
72462
|
+
if (walker.where && !walker.where(parsedTag)) {
|
|
72463
|
+
return;
|
|
72391
72464
|
}
|
|
72465
|
+
const definition = config2.extractDefinition(parsedTag);
|
|
72466
|
+
const name2 = definition.name?.value;
|
|
72467
|
+
if (!name2) {
|
|
72468
|
+
throw new Error("Could not find definition name");
|
|
72469
|
+
}
|
|
72470
|
+
let kind;
|
|
72471
|
+
if (definition.kind === "FragmentDefinition") {
|
|
72472
|
+
kind = CompiledFragmentKind;
|
|
72473
|
+
} else {
|
|
72474
|
+
if (definition.operation === "query") {
|
|
72475
|
+
kind = CompiledQueryKind;
|
|
72476
|
+
} else if (definition.operation === "mutation") {
|
|
72477
|
+
kind = CompiledMutationKind;
|
|
72478
|
+
} else {
|
|
72479
|
+
kind = CompiledSubscriptionKind;
|
|
72480
|
+
}
|
|
72481
|
+
}
|
|
72482
|
+
walker.dependency?.(config2.artifactPath(parsedTag));
|
|
72483
|
+
await walker.tag({
|
|
72484
|
+
parsedDocument: parsedTag,
|
|
72485
|
+
node: {
|
|
72486
|
+
...node,
|
|
72487
|
+
...this,
|
|
72488
|
+
remove: this.remove,
|
|
72489
|
+
replaceWith: this.replace
|
|
72490
|
+
},
|
|
72491
|
+
artifact: {
|
|
72492
|
+
name: name2,
|
|
72493
|
+
kind
|
|
72494
|
+
},
|
|
72495
|
+
parent,
|
|
72496
|
+
tagContent: documentString
|
|
72497
|
+
});
|
|
72392
72498
|
}
|
|
72393
72499
|
});
|
|
72394
72500
|
}
|
|
72395
72501
|
|
|
72396
72502
|
// src/codegen/index.ts
|
|
72397
|
-
var
|
|
72503
|
+
var graphql29 = __toESM(require_graphql2(), 1);
|
|
72398
72504
|
|
|
72399
72505
|
// src/codegen/generators/artifacts/index.ts
|
|
72400
72506
|
var graphql14 = __toESM(require_graphql2(), 1);
|
|
@@ -72814,7 +72920,7 @@ function deepMerge(filepath, ...targets) {
|
|
|
72814
72920
|
Object.entries(fields).map(([key, value]) => [key, deepMerge(filepath, ...value)])
|
|
72815
72921
|
);
|
|
72816
72922
|
}
|
|
72817
|
-
function convertValue(val) {
|
|
72923
|
+
function convertValue(config2, val) {
|
|
72818
72924
|
let value;
|
|
72819
72925
|
let kind;
|
|
72820
72926
|
if (val.kind === graphql7.Kind.INT) {
|
|
@@ -72946,7 +73052,7 @@ function operationObject({
|
|
|
72946
73052
|
operationWhen[i2 ? "must_not" : "must"] = arg.value.fields.reduce(
|
|
72947
73053
|
(obj, arg2) => ({
|
|
72948
73054
|
...obj,
|
|
72949
|
-
[arg2.name.value]: convertValue(arg2.value).value
|
|
73055
|
+
[arg2.name.value]: convertValue(config2, arg2.value).value
|
|
72950
73056
|
}),
|
|
72951
73057
|
{}
|
|
72952
73058
|
);
|
|
@@ -72962,7 +73068,7 @@ function operationObject({
|
|
|
72962
73068
|
operationWhen[which] = directive.arguments?.reduce(
|
|
72963
73069
|
(filters, argument) => ({
|
|
72964
73070
|
...filters,
|
|
72965
|
-
[argument.name.value]: convertValue(argument.value).value
|
|
73071
|
+
[argument.name.value]: convertValue(config2, argument.value).value
|
|
72966
73072
|
}),
|
|
72967
73073
|
{}
|
|
72968
73074
|
);
|
|
@@ -73921,7 +74027,9 @@ function fieldKey(config2, field) {
|
|
|
73921
74027
|
[arg.name.value]: printed.substring(start - 1, end - 1)
|
|
73922
74028
|
};
|
|
73923
74029
|
}, {});
|
|
73924
|
-
|
|
74030
|
+
const args = Object.keys(argObj);
|
|
74031
|
+
args.sort();
|
|
74032
|
+
let key = Object.values(argObj).length > 0 ? `${attributeName}(${args.map((key2) => `${key2}: ${argObj[key2]}`).join(", ")})` : attributeName;
|
|
73925
74033
|
if (paginated) {
|
|
73926
74034
|
key = key + "::paginated";
|
|
73927
74035
|
}
|
|
@@ -74104,7 +74212,7 @@ function selection({
|
|
|
74104
74212
|
fieldObj.filters = (field.arguments || []).reduce(
|
|
74105
74213
|
(filters, arg) => ({
|
|
74106
74214
|
...filters,
|
|
74107
|
-
[arg.name.value]: convertValue(arg.value)
|
|
74215
|
+
[arg.name.value]: convertValue(config2, arg.value)
|
|
74108
74216
|
}),
|
|
74109
74217
|
{}
|
|
74110
74218
|
);
|
|
@@ -74391,7 +74499,9 @@ function artifactGenerator(stats) {
|
|
|
74391
74499
|
}
|
|
74392
74500
|
|
|
74393
74501
|
// src/codegen/generators/runtime/index.ts
|
|
74394
|
-
|
|
74502
|
+
var recast6 = __toESM(require_main2(), 1);
|
|
74503
|
+
var AST6 = recast6.types.builders;
|
|
74504
|
+
async function runtimeGenerator(config2, docs) {
|
|
74395
74505
|
await Promise.all([
|
|
74396
74506
|
fs_exports.recursiveCopy(config2.runtimeSource, config2.runtimeDirectory, {
|
|
74397
74507
|
[path_exports.join(config2.runtimeSource, "lib", "config.js")]: (content) => {
|
|
@@ -74405,6 +74515,59 @@ async function runtimeGenerator(config2) {
|
|
|
74405
74515
|
}),
|
|
74406
74516
|
...config2.plugins.filter((plugin) => plugin.include_runtime).map((plugin) => generatePluginRuntime(config2, plugin))
|
|
74407
74517
|
]);
|
|
74518
|
+
const indexPath = path_exports.join(config2.runtimeDirectory, "index.d.ts");
|
|
74519
|
+
const contents = await parseJS(await fs_exports.readFile(indexPath) || "");
|
|
74520
|
+
const graphql_tag_return = config2.plugins.find(
|
|
74521
|
+
(plugin) => plugin.graphql_tag_return
|
|
74522
|
+
)?.graphql_tag_return;
|
|
74523
|
+
if (graphql_tag_return && contents) {
|
|
74524
|
+
const overloaded_returns = {};
|
|
74525
|
+
for (const doc of docs) {
|
|
74526
|
+
const return_value = graphql_tag_return({
|
|
74527
|
+
config: config2,
|
|
74528
|
+
doc,
|
|
74529
|
+
ensure_import({ identifier, module }) {
|
|
74530
|
+
ensureImports({
|
|
74531
|
+
config: config2,
|
|
74532
|
+
body: contents.script.body,
|
|
74533
|
+
sourceModule: module,
|
|
74534
|
+
import: [identifier]
|
|
74535
|
+
});
|
|
74536
|
+
}
|
|
74537
|
+
});
|
|
74538
|
+
if (return_value) {
|
|
74539
|
+
overloaded_returns[doc.originalString] = return_value;
|
|
74540
|
+
}
|
|
74541
|
+
}
|
|
74542
|
+
if (Object.keys(overloaded_returns).length > 0) {
|
|
74543
|
+
for (const [i2, expression] of (contents?.script.body ?? []).entries()) {
|
|
74544
|
+
if (expression.type !== "ExportNamedDeclaration" || expression.declaration?.type !== "TSDeclareFunction" || expression.declaration.id?.name !== "graphql") {
|
|
74545
|
+
continue;
|
|
74546
|
+
}
|
|
74547
|
+
for (const [queryString, returnValue] of Object.entries(overloaded_returns)) {
|
|
74548
|
+
const input = AST6.identifier("str");
|
|
74549
|
+
input.typeAnnotation = AST6.tsTypeAnnotation(
|
|
74550
|
+
AST6.tsLiteralType(AST6.stringLiteral(queryString))
|
|
74551
|
+
);
|
|
74552
|
+
contents?.script.body.splice(
|
|
74553
|
+
i2,
|
|
74554
|
+
0,
|
|
74555
|
+
AST6.exportNamedDeclaration(
|
|
74556
|
+
AST6.tsDeclareFunction(
|
|
74557
|
+
AST6.identifier("graphql"),
|
|
74558
|
+
[input],
|
|
74559
|
+
AST6.tsTypeAnnotation(
|
|
74560
|
+
AST6.tsTypeReference(AST6.identifier(returnValue))
|
|
74561
|
+
)
|
|
74562
|
+
)
|
|
74563
|
+
)
|
|
74564
|
+
);
|
|
74565
|
+
}
|
|
74566
|
+
break;
|
|
74567
|
+
}
|
|
74568
|
+
await fs_exports.writeFile(indexPath, recast6.prettyPrint(contents.script).code);
|
|
74569
|
+
}
|
|
74570
|
+
}
|
|
74408
74571
|
}
|
|
74409
74572
|
async function generatePluginRuntime(config2, plugin) {
|
|
74410
74573
|
if (houdini_mode.is_testing) {
|
|
@@ -74439,20 +74602,20 @@ async function generatePluginRuntime(config2, plugin) {
|
|
|
74439
74602
|
}
|
|
74440
74603
|
|
|
74441
74604
|
// src/codegen/generators/typescript/index.ts
|
|
74442
|
-
var
|
|
74605
|
+
var recast12 = __toESM(require_main2(), 1);
|
|
74443
74606
|
|
|
74444
74607
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
74445
74608
|
var graphql17 = __toESM(require_graphql2(), 1);
|
|
74446
|
-
var
|
|
74609
|
+
var recast9 = __toESM(require_main2(), 1);
|
|
74447
74610
|
|
|
74448
74611
|
// src/codegen/generators/typescript/typeReference.ts
|
|
74449
74612
|
var graphql16 = __toESM(require_graphql2(), 1);
|
|
74450
|
-
var
|
|
74613
|
+
var recast8 = __toESM(require_main2(), 1);
|
|
74451
74614
|
|
|
74452
74615
|
// src/codegen/generators/typescript/types.ts
|
|
74453
74616
|
var graphql15 = __toESM(require_graphql2(), 1);
|
|
74454
|
-
var
|
|
74455
|
-
var
|
|
74617
|
+
var recast7 = __toESM(require_main2(), 1);
|
|
74618
|
+
var AST7 = recast7.types.builders;
|
|
74456
74619
|
function readonlyProperty(prop, enable = true) {
|
|
74457
74620
|
if (enable) {
|
|
74458
74621
|
prop.readonly = true;
|
|
@@ -74460,28 +74623,28 @@ function readonlyProperty(prop, enable = true) {
|
|
|
74460
74623
|
return prop;
|
|
74461
74624
|
}
|
|
74462
74625
|
function nullableField(inner, input = false) {
|
|
74463
|
-
const members = [inner,
|
|
74626
|
+
const members = [inner, AST7.tsNullKeyword()];
|
|
74464
74627
|
if (input) {
|
|
74465
|
-
members.push(
|
|
74628
|
+
members.push(AST7.tsUndefinedKeyword());
|
|
74466
74629
|
}
|
|
74467
|
-
return
|
|
74630
|
+
return AST7.tsUnionType(members);
|
|
74468
74631
|
}
|
|
74469
74632
|
function scalarPropertyValue(config2, missingScalars, target) {
|
|
74470
74633
|
switch (target.name) {
|
|
74471
74634
|
case "String": {
|
|
74472
|
-
return
|
|
74635
|
+
return AST7.tsStringKeyword();
|
|
74473
74636
|
}
|
|
74474
74637
|
case "Int": {
|
|
74475
|
-
return
|
|
74638
|
+
return AST7.tsNumberKeyword();
|
|
74476
74639
|
}
|
|
74477
74640
|
case "Float": {
|
|
74478
|
-
return
|
|
74641
|
+
return AST7.tsNumberKeyword();
|
|
74479
74642
|
}
|
|
74480
74643
|
case "Boolean": {
|
|
74481
|
-
return
|
|
74644
|
+
return AST7.tsBooleanKeyword();
|
|
74482
74645
|
}
|
|
74483
74646
|
case "ID": {
|
|
74484
|
-
return
|
|
74647
|
+
return AST7.tsStringKeyword();
|
|
74485
74648
|
}
|
|
74486
74649
|
default: {
|
|
74487
74650
|
if (graphql15.isNonNullType(target) && "ofType" in target) {
|
|
@@ -74492,23 +74655,23 @@ function scalarPropertyValue(config2, missingScalars, target) {
|
|
|
74492
74655
|
);
|
|
74493
74656
|
}
|
|
74494
74657
|
if (config2.scalars?.[target.name]) {
|
|
74495
|
-
return
|
|
74658
|
+
return AST7.tsTypeReference(AST7.identifier(config2.scalars?.[target.name].type));
|
|
74496
74659
|
}
|
|
74497
74660
|
missingScalars.add(target.name);
|
|
74498
|
-
return
|
|
74661
|
+
return AST7.tsAnyKeyword();
|
|
74499
74662
|
}
|
|
74500
74663
|
}
|
|
74501
74664
|
}
|
|
74502
74665
|
|
|
74503
74666
|
// src/codegen/generators/typescript/typeReference.ts
|
|
74504
|
-
var
|
|
74667
|
+
var AST8 = recast8.types.builders;
|
|
74505
74668
|
function tsTypeReference(config2, missingScalars, definition) {
|
|
74506
74669
|
const { type, wrappers } = unwrapType(config2, definition.type);
|
|
74507
74670
|
let result;
|
|
74508
74671
|
if (graphql16.isScalarType(type)) {
|
|
74509
74672
|
result = scalarPropertyValue(config2, missingScalars, type);
|
|
74510
74673
|
} else {
|
|
74511
|
-
result =
|
|
74674
|
+
result = AST8.tsTypeReference(AST8.identifier(type.name));
|
|
74512
74675
|
}
|
|
74513
74676
|
for (const toWrap of wrappers) {
|
|
74514
74677
|
if (toWrap === "NonNull" /* NonNull */) {
|
|
@@ -74516,14 +74679,14 @@ function tsTypeReference(config2, missingScalars, definition) {
|
|
|
74516
74679
|
} else if (toWrap === "Nullable" /* Nullable */) {
|
|
74517
74680
|
result = nullableField(result, true);
|
|
74518
74681
|
} else if (toWrap === "List" /* List */) {
|
|
74519
|
-
result =
|
|
74682
|
+
result = AST8.tsArrayType(AST8.tsParenthesizedType(result));
|
|
74520
74683
|
}
|
|
74521
74684
|
}
|
|
74522
74685
|
return result;
|
|
74523
74686
|
}
|
|
74524
74687
|
|
|
74525
74688
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
74526
|
-
var
|
|
74689
|
+
var AST9 = recast9.types.builders;
|
|
74527
74690
|
function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingScalars, rootType) {
|
|
74528
74691
|
const { type } = unwrapType(config2, rootType);
|
|
74529
74692
|
if (graphql17.isScalarType(type)) {
|
|
@@ -74550,20 +74713,267 @@ function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingS
|
|
|
74550
74713
|
for (const field of Object.values(type.getFields())) {
|
|
74551
74714
|
addReferencedInputTypes(config2, filepath, body, visitedTypes, missingScalars, field.type);
|
|
74552
74715
|
members.push(
|
|
74553
|
-
|
|
74554
|
-
|
|
74555
|
-
|
|
74716
|
+
AST9.tsPropertySignature(
|
|
74717
|
+
AST9.identifier(field.name),
|
|
74718
|
+
AST9.tsTypeAnnotation(tsTypeReference(config2, missingScalars, field)),
|
|
74556
74719
|
graphql17.isNullableType(field.type)
|
|
74557
74720
|
)
|
|
74558
74721
|
);
|
|
74559
74722
|
}
|
|
74560
|
-
body.push(
|
|
74723
|
+
body.push(AST9.tsTypeAliasDeclaration(AST9.identifier(type.name), AST9.tsTypeLiteral(members)));
|
|
74561
74724
|
}
|
|
74562
74725
|
|
|
74563
|
-
// src/codegen/generators/typescript/
|
|
74726
|
+
// src/codegen/generators/typescript/imperativeCache.ts
|
|
74564
74727
|
var graphql18 = __toESM(require_graphql2(), 1);
|
|
74565
|
-
var
|
|
74566
|
-
var
|
|
74728
|
+
var recast10 = __toESM(require_main2(), 1);
|
|
74729
|
+
var AST10 = recast10.types.builders;
|
|
74730
|
+
async function imperativeCacheTypef(config2, docs) {
|
|
74731
|
+
const target = path_exports.join(config2.runtimeDirectory, "generated.d.ts");
|
|
74732
|
+
const body = [];
|
|
74733
|
+
const declaration = AST10.tsTypeAliasDeclaration(
|
|
74734
|
+
AST10.identifier(CacheTypeDefName),
|
|
74735
|
+
AST10.tsTypeLiteral([
|
|
74736
|
+
AST10.tsPropertySignature(
|
|
74737
|
+
AST10.identifier("types"),
|
|
74738
|
+
AST10.tsTypeAnnotation(typeDefinitions(config2, body))
|
|
74739
|
+
),
|
|
74740
|
+
AST10.tsPropertySignature(
|
|
74741
|
+
AST10.identifier("lists"),
|
|
74742
|
+
AST10.tsTypeAnnotation(listDefinitions(config2, docs))
|
|
74743
|
+
)
|
|
74744
|
+
])
|
|
74745
|
+
);
|
|
74746
|
+
declaration.declare = true;
|
|
74747
|
+
const importRecord = AST10.importDeclaration(
|
|
74748
|
+
[AST10.importSpecifier(AST10.identifier("Record"))],
|
|
74749
|
+
AST10.stringLiteral("./public/record")
|
|
74750
|
+
);
|
|
74751
|
+
importRecord.importKind = "type";
|
|
74752
|
+
await fs_exports.writeFile(
|
|
74753
|
+
target,
|
|
74754
|
+
recast10.prettyPrint(
|
|
74755
|
+
AST10.program([importRecord, ...body, AST10.exportNamedDeclaration(declaration)])
|
|
74756
|
+
).code
|
|
74757
|
+
);
|
|
74758
|
+
}
|
|
74759
|
+
function typeDefinitions(config2, body) {
|
|
74760
|
+
const operationTypes = [config2.schema.getMutationType(), config2.schema.getSubscriptionType()].filter(Boolean).map((type) => type?.name);
|
|
74761
|
+
const visitedTypes = /* @__PURE__ */ new Set();
|
|
74762
|
+
const types16 = Object.values(config2.schema.getTypeMap()).filter(
|
|
74763
|
+
(type) => !graphql18.isAbstractType(type) && !graphql18.isScalarType(type) && !graphql18.isEnumType(type) && !graphql18.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
|
|
74764
|
+
);
|
|
74765
|
+
return AST10.tsTypeLiteral(
|
|
74766
|
+
types16.map((type) => {
|
|
74767
|
+
let typeName = type.name;
|
|
74768
|
+
if (config2.schema.getQueryType() && config2.schema.getQueryType()?.name === type.name) {
|
|
74769
|
+
typeName = "__ROOT__";
|
|
74770
|
+
}
|
|
74771
|
+
let idFields = AST10.tsNeverKeyword();
|
|
74772
|
+
const keys = keyFieldsForType(config2.configFile, type.name);
|
|
74773
|
+
if (graphql18.isObjectType(type) && keys.length > 0 && keys.every((key) => type.getFields()[key])) {
|
|
74774
|
+
idFields = AST10.tsTypeLiteral(
|
|
74775
|
+
keys.map((key) => {
|
|
74776
|
+
const fieldType = type.getFields()[key];
|
|
74777
|
+
const unwrapped = unwrapType(config2, fieldType.type);
|
|
74778
|
+
return AST10.tsPropertySignature(
|
|
74779
|
+
AST10.identifier(key),
|
|
74780
|
+
AST10.tsTypeAnnotation(
|
|
74781
|
+
scalarPropertyValue(config2, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
74782
|
+
)
|
|
74783
|
+
);
|
|
74784
|
+
})
|
|
74785
|
+
);
|
|
74786
|
+
} else if (typeName === "__ROOT__") {
|
|
74787
|
+
idFields = AST10.tsTypeLiteral([]);
|
|
74788
|
+
}
|
|
74789
|
+
let fields = AST10.tsTypeLiteral([]);
|
|
74790
|
+
if (graphql18.isObjectType(type)) {
|
|
74791
|
+
fields = AST10.tsTypeLiteral(
|
|
74792
|
+
Object.entries(type.getFields()).map(
|
|
74793
|
+
([key, fieldType]) => {
|
|
74794
|
+
const unwrapped = unwrapType(config2, fieldType.type);
|
|
74795
|
+
let typeOptions = AST10.tsUnionType([]);
|
|
74796
|
+
if (graphql18.isScalarType(unwrapped.type)) {
|
|
74797
|
+
typeOptions.types.push(
|
|
74798
|
+
scalarPropertyValue(config2, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
74799
|
+
);
|
|
74800
|
+
} else if (graphql18.isEnumType(unwrapped.type)) {
|
|
74801
|
+
typeOptions.types.push(
|
|
74802
|
+
AST10.tsTypeReference(AST10.identifier(unwrapped.type.name))
|
|
74803
|
+
);
|
|
74804
|
+
} else if (!graphql18.isAbstractType(unwrapped.type)) {
|
|
74805
|
+
typeOptions.types.push(record(unwrapped.type.name));
|
|
74806
|
+
} else {
|
|
74807
|
+
typeOptions.types.push(
|
|
74808
|
+
...config2.schema.getPossibleTypes(unwrapped.type).map((type2) => record(type2.name))
|
|
74809
|
+
);
|
|
74810
|
+
}
|
|
74811
|
+
for (const wrapper of unwrapped.wrappers) {
|
|
74812
|
+
if (wrapper === "Nullable" /* Nullable */) {
|
|
74813
|
+
typeOptions = AST10.tsParenthesizedType(
|
|
74814
|
+
AST10.tsUnionType([typeOptions, AST10.tsNullKeyword()])
|
|
74815
|
+
);
|
|
74816
|
+
} else if (wrapper === "List" /* List */) {
|
|
74817
|
+
typeOptions = AST10.tsArrayType(
|
|
74818
|
+
AST10.tsParenthesizedType(typeOptions)
|
|
74819
|
+
);
|
|
74820
|
+
}
|
|
74821
|
+
}
|
|
74822
|
+
if (typeOptions.type === "TSParenthesizedType") {
|
|
74823
|
+
typeOptions = typeOptions.typeAnnotation;
|
|
74824
|
+
}
|
|
74825
|
+
let args = AST10.tsNeverKeyword();
|
|
74826
|
+
if (fieldType.args?.length > 0) {
|
|
74827
|
+
args = AST10.tsTypeLiteral(
|
|
74828
|
+
fieldType.args.map((arg) => {
|
|
74829
|
+
addReferencedInputTypes(
|
|
74830
|
+
config2,
|
|
74831
|
+
"",
|
|
74832
|
+
body,
|
|
74833
|
+
visitedTypes,
|
|
74834
|
+
/* @__PURE__ */ new Set(),
|
|
74835
|
+
arg.type
|
|
74836
|
+
);
|
|
74837
|
+
const prop = AST10.tsPropertySignature(
|
|
74838
|
+
AST10.identifier(arg.name),
|
|
74839
|
+
AST10.tsTypeAnnotation(
|
|
74840
|
+
tsTypeReference(config2, /* @__PURE__ */ new Set(), arg)
|
|
74841
|
+
)
|
|
74842
|
+
);
|
|
74843
|
+
const unwrapped2 = unwrapType(config2, arg.type);
|
|
74844
|
+
prop.optional = unwrapped2.wrappers[unwrapped2.wrappers.length - 1] === "Nullable" /* Nullable */;
|
|
74845
|
+
return prop;
|
|
74846
|
+
})
|
|
74847
|
+
);
|
|
74848
|
+
}
|
|
74849
|
+
return AST10.tsPropertySignature(
|
|
74850
|
+
AST10.identifier(key),
|
|
74851
|
+
AST10.tsTypeAnnotation(
|
|
74852
|
+
AST10.tsTypeLiteral([
|
|
74853
|
+
AST10.tsPropertySignature(
|
|
74854
|
+
AST10.identifier("type"),
|
|
74855
|
+
AST10.tsTypeAnnotation(typeOptions)
|
|
74856
|
+
),
|
|
74857
|
+
AST10.tsPropertySignature(
|
|
74858
|
+
AST10.identifier("args"),
|
|
74859
|
+
AST10.tsTypeAnnotation(args)
|
|
74860
|
+
)
|
|
74861
|
+
])
|
|
74862
|
+
)
|
|
74863
|
+
);
|
|
74864
|
+
}
|
|
74865
|
+
)
|
|
74866
|
+
);
|
|
74867
|
+
}
|
|
74868
|
+
return AST10.tsPropertySignature(
|
|
74869
|
+
AST10.identifier(typeName),
|
|
74870
|
+
AST10.tsTypeAnnotation(
|
|
74871
|
+
AST10.tsTypeLiteral([
|
|
74872
|
+
AST10.tsPropertySignature(
|
|
74873
|
+
AST10.identifier("idFields"),
|
|
74874
|
+
AST10.tsTypeAnnotation(idFields)
|
|
74875
|
+
),
|
|
74876
|
+
AST10.tsPropertySignature(
|
|
74877
|
+
AST10.identifier("fields"),
|
|
74878
|
+
AST10.tsTypeAnnotation(fields)
|
|
74879
|
+
)
|
|
74880
|
+
])
|
|
74881
|
+
)
|
|
74882
|
+
);
|
|
74883
|
+
})
|
|
74884
|
+
);
|
|
74885
|
+
}
|
|
74886
|
+
function listDefinitions(config2, docs) {
|
|
74887
|
+
const lists = [];
|
|
74888
|
+
const visitedLists = /* @__PURE__ */ new Set();
|
|
74889
|
+
for (const doc of docs) {
|
|
74890
|
+
graphql18.visit(doc.document, {
|
|
74891
|
+
Directive(node, key, parent, path2, ancestors) {
|
|
74892
|
+
if (![config2.listDirective, config2.paginateDirective].includes(node.name.value)) {
|
|
74893
|
+
return;
|
|
74894
|
+
}
|
|
74895
|
+
const nameArg = node.arguments?.find((arg) => arg.name.value === "name");
|
|
74896
|
+
const nameValue = nameArg?.value?.value || "";
|
|
74897
|
+
if (!nameValue || visitedLists.has(nameValue)) {
|
|
74898
|
+
return;
|
|
74899
|
+
}
|
|
74900
|
+
visitedLists.add(nameValue);
|
|
74901
|
+
const parentType = parentTypeFromAncestors(
|
|
74902
|
+
config2.schema,
|
|
74903
|
+
doc.filename,
|
|
74904
|
+
ancestors.slice(0, -1)
|
|
74905
|
+
);
|
|
74906
|
+
const targetField = ancestors[ancestors.length - 1];
|
|
74907
|
+
const targetFieldDefinition = parentType.getFields()[targetField.name.value];
|
|
74908
|
+
const { type: listType } = unwrapType(config2, targetFieldDefinition.type);
|
|
74909
|
+
const possibleTypes = [];
|
|
74910
|
+
if (graphql18.isAbstractType(listType)) {
|
|
74911
|
+
possibleTypes.push(
|
|
74912
|
+
...config2.schema.getPossibleTypes(listType).map((possible) => possible.name)
|
|
74913
|
+
);
|
|
74914
|
+
} else {
|
|
74915
|
+
possibleTypes.push(listType.name);
|
|
74916
|
+
}
|
|
74917
|
+
lists.push(
|
|
74918
|
+
AST10.tsPropertySignature(
|
|
74919
|
+
AST10.identifier(nameValue),
|
|
74920
|
+
AST10.tsTypeAnnotation(
|
|
74921
|
+
AST10.tsTypeLiteral([
|
|
74922
|
+
AST10.tsPropertySignature(
|
|
74923
|
+
AST10.identifier("types"),
|
|
74924
|
+
AST10.tsTypeAnnotation(
|
|
74925
|
+
AST10.tsUnionType(
|
|
74926
|
+
possibleTypes.map(
|
|
74927
|
+
(possible) => AST10.tsLiteralType(AST10.stringLiteral(possible))
|
|
74928
|
+
)
|
|
74929
|
+
)
|
|
74930
|
+
)
|
|
74931
|
+
),
|
|
74932
|
+
AST10.tsPropertySignature(
|
|
74933
|
+
AST10.identifier("filters"),
|
|
74934
|
+
AST10.tsTypeAnnotation(
|
|
74935
|
+
targetFieldDefinition.args.length === 0 ? AST10.tsNeverKeyword() : AST10.tsTypeLiteral(
|
|
74936
|
+
targetFieldDefinition.args.map((arg) => {
|
|
74937
|
+
const argDef = AST10.tsPropertySignature(
|
|
74938
|
+
AST10.identifier(arg.name),
|
|
74939
|
+
AST10.tsTypeAnnotation(
|
|
74940
|
+
tsTypeReference(
|
|
74941
|
+
config2,
|
|
74942
|
+
/* @__PURE__ */ new Set(),
|
|
74943
|
+
arg
|
|
74944
|
+
)
|
|
74945
|
+
)
|
|
74946
|
+
);
|
|
74947
|
+
argDef.optional = true;
|
|
74948
|
+
return argDef;
|
|
74949
|
+
})
|
|
74950
|
+
)
|
|
74951
|
+
)
|
|
74952
|
+
)
|
|
74953
|
+
])
|
|
74954
|
+
)
|
|
74955
|
+
)
|
|
74956
|
+
);
|
|
74957
|
+
}
|
|
74958
|
+
});
|
|
74959
|
+
}
|
|
74960
|
+
return AST10.tsTypeLiteral(lists);
|
|
74961
|
+
}
|
|
74962
|
+
var CacheTypeDefName = "CacheTypeDef";
|
|
74963
|
+
function record(name2) {
|
|
74964
|
+
return AST10.tsTypeReference(
|
|
74965
|
+
AST10.identifier("Record"),
|
|
74966
|
+
AST10.tsTypeParameterInstantiation([
|
|
74967
|
+
AST10.tsTypeReference(AST10.identifier(CacheTypeDefName)),
|
|
74968
|
+
AST10.tsLiteralType(AST10.stringLiteral(name2))
|
|
74969
|
+
])
|
|
74970
|
+
);
|
|
74971
|
+
}
|
|
74972
|
+
|
|
74973
|
+
// src/codegen/generators/typescript/inlineType.ts
|
|
74974
|
+
var graphql19 = __toESM(require_graphql2(), 1);
|
|
74975
|
+
var recast11 = __toESM(require_main2(), 1);
|
|
74976
|
+
var AST11 = recast11.types.builders;
|
|
74567
74977
|
var fragmentKey = "$fragments";
|
|
74568
74978
|
function inlineType({
|
|
74569
74979
|
config: config2,
|
|
@@ -74580,9 +74990,9 @@ function inlineType({
|
|
|
74580
74990
|
}) {
|
|
74581
74991
|
const { type, wrappers } = unwrapType(config2, rootType);
|
|
74582
74992
|
let result;
|
|
74583
|
-
if (
|
|
74993
|
+
if (graphql19.isScalarType(type)) {
|
|
74584
74994
|
result = scalarPropertyValue(config2, missingScalars, type);
|
|
74585
|
-
} else if (
|
|
74995
|
+
} else if (graphql19.isEnumType(type)) {
|
|
74586
74996
|
if (!visitedTypes.has(type.name)) {
|
|
74587
74997
|
ensureImports({
|
|
74588
74998
|
config: config2,
|
|
@@ -74592,7 +75002,7 @@ function inlineType({
|
|
|
74592
75002
|
});
|
|
74593
75003
|
visitedTypes.add(type.name);
|
|
74594
75004
|
}
|
|
74595
|
-
result =
|
|
75005
|
+
result = AST11.tsTypeReference(AST11.identifier(type.name));
|
|
74596
75006
|
} else if (selections) {
|
|
74597
75007
|
const rootObj = type;
|
|
74598
75008
|
const inlineFragments = {};
|
|
@@ -74600,11 +75010,11 @@ function inlineType({
|
|
|
74600
75010
|
for (const selection2 of selections) {
|
|
74601
75011
|
if (selection2.kind === "InlineFragment" && selection2.typeCondition) {
|
|
74602
75012
|
const fragmentType = config2.schema.getType(selection2.typeCondition.name.value);
|
|
74603
|
-
if (!
|
|
75013
|
+
if (!graphql19.isInterfaceType(type) && !graphql19.isUnionType(type)) {
|
|
74604
75014
|
selectedFields.push(...selection2.selectionSet.selections);
|
|
74605
75015
|
continue;
|
|
74606
75016
|
}
|
|
74607
|
-
if (!
|
|
75017
|
+
if (!graphql19.isInterfaceType(fragmentType) && !graphql19.isUnionType(fragmentType)) {
|
|
74608
75018
|
if (!inlineFragments[fragmentType.name]) {
|
|
74609
75019
|
inlineFragments[fragmentType.name] = [];
|
|
74610
75020
|
}
|
|
@@ -74643,7 +75053,7 @@ function inlineType({
|
|
|
74643
75053
|
selectedFields.push(selection2);
|
|
74644
75054
|
}
|
|
74645
75055
|
}
|
|
74646
|
-
result =
|
|
75056
|
+
result = AST11.tsTypeLiteral([
|
|
74647
75057
|
...(selectedFields || []).filter(
|
|
74648
75058
|
(field) => field.kind === "Field"
|
|
74649
75059
|
).map((selection2) => {
|
|
@@ -74663,9 +75073,9 @@ function inlineType({
|
|
|
74663
75073
|
allOptional
|
|
74664
75074
|
});
|
|
74665
75075
|
const prop = readonlyProperty(
|
|
74666
|
-
|
|
74667
|
-
|
|
74668
|
-
|
|
75076
|
+
AST11.tsPropertySignature(
|
|
75077
|
+
AST11.identifier(attributeName),
|
|
75078
|
+
AST11.tsTypeAnnotation(attributeType)
|
|
74669
75079
|
),
|
|
74670
75080
|
allowReadonly
|
|
74671
75081
|
);
|
|
@@ -74679,15 +75089,15 @@ function inlineType({
|
|
|
74679
75089
|
if (includeFragments && fragmentSpreads && fragmentSpreads.length) {
|
|
74680
75090
|
result.members.push(
|
|
74681
75091
|
readonlyProperty(
|
|
74682
|
-
|
|
74683
|
-
|
|
74684
|
-
|
|
74685
|
-
|
|
75092
|
+
AST11.tsPropertySignature(
|
|
75093
|
+
AST11.identifier(fragmentKey),
|
|
75094
|
+
AST11.tsTypeAnnotation(
|
|
75095
|
+
AST11.tsTypeLiteral(
|
|
74686
75096
|
(fragmentSpreads || []).map(
|
|
74687
|
-
(fragmentSpread) =>
|
|
74688
|
-
|
|
74689
|
-
|
|
74690
|
-
|
|
75097
|
+
(fragmentSpread) => AST11.tsPropertySignature(
|
|
75098
|
+
AST11.identifier(fragmentSpread.name.value),
|
|
75099
|
+
AST11.tsTypeAnnotation(
|
|
75100
|
+
AST11.tsLiteralType(AST11.booleanLiteral(true))
|
|
74691
75101
|
)
|
|
74692
75102
|
)
|
|
74693
75103
|
)
|
|
@@ -74724,7 +75134,7 @@ function inlineType({
|
|
|
74724
75134
|
}
|
|
74725
75135
|
}
|
|
74726
75136
|
}
|
|
74727
|
-
if (objectType.type === "TSTypeLiteral" && !
|
|
75137
|
+
if (objectType.type === "TSTypeLiteral" && !graphql19.isInterfaceType(fragmentRootType) && !graphql19.isUnionType(fragmentRootType)) {
|
|
74728
75138
|
const existingTypenameIndex = objectType.members.findIndex(
|
|
74729
75139
|
(member) => member.type === "TSPropertySignature" && member.key.type === "Identifier" && member.key.name === "__typename"
|
|
74730
75140
|
);
|
|
@@ -74733,9 +75143,9 @@ function inlineType({
|
|
|
74733
75143
|
}
|
|
74734
75144
|
objectType.members.push(
|
|
74735
75145
|
readonlyProperty(
|
|
74736
|
-
|
|
74737
|
-
|
|
74738
|
-
|
|
75146
|
+
AST11.tsPropertySignature(
|
|
75147
|
+
AST11.identifier("__typename"),
|
|
75148
|
+
AST11.tsTypeAnnotation(AST11.tsLiteralType(AST11.stringLiteral(typeName)))
|
|
74739
75149
|
),
|
|
74740
75150
|
allowReadonly
|
|
74741
75151
|
)
|
|
@@ -74746,8 +75156,8 @@ function inlineType({
|
|
|
74746
75156
|
if (Object.keys(inlineFragmentSelections).length > 0) {
|
|
74747
75157
|
let selectionTypes = Object.entries(inlineFragmentSelections).map(
|
|
74748
75158
|
([typeName, { type: type2, tsType }]) => {
|
|
74749
|
-
return
|
|
74750
|
-
|
|
75159
|
+
return AST11.tsParenthesizedType(
|
|
75160
|
+
AST11.tsIntersectionType(
|
|
74751
75161
|
[tsType].flatMap((type3) => {
|
|
74752
75162
|
if (type3.type === "TSUnionType") {
|
|
74753
75163
|
return type3.types.filter(
|
|
@@ -74760,9 +75170,9 @@ function inlineType({
|
|
|
74760
75170
|
);
|
|
74761
75171
|
}
|
|
74762
75172
|
);
|
|
74763
|
-
result =
|
|
75173
|
+
result = AST11.tsIntersectionType([
|
|
74764
75174
|
result,
|
|
74765
|
-
|
|
75175
|
+
AST11.tsParenthesizedType(AST11.tsUnionType(selectionTypes))
|
|
74766
75176
|
]);
|
|
74767
75177
|
}
|
|
74768
75178
|
} else {
|
|
@@ -74774,7 +75184,7 @@ function inlineType({
|
|
|
74774
75184
|
} else if (toWrap === "NonNull" /* NonNull */) {
|
|
74775
75185
|
continue;
|
|
74776
75186
|
} else if (toWrap === "List" /* List */) {
|
|
74777
|
-
result =
|
|
75187
|
+
result = AST11.tsArrayType(AST11.tsParenthesizedType(result));
|
|
74778
75188
|
}
|
|
74779
75189
|
}
|
|
74780
75190
|
return result;
|
|
@@ -74791,7 +75201,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection2) {
|
|
|
74791
75201
|
},
|
|
74792
75202
|
type: schema.getType("String")
|
|
74793
75203
|
};
|
|
74794
|
-
} else if (
|
|
75204
|
+
} else if (graphql19.isNonNullType(rootType) && "getFields" in rootType.ofType) {
|
|
74795
75205
|
fields = rootType.ofType.getFields();
|
|
74796
75206
|
} else {
|
|
74797
75207
|
fields = rootType.getFields();
|
|
@@ -74803,7 +75213,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection2) {
|
|
|
74803
75213
|
message: `Could not find type information for field ${rootType.toString()}.${selectionName} ${field}`
|
|
74804
75214
|
});
|
|
74805
75215
|
}
|
|
74806
|
-
const fieldType =
|
|
75216
|
+
const fieldType = graphql19.getNamedType(field.type);
|
|
74807
75217
|
if (!fieldType) {
|
|
74808
75218
|
throw new HoudiniError({
|
|
74809
75219
|
filepath,
|
|
@@ -74819,7 +75229,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection2) {
|
|
|
74819
75229
|
}
|
|
74820
75230
|
|
|
74821
75231
|
// src/codegen/generators/typescript/index.ts
|
|
74822
|
-
var
|
|
75232
|
+
var AST12 = recast12.types.builders;
|
|
74823
75233
|
async function typescriptGenerator(config2, docs) {
|
|
74824
75234
|
const typePaths = [];
|
|
74825
75235
|
const fragmentDefinitions = {};
|
|
@@ -74837,7 +75247,7 @@ async function typescriptGenerator(config2, docs) {
|
|
|
74837
75247
|
return;
|
|
74838
75248
|
}
|
|
74839
75249
|
const typeDefPath = config2.artifactTypePath(originalDocument);
|
|
74840
|
-
const program3 =
|
|
75250
|
+
const program3 = AST12.program([]);
|
|
74841
75251
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
74842
75252
|
let definition = originalDocument.definitions.find(
|
|
74843
75253
|
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value === name2
|
|
@@ -74870,21 +75280,21 @@ async function typescriptGenerator(config2, docs) {
|
|
|
74870
75280
|
missingScalars
|
|
74871
75281
|
);
|
|
74872
75282
|
}
|
|
74873
|
-
await fs_exports.writeFile(typeDefPath,
|
|
75283
|
+
await fs_exports.writeFile(typeDefPath, recast12.print(program3).code);
|
|
74874
75284
|
typePaths.push(typeDefPath);
|
|
74875
75285
|
})
|
|
74876
75286
|
);
|
|
74877
|
-
const typeIndex =
|
|
75287
|
+
const typeIndex = AST12.program(
|
|
74878
75288
|
typePaths.sort((a, b) => a.localeCompare(b)).map((typePath) => {
|
|
74879
|
-
return
|
|
74880
|
-
|
|
75289
|
+
return AST12.exportAllDeclaration(
|
|
75290
|
+
AST12.literal(
|
|
74881
75291
|
"./" + path_exports.relative(path_exports.resolve(config2.typeIndexPath, ".."), typePath).replace(/\.[^/.]+\.[^/.]+$/, "")
|
|
74882
75292
|
),
|
|
74883
75293
|
null
|
|
74884
75294
|
);
|
|
74885
75295
|
}).concat([
|
|
74886
|
-
|
|
74887
|
-
|
|
75296
|
+
AST12.exportAllDeclaration(AST12.literal("./runtime"), null),
|
|
75297
|
+
AST12.exportAllDeclaration(AST12.literal("./graphql"), null)
|
|
74888
75298
|
])
|
|
74889
75299
|
);
|
|
74890
75300
|
const export_default_as = ({ module, as }) => `
|
|
@@ -74893,7 +75303,7 @@ export { default as ${as} } from "${module}"
|
|
|
74893
75303
|
const export_star_from = ({ module }) => `
|
|
74894
75304
|
export * from "${module}"
|
|
74895
75305
|
`;
|
|
74896
|
-
let indexContent =
|
|
75306
|
+
let indexContent = recast12.print(typeIndex).code;
|
|
74897
75307
|
for (const plugin of config2.plugins) {
|
|
74898
75308
|
if (!plugin.index_file) {
|
|
74899
75309
|
continue;
|
|
@@ -74914,6 +75324,7 @@ export * from "${module}"
|
|
|
74914
75324
|
}
|
|
74915
75325
|
}
|
|
74916
75326
|
await fs_exports.writeFile(config2.typeIndexPath, indexContent);
|
|
75327
|
+
await imperativeCacheTypef(config2, docs);
|
|
74917
75328
|
if (missingScalars.size > 0) {
|
|
74918
75329
|
console.warn(`\u26A0\uFE0F Missing definitions for the following scalars: ${[...missingScalars].join(
|
|
74919
75330
|
", "
|
|
@@ -74955,23 +75366,23 @@ async function generateOperationTypeDefs(config2, filepath, body, definition, se
|
|
|
74955
75366
|
const optimisticTypeName = `${definition.name.value}$optimistic`;
|
|
74956
75367
|
const hasInputs = definition.variableDefinitions && definition.variableDefinitions.length > 0;
|
|
74957
75368
|
body.push(
|
|
74958
|
-
|
|
74959
|
-
|
|
74960
|
-
|
|
74961
|
-
|
|
75369
|
+
AST12.exportNamedDeclaration(
|
|
75370
|
+
AST12.tsTypeAliasDeclaration(
|
|
75371
|
+
AST12.identifier(definition.name.value),
|
|
75372
|
+
AST12.tsTypeLiteral([
|
|
74962
75373
|
readonlyProperty(
|
|
74963
|
-
|
|
74964
|
-
|
|
74965
|
-
|
|
75374
|
+
AST12.tsPropertySignature(
|
|
75375
|
+
AST12.stringLiteral("input"),
|
|
75376
|
+
AST12.tsTypeAnnotation(AST12.tsTypeReference(AST12.identifier(inputTypeName)))
|
|
74966
75377
|
)
|
|
74967
75378
|
),
|
|
74968
75379
|
readonlyProperty(
|
|
74969
|
-
|
|
74970
|
-
|
|
74971
|
-
|
|
74972
|
-
definition.operation === "mutation" ?
|
|
74973
|
-
|
|
74974
|
-
|
|
75380
|
+
AST12.tsPropertySignature(
|
|
75381
|
+
AST12.stringLiteral("result"),
|
|
75382
|
+
AST12.tsTypeAnnotation(
|
|
75383
|
+
definition.operation === "mutation" ? AST12.tsTypeReference(AST12.identifier(shapeTypeName)) : AST12.tsUnionType([
|
|
75384
|
+
AST12.tsTypeReference(AST12.identifier(shapeTypeName)),
|
|
75385
|
+
AST12.tsUndefinedKeyword()
|
|
74975
75386
|
])
|
|
74976
75387
|
)
|
|
74977
75388
|
)
|
|
@@ -74979,9 +75390,9 @@ async function generateOperationTypeDefs(config2, filepath, body, definition, se
|
|
|
74979
75390
|
])
|
|
74980
75391
|
)
|
|
74981
75392
|
),
|
|
74982
|
-
|
|
74983
|
-
|
|
74984
|
-
|
|
75393
|
+
AST12.exportNamedDeclaration(
|
|
75394
|
+
AST12.tsTypeAliasDeclaration(
|
|
75395
|
+
AST12.identifier(shapeTypeName),
|
|
74985
75396
|
inlineType({
|
|
74986
75397
|
config: config2,
|
|
74987
75398
|
filepath,
|
|
@@ -75009,15 +75420,15 @@ async function generateOperationTypeDefs(config2, filepath, body, definition, se
|
|
|
75009
75420
|
);
|
|
75010
75421
|
}
|
|
75011
75422
|
body.push(
|
|
75012
|
-
|
|
75013
|
-
|
|
75014
|
-
|
|
75015
|
-
|
|
75423
|
+
AST12.exportNamedDeclaration(
|
|
75424
|
+
AST12.tsTypeAliasDeclaration(
|
|
75425
|
+
AST12.identifier(inputTypeName),
|
|
75426
|
+
AST12.tsTypeLiteral(
|
|
75016
75427
|
(definition.variableDefinitions || []).map(
|
|
75017
75428
|
(definition2) => {
|
|
75018
|
-
return
|
|
75019
|
-
|
|
75020
|
-
|
|
75429
|
+
return AST12.tsPropertySignature(
|
|
75430
|
+
AST12.identifier(definition2.variable.name.value),
|
|
75431
|
+
AST12.tsTypeAnnotation(
|
|
75021
75432
|
tsTypeReference(config2, missingScalars, definition2)
|
|
75022
75433
|
),
|
|
75023
75434
|
definition2.type.kind !== "NonNullType"
|
|
@@ -75030,16 +75441,16 @@ async function generateOperationTypeDefs(config2, filepath, body, definition, se
|
|
|
75030
75441
|
);
|
|
75031
75442
|
} else {
|
|
75032
75443
|
body.push(
|
|
75033
|
-
|
|
75034
|
-
|
|
75444
|
+
AST12.exportNamedDeclaration(
|
|
75445
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(inputTypeName), AST12.tsNullKeyword())
|
|
75035
75446
|
)
|
|
75036
75447
|
);
|
|
75037
75448
|
}
|
|
75038
75449
|
if (definition.operation === "mutation") {
|
|
75039
75450
|
body.push(
|
|
75040
|
-
|
|
75041
|
-
|
|
75042
|
-
|
|
75451
|
+
AST12.exportNamedDeclaration(
|
|
75452
|
+
AST12.tsTypeAliasDeclaration(
|
|
75453
|
+
AST12.identifier(optimisticTypeName),
|
|
75043
75454
|
inlineType({
|
|
75044
75455
|
config: config2,
|
|
75045
75456
|
filepath,
|
|
@@ -75070,28 +75481,28 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
75070
75481
|
throw new Error("Should not get here");
|
|
75071
75482
|
}
|
|
75072
75483
|
body.push(
|
|
75073
|
-
|
|
75074
|
-
|
|
75075
|
-
|
|
75076
|
-
|
|
75484
|
+
AST12.exportNamedDeclaration(
|
|
75485
|
+
AST12.tsTypeAliasDeclaration(
|
|
75486
|
+
AST12.identifier(propTypeName),
|
|
75487
|
+
AST12.tsTypeLiteral([
|
|
75077
75488
|
readonlyProperty(
|
|
75078
|
-
|
|
75079
|
-
|
|
75080
|
-
|
|
75081
|
-
|
|
75489
|
+
AST12.tsPropertySignature(
|
|
75490
|
+
AST12.stringLiteral("shape"),
|
|
75491
|
+
AST12.tsTypeAnnotation(
|
|
75492
|
+
AST12.tsTypeReference(AST12.identifier(shapeTypeName))
|
|
75082
75493
|
),
|
|
75083
75494
|
true
|
|
75084
75495
|
)
|
|
75085
75496
|
),
|
|
75086
75497
|
readonlyProperty(
|
|
75087
|
-
|
|
75088
|
-
|
|
75089
|
-
|
|
75090
|
-
|
|
75091
|
-
|
|
75092
|
-
|
|
75093
|
-
|
|
75094
|
-
|
|
75498
|
+
AST12.tsPropertySignature(
|
|
75499
|
+
AST12.stringLiteral(fragmentKey),
|
|
75500
|
+
AST12.tsTypeAnnotation(
|
|
75501
|
+
AST12.tsTypeLiteral([
|
|
75502
|
+
AST12.tsPropertySignature(
|
|
75503
|
+
AST12.stringLiteral(propTypeName),
|
|
75504
|
+
AST12.tsTypeAnnotation(
|
|
75505
|
+
AST12.tsLiteralType(AST12.booleanLiteral(true))
|
|
75095
75506
|
)
|
|
75096
75507
|
)
|
|
75097
75508
|
])
|
|
@@ -75101,9 +75512,9 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
75101
75512
|
])
|
|
75102
75513
|
)
|
|
75103
75514
|
),
|
|
75104
|
-
|
|
75105
|
-
|
|
75106
|
-
|
|
75515
|
+
AST12.exportNamedDeclaration(
|
|
75516
|
+
AST12.tsTypeAliasDeclaration(
|
|
75517
|
+
AST12.identifier(shapeTypeName),
|
|
75107
75518
|
inlineType({
|
|
75108
75519
|
config: config2,
|
|
75109
75520
|
filepath,
|
|
@@ -75123,7 +75534,7 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
75123
75534
|
}
|
|
75124
75535
|
|
|
75125
75536
|
// src/codegen/generators/persistedQueries/index.ts
|
|
75126
|
-
var
|
|
75537
|
+
var graphql20 = __toESM(require_graphql2(), 1);
|
|
75127
75538
|
async function persistOutputGenerator(config2, docs) {
|
|
75128
75539
|
if (typeof config2.persistedQueryPath !== "string" || config2.persistedQueryPath.length === 0)
|
|
75129
75540
|
return;
|
|
@@ -75135,8 +75546,8 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
75135
75546
|
if (!generateArtifact) {
|
|
75136
75547
|
return acc;
|
|
75137
75548
|
}
|
|
75138
|
-
let rawString =
|
|
75139
|
-
|
|
75549
|
+
let rawString = graphql20.print(
|
|
75550
|
+
graphql20.visit(document, {
|
|
75140
75551
|
Directive(node) {
|
|
75141
75552
|
if (config2.isInternalDirective(node)) {
|
|
75142
75553
|
return null;
|
|
@@ -75145,7 +75556,7 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
75145
75556
|
})
|
|
75146
75557
|
);
|
|
75147
75558
|
const operations = document.definitions.filter(
|
|
75148
|
-
({ kind }) => kind ===
|
|
75559
|
+
({ kind }) => kind === graphql20.Kind.OPERATION_DEFINITION
|
|
75149
75560
|
);
|
|
75150
75561
|
if (operations.length > 0 && operations[0].kind === "OperationDefinition") {
|
|
75151
75562
|
acc[hashDocument(rawString)] = rawString;
|
|
@@ -75158,26 +75569,26 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
75158
75569
|
}
|
|
75159
75570
|
|
|
75160
75571
|
// src/codegen/generators/definitions/enums.ts
|
|
75161
|
-
var
|
|
75162
|
-
var
|
|
75163
|
-
var
|
|
75572
|
+
var graphql21 = __toESM(require_graphql2(), 1);
|
|
75573
|
+
var recast13 = __toESM(require_main2(), 1);
|
|
75574
|
+
var AST13 = recast13.types.builders;
|
|
75164
75575
|
async function definitionsGenerator(config2) {
|
|
75165
|
-
const enums =
|
|
75576
|
+
const enums = graphql21.parse(graphql21.printSchema(config2.schema)).definitions.filter(
|
|
75166
75577
|
(definition) => definition.kind === "EnumTypeDefinition"
|
|
75167
75578
|
).filter((def) => !config2.isInternalEnum(def));
|
|
75168
|
-
const runtimeDefinitions =
|
|
75169
|
-
|
|
75579
|
+
const runtimeDefinitions = recast13.print(
|
|
75580
|
+
AST13.program(
|
|
75170
75581
|
enums.map((defn) => {
|
|
75171
75582
|
const name2 = defn.name.value;
|
|
75172
75583
|
return moduleExport(
|
|
75173
75584
|
config2,
|
|
75174
75585
|
name2,
|
|
75175
|
-
|
|
75586
|
+
AST13.objectExpression(
|
|
75176
75587
|
defn.values?.map((value) => {
|
|
75177
75588
|
const str = value.name.value;
|
|
75178
|
-
return
|
|
75179
|
-
|
|
75180
|
-
|
|
75589
|
+
return AST13.objectProperty(
|
|
75590
|
+
AST13.stringLiteral(str),
|
|
75591
|
+
AST13.stringLiteral(str)
|
|
75181
75592
|
);
|
|
75182
75593
|
}) || []
|
|
75183
75594
|
)
|
|
@@ -75185,7 +75596,7 @@ async function definitionsGenerator(config2) {
|
|
|
75185
75596
|
})
|
|
75186
75597
|
)
|
|
75187
75598
|
).code;
|
|
75188
|
-
const
|
|
75599
|
+
const typeDefinitions2 = enums.sort((a, b) => a.name.value.localeCompare(b.name.value)).map(
|
|
75189
75600
|
(definition) => `
|
|
75190
75601
|
export declare enum ${definition.name.value} {
|
|
75191
75602
|
${definition.values?.map((value) => ` ${value.name.value} = "${value.name.value}"`).join(",\n")}
|
|
@@ -75196,7 +75607,7 @@ ${definition.values?.map((value) => ` ${value.name.value} = "${value.name.val
|
|
|
75196
75607
|
export * from './enums.js'
|
|
75197
75608
|
`;
|
|
75198
75609
|
await Promise.all([
|
|
75199
|
-
fs_exports.writeFile(config2.enumTypesDefinitionsPath,
|
|
75610
|
+
fs_exports.writeFile(config2.enumTypesDefinitionsPath, typeDefinitions2),
|
|
75200
75611
|
fs_exports.writeFile(config2.enumRuntimeDefinitionsPath, runtimeDefinitions),
|
|
75201
75612
|
fs_exports.writeFile(path_exports.join(config2.definitionsDirectory, "index.js"), definitionsIndex),
|
|
75202
75613
|
fs_exports.writeFile(path_exports.join(config2.definitionsDirectory, "index.d.ts"), definitionsIndex)
|
|
@@ -75335,7 +75746,7 @@ function flattenFragments(filepath, operation, fragments) {
|
|
|
75335
75746
|
}
|
|
75336
75747
|
|
|
75337
75748
|
// src/codegen/transforms/schema.ts
|
|
75338
|
-
var
|
|
75749
|
+
var graphql23 = __toESM(require_graphql2(), 1);
|
|
75339
75750
|
async function graphqlExtensions(config2, documents) {
|
|
75340
75751
|
const internalSchema = `
|
|
75341
75752
|
enum CachePolicy {
|
|
@@ -75413,19 +75824,19 @@ directive @${config2.maskEnableDirective} on FRAGMENT_SPREAD
|
|
|
75413
75824
|
"""
|
|
75414
75825
|
directive @${config2.maskDisableDirective} on FRAGMENT_SPREAD
|
|
75415
75826
|
`;
|
|
75416
|
-
let currentSchema =
|
|
75827
|
+
let currentSchema = graphql23.printSchema(config2.schema);
|
|
75417
75828
|
if (!currentSchema.includes(`directive @${config2.listDirective}`)) {
|
|
75418
75829
|
currentSchema += internalSchema;
|
|
75419
75830
|
}
|
|
75420
75831
|
config2.newSchema += internalSchema;
|
|
75421
|
-
config2.schema =
|
|
75832
|
+
config2.schema = graphql23.buildSchema(currentSchema);
|
|
75422
75833
|
}
|
|
75423
75834
|
|
|
75424
75835
|
// src/codegen/transforms/typename.ts
|
|
75425
|
-
var
|
|
75836
|
+
var graphql24 = __toESM(require_graphql2(), 1);
|
|
75426
75837
|
async function addTypename(config2, documents) {
|
|
75427
75838
|
for (const doc of documents) {
|
|
75428
|
-
doc.document =
|
|
75839
|
+
doc.document = graphql24.visit(doc.document, {
|
|
75429
75840
|
Field(node, key, parent, path2, ancestors) {
|
|
75430
75841
|
if (!node.selectionSet) {
|
|
75431
75842
|
return;
|
|
@@ -75437,7 +75848,7 @@ async function addTypename(config2, documents) {
|
|
|
75437
75848
|
);
|
|
75438
75849
|
const field = type.getFields()[node.name.value];
|
|
75439
75850
|
const fieldType = unwrapType(config2, field.type).type;
|
|
75440
|
-
if (
|
|
75851
|
+
if (graphql24.isInterfaceType(fieldType) || graphql24.isUnionType(fieldType)) {
|
|
75441
75852
|
return {
|
|
75442
75853
|
...node,
|
|
75443
75854
|
selectionSet: {
|
|
@@ -75445,9 +75856,9 @@ async function addTypename(config2, documents) {
|
|
|
75445
75856
|
selections: [
|
|
75446
75857
|
...node.selectionSet.selections,
|
|
75447
75858
|
{
|
|
75448
|
-
kind:
|
|
75859
|
+
kind: graphql24.Kind.FIELD,
|
|
75449
75860
|
name: {
|
|
75450
|
-
kind:
|
|
75861
|
+
kind: graphql24.Kind.NAME,
|
|
75451
75862
|
value: "__typename"
|
|
75452
75863
|
}
|
|
75453
75864
|
}
|
|
@@ -75461,10 +75872,10 @@ async function addTypename(config2, documents) {
|
|
|
75461
75872
|
}
|
|
75462
75873
|
|
|
75463
75874
|
// src/codegen/transforms/addID.ts
|
|
75464
|
-
var
|
|
75875
|
+
var graphql25 = __toESM(require_graphql2(), 1);
|
|
75465
75876
|
async function addID(config2, documents) {
|
|
75466
75877
|
for (const doc of documents) {
|
|
75467
|
-
doc.document =
|
|
75878
|
+
doc.document = graphql25.visit(doc.document, {
|
|
75468
75879
|
Field(node, key, parent, path2, ancestors) {
|
|
75469
75880
|
if (!node.selectionSet) {
|
|
75470
75881
|
return;
|
|
@@ -75477,7 +75888,7 @@ async function addID(config2, documents) {
|
|
|
75477
75888
|
const field = type.getFields()[node.name.value];
|
|
75478
75889
|
const fieldType = unwrapType(config2, field.type).type;
|
|
75479
75890
|
if (node.selectionSet?.selections.length > 0) {
|
|
75480
|
-
if (!
|
|
75891
|
+
if (!graphql25.isObjectType(fieldType) && !graphql25.isInterfaceType(fieldType)) {
|
|
75481
75892
|
return;
|
|
75482
75893
|
}
|
|
75483
75894
|
const keyFields = config2.keyFieldsForType(fieldType.name);
|
|
@@ -75492,9 +75903,9 @@ async function addID(config2, documents) {
|
|
|
75492
75903
|
continue;
|
|
75493
75904
|
}
|
|
75494
75905
|
selections.push({
|
|
75495
|
-
kind:
|
|
75906
|
+
kind: graphql25.Kind.FIELD,
|
|
75496
75907
|
name: {
|
|
75497
|
-
kind:
|
|
75908
|
+
kind: graphql25.Kind.NAME,
|
|
75498
75909
|
value: keyField
|
|
75499
75910
|
}
|
|
75500
75911
|
});
|
|
@@ -75513,8 +75924,8 @@ async function addID(config2, documents) {
|
|
|
75513
75924
|
}
|
|
75514
75925
|
|
|
75515
75926
|
// src/codegen/transforms/fragmentVariables.ts
|
|
75516
|
-
var
|
|
75517
|
-
var GraphqlKinds2 =
|
|
75927
|
+
var graphql26 = __toESM(require_graphql2(), 1);
|
|
75928
|
+
var GraphqlKinds2 = graphql26.Kind;
|
|
75518
75929
|
async function fragmentVariables(config2, documents) {
|
|
75519
75930
|
const fragments = collectFragments(config2, documents);
|
|
75520
75931
|
const generatedFragments = {};
|
|
@@ -75537,7 +75948,7 @@ async function fragmentVariables(config2, documents) {
|
|
|
75537
75948
|
});
|
|
75538
75949
|
}
|
|
75539
75950
|
const doc = {
|
|
75540
|
-
kind:
|
|
75951
|
+
kind: graphql26.Kind.DOCUMENT,
|
|
75541
75952
|
definitions: Object.values(generatedFragments)
|
|
75542
75953
|
};
|
|
75543
75954
|
documents.push({
|
|
@@ -75573,7 +75984,7 @@ function inlineFragmentArgs({
|
|
|
75573
75984
|
filepath,
|
|
75574
75985
|
document
|
|
75575
75986
|
).reduce((acc, arg) => ({ ...acc, [arg.name]: arg }), {});
|
|
75576
|
-
const result =
|
|
75987
|
+
const result = graphql26.visit(document, {
|
|
75577
75988
|
FragmentSpread(node) {
|
|
75578
75989
|
const { definition } = fragmentDefinitions[node.name.value];
|
|
75579
75990
|
let { args, hash } = collectWithArguments(config2, filepath, node, scope);
|
|
@@ -75661,7 +76072,7 @@ function inlineFragmentArgs({
|
|
|
75661
76072
|
});
|
|
75662
76073
|
if (newName) {
|
|
75663
76074
|
result.name = {
|
|
75664
|
-
kind:
|
|
76075
|
+
kind: graphql26.Kind.NAME,
|
|
75665
76076
|
value: newName
|
|
75666
76077
|
};
|
|
75667
76078
|
}
|
|
@@ -75773,7 +76184,7 @@ function operationScope(operation) {
|
|
|
75773
76184
|
}
|
|
75774
76185
|
|
|
75775
76186
|
// src/codegen/validators/typeCheck.ts
|
|
75776
|
-
var
|
|
76187
|
+
var graphql27 = __toESM(require_graphql2(), 1);
|
|
75777
76188
|
async function typeCheck(config2, docs) {
|
|
75778
76189
|
const errors = [];
|
|
75779
76190
|
const freeLists = [];
|
|
@@ -75781,11 +76192,11 @@ async function typeCheck(config2, docs) {
|
|
|
75781
76192
|
const listTypes = [];
|
|
75782
76193
|
const fragments = {};
|
|
75783
76194
|
for (const { document: parsed, filename } of docs) {
|
|
75784
|
-
|
|
75785
|
-
[
|
|
76195
|
+
graphql27.visit(parsed, {
|
|
76196
|
+
[graphql27.Kind.FRAGMENT_DEFINITION](definition) {
|
|
75786
76197
|
fragments[definition.name.value] = definition;
|
|
75787
76198
|
},
|
|
75788
|
-
[
|
|
76199
|
+
[graphql27.Kind.DIRECTIVE](directive, _, parent, __, ancestors) {
|
|
75789
76200
|
if (![config2.listDirective, config2.paginateDirective].includes(directive.name.value)) {
|
|
75790
76201
|
return;
|
|
75791
76202
|
}
|
|
@@ -75831,14 +76242,14 @@ async function typeCheck(config2, docs) {
|
|
|
75831
76242
|
);
|
|
75832
76243
|
return;
|
|
75833
76244
|
}
|
|
75834
|
-
if (
|
|
76245
|
+
if (graphql27.isListType(rootType) || graphql27.isNonNullType(rootType) && graphql27.isListType(rootType.ofType)) {
|
|
75835
76246
|
needsParent = true;
|
|
75836
76247
|
break;
|
|
75837
76248
|
}
|
|
75838
|
-
if (
|
|
76249
|
+
if (graphql27.isNonNullType(rootType) && "ofType" in rootType) {
|
|
75839
76250
|
rootType = rootType.ofType;
|
|
75840
76251
|
}
|
|
75841
|
-
if (
|
|
76252
|
+
if (graphql27.isScalarType(rootType)) {
|
|
75842
76253
|
break;
|
|
75843
76254
|
}
|
|
75844
76255
|
rootType = rootType?.getFields()[parent2.name.value]?.type;
|
|
@@ -75914,9 +76325,9 @@ async function typeCheck(config2, docs) {
|
|
|
75914
76325
|
);
|
|
75915
76326
|
}
|
|
75916
76327
|
let targetTypes = [type];
|
|
75917
|
-
if (
|
|
76328
|
+
if (graphql27.isUnionType(type)) {
|
|
75918
76329
|
targetTypes = config2.schema.getPossibleTypes(type);
|
|
75919
|
-
} else if (
|
|
76330
|
+
} else if (graphql27.isInterfaceType(type)) {
|
|
75920
76331
|
try {
|
|
75921
76332
|
for (const key of config2.keyFieldsForType(type.name)) {
|
|
75922
76333
|
if (!type.getFields()[key]) {
|
|
@@ -75954,13 +76365,13 @@ async function typeCheck(config2, docs) {
|
|
|
75954
76365
|
if (errors.length > 0) {
|
|
75955
76366
|
throw errors;
|
|
75956
76367
|
}
|
|
75957
|
-
const rules = (filepath) => [...
|
|
76368
|
+
const rules = (filepath) => [...graphql27.specifiedRules].filter(
|
|
75958
76369
|
(rule) => ![
|
|
75959
|
-
|
|
75960
|
-
|
|
75961
|
-
|
|
75962
|
-
|
|
75963
|
-
|
|
76370
|
+
graphql27.NoUnusedFragmentsRule,
|
|
76371
|
+
graphql27.KnownFragmentNamesRule,
|
|
76372
|
+
graphql27.ExecutableDefinitionsRule,
|
|
76373
|
+
graphql27.KnownDirectivesRule,
|
|
76374
|
+
graphql27.KnownArgumentNamesRule
|
|
75964
76375
|
].includes(rule)
|
|
75965
76376
|
).concat(
|
|
75966
76377
|
validateLists({
|
|
@@ -75979,7 +76390,7 @@ async function typeCheck(config2, docs) {
|
|
|
75979
76390
|
noUnusedFragmentArguments(config2)
|
|
75980
76391
|
);
|
|
75981
76392
|
for (const { filename, document: parsed } of docs) {
|
|
75982
|
-
for (const error of
|
|
76393
|
+
for (const error of graphql27.validate(config2.schema, parsed, rules(filename))) {
|
|
75983
76394
|
errors.push(
|
|
75984
76395
|
new HoudiniError({
|
|
75985
76396
|
filepath: filename,
|
|
@@ -76005,7 +76416,7 @@ var validateLists = ({
|
|
|
76005
76416
|
if (!config2.isListFragment(node.name.value)) {
|
|
76006
76417
|
if (!fragments[node.name.value]) {
|
|
76007
76418
|
ctx.reportError(
|
|
76008
|
-
new
|
|
76419
|
+
new graphql27.GraphQLError(
|
|
76009
76420
|
"Encountered unknown fragment: " + node.name.value
|
|
76010
76421
|
)
|
|
76011
76422
|
);
|
|
@@ -76015,7 +76426,7 @@ var validateLists = ({
|
|
|
76015
76426
|
const listName = config2.listNameFromFragment(node.name.value);
|
|
76016
76427
|
if (!lists.includes(listName)) {
|
|
76017
76428
|
ctx.reportError(
|
|
76018
|
-
new
|
|
76429
|
+
new graphql27.GraphQLError(
|
|
76019
76430
|
"Encountered fragment referencing unknown list: " + listName
|
|
76020
76431
|
)
|
|
76021
76432
|
);
|
|
@@ -76040,7 +76451,7 @@ var validateLists = ({
|
|
|
76040
76451
|
);
|
|
76041
76452
|
if (parentArg) {
|
|
76042
76453
|
ctx.reportError(
|
|
76043
|
-
new
|
|
76454
|
+
new graphql27.GraphQLError(
|
|
76044
76455
|
`@${config2.deprecatedlistDirectiveParentIDArg} should be defined only in it's own directive now`
|
|
76045
76456
|
)
|
|
76046
76457
|
);
|
|
@@ -76056,7 +76467,7 @@ var validateLists = ({
|
|
|
76056
76467
|
return;
|
|
76057
76468
|
}
|
|
76058
76469
|
ctx.reportError(
|
|
76059
|
-
new
|
|
76470
|
+
new graphql27.GraphQLError(
|
|
76060
76471
|
`For this list fragment, you need to add or @${config2.listParentDirective} or @${config2.listAllListsDirective} directive to specify the behavior`
|
|
76061
76472
|
)
|
|
76062
76473
|
);
|
|
@@ -76066,7 +76477,7 @@ var validateLists = ({
|
|
|
76066
76477
|
const directiveName = node.name.value;
|
|
76067
76478
|
if (directiveName === "connection") {
|
|
76068
76479
|
ctx.reportError(
|
|
76069
|
-
new
|
|
76480
|
+
new graphql27.GraphQLError(
|
|
76070
76481
|
"@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."
|
|
76071
76482
|
)
|
|
76072
76483
|
);
|
|
@@ -76075,7 +76486,7 @@ var validateLists = ({
|
|
|
76075
76486
|
if (!config2.isInternalDirective(node)) {
|
|
76076
76487
|
if (!config2.schema.getDirective(directiveName)) {
|
|
76077
76488
|
ctx.reportError(
|
|
76078
|
-
new
|
|
76489
|
+
new graphql27.GraphQLError(
|
|
76079
76490
|
"Encountered unknown directive: " + directiveName
|
|
76080
76491
|
)
|
|
76081
76492
|
);
|
|
@@ -76084,7 +76495,7 @@ var validateLists = ({
|
|
|
76084
76495
|
}
|
|
76085
76496
|
if (config2.isListOperationDirective(directiveName) && !listTypes.includes(config2.listNameFromDirective(directiveName))) {
|
|
76086
76497
|
ctx.reportError(
|
|
76087
|
-
new
|
|
76498
|
+
new graphql27.GraphQLError(
|
|
76088
76499
|
"Encountered directive referencing unknown list: " + directiveName
|
|
76089
76500
|
)
|
|
76090
76501
|
);
|
|
@@ -76095,7 +76506,7 @@ var validateLists = ({
|
|
|
76095
76506
|
};
|
|
76096
76507
|
function knownArguments(config2) {
|
|
76097
76508
|
return function(ctx) {
|
|
76098
|
-
const nativeValidator =
|
|
76509
|
+
const nativeValidator = graphql27.KnownArgumentNamesRule(ctx);
|
|
76099
76510
|
return {
|
|
76100
76511
|
...nativeValidator,
|
|
76101
76512
|
Directive(directiveNode) {
|
|
@@ -76128,7 +76539,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
76128
76539
|
for (const arg of node.arguments || []) {
|
|
76129
76540
|
if (arg.value.kind !== "ObjectValue") {
|
|
76130
76541
|
ctx.reportError(
|
|
76131
|
-
new
|
|
76542
|
+
new graphql27.GraphQLError("values in @arguments must be an object")
|
|
76132
76543
|
);
|
|
76133
76544
|
return;
|
|
76134
76545
|
}
|
|
@@ -76138,13 +76549,13 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
76138
76549
|
);
|
|
76139
76550
|
if (!typeArg) {
|
|
76140
76551
|
ctx.reportError(
|
|
76141
|
-
new
|
|
76552
|
+
new graphql27.GraphQLError("missing type field for @arguments directive")
|
|
76142
76553
|
);
|
|
76143
76554
|
return;
|
|
76144
76555
|
}
|
|
76145
|
-
if (typeArg.value.kind !==
|
|
76556
|
+
if (typeArg.value.kind !== graphql27.Kind.STRING) {
|
|
76146
76557
|
ctx.reportError(
|
|
76147
|
-
new
|
|
76558
|
+
new graphql27.GraphQLError("type field to @arguments must be a string")
|
|
76148
76559
|
);
|
|
76149
76560
|
return;
|
|
76150
76561
|
}
|
|
@@ -76157,7 +76568,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
76157
76568
|
);
|
|
76158
76569
|
if (typeArg.value.value !== defaultValueType) {
|
|
76159
76570
|
ctx.reportError(
|
|
76160
|
-
new
|
|
76571
|
+
new graphql27.GraphQLError(
|
|
76161
76572
|
`Invalid default value provided for ${arg.name.value}. Expected ${typeArg.value.value}, found ${defaultValueType}`
|
|
76162
76573
|
)
|
|
76163
76574
|
);
|
|
@@ -76175,7 +76586,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
76175
76586
|
try {
|
|
76176
76587
|
args = fragmentArguments(config2, filepath, fragments[fragmentName]);
|
|
76177
76588
|
} catch (e2) {
|
|
76178
|
-
ctx.reportError(new
|
|
76589
|
+
ctx.reportError(new graphql27.GraphQLError(e2.message));
|
|
76179
76590
|
return;
|
|
76180
76591
|
}
|
|
76181
76592
|
fragmentArguments2[fragmentName] = args;
|
|
@@ -76198,7 +76609,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
76198
76609
|
);
|
|
76199
76610
|
if (missing.length > 0) {
|
|
76200
76611
|
ctx.reportError(
|
|
76201
|
-
new
|
|
76612
|
+
new graphql27.GraphQLError(
|
|
76202
76613
|
"The following arguments are missing from this fragment: " + JSON.stringify(missing)
|
|
76203
76614
|
)
|
|
76204
76615
|
);
|
|
@@ -76209,7 +76620,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
76209
76620
|
);
|
|
76210
76621
|
if (unknown.length > 0) {
|
|
76211
76622
|
ctx.reportError(
|
|
76212
|
-
new
|
|
76623
|
+
new graphql27.GraphQLError(
|
|
76213
76624
|
"Encountered unknown arguments: " + JSON.stringify(unknown)
|
|
76214
76625
|
)
|
|
76215
76626
|
);
|
|
@@ -76221,7 +76632,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
76221
76632
|
]
|
|
76222
76633
|
);
|
|
76223
76634
|
for (const [applied, target] of zipped) {
|
|
76224
|
-
if (applied.value.kind ===
|
|
76635
|
+
if (applied.value.kind === graphql27.Kind.VARIABLE || applied.value.kind === graphql27.Kind.LIST || applied.value.kind === graphql27.Kind.OBJECT) {
|
|
76225
76636
|
continue;
|
|
76226
76637
|
}
|
|
76227
76638
|
const appliedType = applied.value.kind.substring(
|
|
@@ -76230,7 +76641,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
76230
76641
|
);
|
|
76231
76642
|
if (appliedType !== target) {
|
|
76232
76643
|
ctx.reportError(
|
|
76233
|
-
new
|
|
76644
|
+
new graphql27.GraphQLError(
|
|
76234
76645
|
`Invalid argument type. Expected ${target}, found ${appliedType}`
|
|
76235
76646
|
)
|
|
76236
76647
|
);
|
|
@@ -76251,7 +76662,7 @@ function paginateArgs(config2, filepath) {
|
|
|
76251
76662
|
}
|
|
76252
76663
|
if (alreadyPaginated) {
|
|
76253
76664
|
ctx.reportError(
|
|
76254
|
-
new
|
|
76665
|
+
new graphql27.GraphQLError(
|
|
76255
76666
|
`@${config2.paginateDirective} can only appear in a document once.`
|
|
76256
76667
|
)
|
|
76257
76668
|
);
|
|
@@ -76266,7 +76677,7 @@ function paginateArgs(config2, filepath) {
|
|
|
76266
76677
|
const hasRequiredArgs = definitionArgs.find((arg) => arg.required);
|
|
76267
76678
|
if (hasRequiredArgs) {
|
|
76268
76679
|
ctx.reportError(
|
|
76269
|
-
new
|
|
76680
|
+
new graphql27.GraphQLError(
|
|
76270
76681
|
"@paginate cannot appear on a document with required args"
|
|
76271
76682
|
)
|
|
76272
76683
|
);
|
|
@@ -76298,14 +76709,14 @@ function paginateArgs(config2, filepath) {
|
|
|
76298
76709
|
const backwards = appliedArgs.has("last");
|
|
76299
76710
|
if (!forward && !backwards) {
|
|
76300
76711
|
ctx.reportError(
|
|
76301
|
-
new
|
|
76712
|
+
new graphql27.GraphQLError(
|
|
76302
76713
|
"A field with cursor-based pagination must have a first or last argument"
|
|
76303
76714
|
)
|
|
76304
76715
|
);
|
|
76305
76716
|
}
|
|
76306
76717
|
if (forward && backwards) {
|
|
76307
76718
|
ctx.reportError(
|
|
76308
|
-
new
|
|
76719
|
+
new graphql27.GraphQLError(
|
|
76309
76720
|
`A field with cursor pagination cannot go forwards an backwards simultaneously`
|
|
76310
76721
|
)
|
|
76311
76722
|
);
|
|
@@ -76319,7 +76730,7 @@ function paginateArgs(config2, filepath) {
|
|
|
76319
76730
|
);
|
|
76320
76731
|
if (!appliedLimitArg) {
|
|
76321
76732
|
ctx.reportError(
|
|
76322
|
-
new
|
|
76733
|
+
new graphql27.GraphQLError(
|
|
76323
76734
|
"A field with offset-based pagination must have a limit argument"
|
|
76324
76735
|
)
|
|
76325
76736
|
);
|
|
@@ -76335,20 +76746,20 @@ function noUnusedFragmentArguments(config2) {
|
|
|
76335
76746
|
const args = /* @__PURE__ */ new Set();
|
|
76336
76747
|
return {
|
|
76337
76748
|
enter(node) {
|
|
76338
|
-
if (node.kind ===
|
|
76749
|
+
if (node.kind === graphql27.Kind.FRAGMENT_DEFINITION) {
|
|
76339
76750
|
const definitionArguments = node.directives?.filter((directive) => directive.name.value === config2.argumentsDirective).flatMap((directive) => directive.arguments);
|
|
76340
76751
|
for (const arg of definitionArguments?.map((arg2) => arg2?.name.value) || []) {
|
|
76341
76752
|
args.add(arg);
|
|
76342
76753
|
}
|
|
76343
|
-
} else if (node.kind ===
|
|
76754
|
+
} else if (node.kind === graphql27.Kind.VARIABLE) {
|
|
76344
76755
|
args.delete(node.name.value);
|
|
76345
76756
|
}
|
|
76346
76757
|
},
|
|
76347
76758
|
leave(node) {
|
|
76348
|
-
if (node.kind ===
|
|
76759
|
+
if (node.kind === graphql27.Kind.FRAGMENT_DEFINITION) {
|
|
76349
76760
|
if (args.size > 0) {
|
|
76350
76761
|
ctx.reportError(
|
|
76351
|
-
new
|
|
76762
|
+
new graphql27.GraphQLError(
|
|
76352
76763
|
"Encountered unused fragment arguments: " + [...args].join(",")
|
|
76353
76764
|
)
|
|
76354
76765
|
);
|
|
@@ -76384,7 +76795,7 @@ function nodeDirectives(config2, directives) {
|
|
|
76384
76795
|
if (definition.kind === "OperationDefinition") {
|
|
76385
76796
|
if (definition.operation !== "query") {
|
|
76386
76797
|
ctx.reportError(
|
|
76387
|
-
new
|
|
76798
|
+
new graphql27.GraphQLError(
|
|
76388
76799
|
`@${node.name.value} must fall on a fragment or query document`
|
|
76389
76800
|
)
|
|
76390
76801
|
);
|
|
@@ -76396,7 +76807,7 @@ function nodeDirectives(config2, directives) {
|
|
|
76396
76807
|
}
|
|
76397
76808
|
if (!possibleNodes.includes(definitionType)) {
|
|
76398
76809
|
ctx.reportError(
|
|
76399
|
-
new
|
|
76810
|
+
new graphql27.GraphQLError(paginateOnNonNodeMessage(config2, node.name.value))
|
|
76400
76811
|
);
|
|
76401
76812
|
}
|
|
76402
76813
|
}
|
|
@@ -76415,7 +76826,7 @@ function checkMutationOperation(config2) {
|
|
|
76415
76826
|
);
|
|
76416
76827
|
if (append && prepend) {
|
|
76417
76828
|
ctx.reportError(
|
|
76418
|
-
new
|
|
76829
|
+
new graphql27.GraphQLError(
|
|
76419
76830
|
`You can't apply both @${config2.listPrependDirective} and @${config2.listAppendDirective} at the same time`
|
|
76420
76831
|
)
|
|
76421
76832
|
);
|
|
@@ -76429,7 +76840,7 @@ function checkMutationOperation(config2) {
|
|
|
76429
76840
|
);
|
|
76430
76841
|
if (parentId && allLists) {
|
|
76431
76842
|
ctx.reportError(
|
|
76432
|
-
new
|
|
76843
|
+
new graphql27.GraphQLError(
|
|
76433
76844
|
`You can't apply both @${config2.listParentDirective} and @${config2.listAllListsDirective} at the same time`
|
|
76434
76845
|
)
|
|
76435
76846
|
);
|
|
@@ -76451,7 +76862,7 @@ function checkMaskDirective(config2) {
|
|
|
76451
76862
|
);
|
|
76452
76863
|
if (maskEnableDirective && maskDisableDirective) {
|
|
76453
76864
|
ctx.reportError(
|
|
76454
|
-
new
|
|
76865
|
+
new graphql27.GraphQLError(
|
|
76455
76866
|
`You can't apply both @${config2.maskEnableDirective} and @${config2.maskDisableDirective} at the same time`
|
|
76456
76867
|
)
|
|
76457
76868
|
);
|
|
@@ -76467,7 +76878,7 @@ function getAndVerifyNodeInterface(config2) {
|
|
|
76467
76878
|
if (!nodeInterface) {
|
|
76468
76879
|
return null;
|
|
76469
76880
|
}
|
|
76470
|
-
if (!
|
|
76881
|
+
if (!graphql27.isInterfaceType(nodeInterface)) {
|
|
76471
76882
|
displayInvalidNodeFieldMessage(config2.logLevel);
|
|
76472
76883
|
return null;
|
|
76473
76884
|
}
|
|
@@ -76565,11 +76976,11 @@ async function uniqueDocumentNames(config2, docs) {
|
|
|
76565
76976
|
}
|
|
76566
76977
|
|
|
76567
76978
|
// src/codegen/validators/noIDAlias.ts
|
|
76568
|
-
var
|
|
76979
|
+
var graphql28 = __toESM(require_graphql2(), 1);
|
|
76569
76980
|
async function noIDAlias(config2, docs) {
|
|
76570
76981
|
const errors = [];
|
|
76571
76982
|
for (const { filename, document } of docs) {
|
|
76572
|
-
|
|
76983
|
+
graphql28.visit(document, {
|
|
76573
76984
|
Field(node, _, __, ___, ancestors) {
|
|
76574
76985
|
const fieldType = parentTypeFromAncestors(config2.schema, filename, ancestors).name;
|
|
76575
76986
|
if (config2.keyFieldsForType(fieldType).includes(node.alias?.value || "")) {
|
|
@@ -76711,8 +77122,8 @@ async function collectDocuments(config2) {
|
|
|
76711
77122
|
}
|
|
76712
77123
|
}
|
|
76713
77124
|
}
|
|
76714
|
-
const graphql_extractor = (filepath, content) => [content];
|
|
76715
|
-
const javascript_extractor = (
|
|
77125
|
+
const graphql_extractor = (config3, filepath, content) => [content];
|
|
77126
|
+
const javascript_extractor = (fconfig, ilepath, content) => processJSFile(config2, content);
|
|
76716
77127
|
extractors[".ts"].push(javascript_extractor);
|
|
76717
77128
|
extractors[".js"].push(javascript_extractor);
|
|
76718
77129
|
extractors[".graphql"].push(graphql_extractor);
|
|
@@ -76736,7 +77147,7 @@ async function collectDocuments(config2) {
|
|
|
76736
77147
|
if (!extractor) {
|
|
76737
77148
|
continue;
|
|
76738
77149
|
}
|
|
76739
|
-
const found = await extractor(filepath, contents);
|
|
77150
|
+
const found = await extractor(config2, filepath, contents);
|
|
76740
77151
|
if (found.length > 0) {
|
|
76741
77152
|
documents.push(...found.map((document) => ({ filepath, document })));
|
|
76742
77153
|
}
|
|
@@ -76767,12 +77178,12 @@ async function processJSFile(config2, contents) {
|
|
|
76767
77178
|
return documents;
|
|
76768
77179
|
}
|
|
76769
77180
|
async function processGraphQLDocument(config2, filepath, document) {
|
|
76770
|
-
const parsedDoc =
|
|
77181
|
+
const parsedDoc = graphql29.parse(document);
|
|
76771
77182
|
const operations = parsedDoc.definitions.filter(
|
|
76772
|
-
({ kind: kind2 }) => kind2 ===
|
|
77183
|
+
({ kind: kind2 }) => kind2 === graphql29.Kind.OPERATION_DEFINITION
|
|
76773
77184
|
);
|
|
76774
77185
|
const fragments = parsedDoc.definitions.filter(
|
|
76775
|
-
({ kind: kind2 }) => kind2 ===
|
|
77186
|
+
({ kind: kind2 }) => kind2 === graphql29.Kind.FRAGMENT_DEFINITION
|
|
76776
77187
|
);
|
|
76777
77188
|
if (operations.length > 1) {
|
|
76778
77189
|
throw new HoudiniError({
|
|
@@ -76852,7 +77263,8 @@ function logStyled(kind, stat3, logLevel, plugin) {
|
|
|
76852
77263
|
// src/cmd/pullSchema.ts
|
|
76853
77264
|
async function pullSchema_default(args) {
|
|
76854
77265
|
const config2 = await getConfig({ noSchema: true });
|
|
76855
|
-
|
|
77266
|
+
const apiURL = await config2.apiURL();
|
|
77267
|
+
if (!apiURL) {
|
|
76856
77268
|
console.log(
|
|
76857
77269
|
"\u274C Your project does not have a remote endpoint configured. Please provide one with the `apiUrl` value in your houdini.config.js file."
|
|
76858
77270
|
);
|
|
@@ -76860,7 +77272,7 @@ async function pullSchema_default(args) {
|
|
|
76860
77272
|
return;
|
|
76861
77273
|
}
|
|
76862
77274
|
const targetPath = process.cwd();
|
|
76863
|
-
let headers = config2.pullHeaders;
|
|
77275
|
+
let headers = await config2.pullHeaders();
|
|
76864
77276
|
let headerStrings = [];
|
|
76865
77277
|
if (args.headers) {
|
|
76866
77278
|
headerStrings = args.headers;
|
|
@@ -76875,7 +77287,7 @@ async function pullSchema_default(args) {
|
|
|
76875
77287
|
}, headers);
|
|
76876
77288
|
}
|
|
76877
77289
|
await pullSchema(
|
|
76878
|
-
|
|
77290
|
+
apiURL,
|
|
76879
77291
|
config2.schemaPath ? config2.schemaPath : path_exports.resolve(targetPath, "schema.json"),
|
|
76880
77292
|
headers
|
|
76881
77293
|
);
|
|
@@ -76897,7 +77309,7 @@ async function generate(args = {
|
|
|
76897
77309
|
if (args.output) {
|
|
76898
77310
|
config2.persistedQueryPath = args.output;
|
|
76899
77311
|
}
|
|
76900
|
-
if (args.pullSchema && config2.
|
|
77312
|
+
if (args.pullSchema && await config2.apiURL()) {
|
|
76901
77313
|
if (args.pullHeader) {
|
|
76902
77314
|
console.log("\u26A0\uFE0F --pull-headers has been replaced by --headers (abbreviated -h)");
|
|
76903
77315
|
args.headers = args.pullHeader;
|
|
@@ -77073,7 +77485,7 @@ async function init(_path, args) {
|
|
|
77073
77485
|
await graphqlRCFile(targetPath);
|
|
77074
77486
|
await gitIgnore(targetPath);
|
|
77075
77487
|
if (framework === "kit") {
|
|
77076
|
-
await updateSvelteConfig(targetPath);
|
|
77488
|
+
await updateSvelteConfig(targetPath, typescript);
|
|
77077
77489
|
} else if (framework === "svelte") {
|
|
77078
77490
|
await updateSvelteMainJs(targetPath);
|
|
77079
77491
|
}
|
|
@@ -77096,14 +77508,15 @@ async function init(_path, args) {
|
|
|
77096
77508
|
2\uFE0F\u20E3 Start your application: ${logGreen(cmd_run)}
|
|
77097
77509
|
`);
|
|
77098
77510
|
}
|
|
77099
|
-
var networkFile = (url, typescript) => `import { HoudiniClient${typescript ? ", type
|
|
77511
|
+
var networkFile = (url, typescript) => `import { HoudiniClient${typescript ? ", type RequestHandler" : ""} } from '$houdini';
|
|
77100
77512
|
|
|
77101
|
-
|
|
77513
|
+
${typescript ? `const requestHandler: RequestHandler` : `/** @type {import('$houdini').RequestHandler<any>} */
|
|
77514
|
+
const requestHandler`} = async ({
|
|
77102
77515
|
fetch,
|
|
77103
77516
|
text = '',
|
|
77104
77517
|
variables = {},
|
|
77105
77518
|
metadata
|
|
77106
|
-
}
|
|
77519
|
+
}) => {
|
|
77107
77520
|
const url = '${url}';
|
|
77108
77521
|
const result = await fetch(url, {
|
|
77109
77522
|
method: 'POST',
|
|
@@ -77118,7 +77531,7 @@ async function fetchQuery({
|
|
|
77118
77531
|
return await result.json();
|
|
77119
77532
|
}
|
|
77120
77533
|
|
|
77121
|
-
export default new HoudiniClient(
|
|
77534
|
+
export default new HoudiniClient(requestHandler);
|
|
77122
77535
|
`;
|
|
77123
77536
|
var writeConfigFile = async ({
|
|
77124
77537
|
configPath,
|
|
@@ -77256,16 +77669,16 @@ export default config;
|
|
|
77256
77669
|
});
|
|
77257
77670
|
}
|
|
77258
77671
|
}
|
|
77259
|
-
async function updateSvelteConfig(targetPath) {
|
|
77672
|
+
async function updateSvelteConfig(targetPath, typescript) {
|
|
77260
77673
|
const svelteConfigPath = path_exports.join(targetPath, "svelte.config.js");
|
|
77261
|
-
const
|
|
77262
|
-
import
|
|
77674
|
+
const newContentTs = `import adapter from '@sveltejs/adapter-auto';
|
|
77675
|
+
import { vitePreprocess } from '@sveltejs/kit/vite';
|
|
77263
77676
|
|
|
77264
77677
|
/** @type {import('@sveltejs/kit').Config} */
|
|
77265
77678
|
const config = {
|
|
77266
|
-
// Consult https://
|
|
77679
|
+
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
|
|
77267
77680
|
// for more information about preprocessors
|
|
77268
|
-
preprocess:
|
|
77681
|
+
preprocess: vitePreprocess(),
|
|
77269
77682
|
|
|
77270
77683
|
kit: {
|
|
77271
77684
|
adapter: adapter(),
|
|
@@ -77275,11 +77688,25 @@ const config = {
|
|
|
77275
77688
|
}
|
|
77276
77689
|
};
|
|
77277
77690
|
|
|
77691
|
+
export default config;
|
|
77692
|
+
`;
|
|
77693
|
+
const newContentJs = `import adapter from '@sveltejs/adapter-auto';
|
|
77694
|
+
|
|
77695
|
+
/** @type {import('@sveltejs/kit').Config} */
|
|
77696
|
+
const config = {
|
|
77697
|
+
kit: {
|
|
77698
|
+
adapter: adapter(),
|
|
77699
|
+
alias: {
|
|
77700
|
+
$houdini: './$houdini',
|
|
77701
|
+
}
|
|
77702
|
+
}
|
|
77703
|
+
};
|
|
77704
|
+
|
|
77278
77705
|
export default config;
|
|
77279
77706
|
`;
|
|
77280
77707
|
await updateFile({
|
|
77281
77708
|
filepath: svelteConfigPath,
|
|
77282
|
-
content:
|
|
77709
|
+
content: typescript ? newContentTs : newContentJs
|
|
77283
77710
|
});
|
|
77284
77711
|
}
|
|
77285
77712
|
async function updateSvelteMainJs(targetPath) {
|
|
@@ -77311,8 +77738,8 @@ async function updatePackageJSON(targetPath) {
|
|
|
77311
77738
|
}
|
|
77312
77739
|
packageJSON.devDependencies = {
|
|
77313
77740
|
...packageJSON.devDependencies,
|
|
77314
|
-
houdini: "^0.
|
|
77315
|
-
"houdini-svelte": "^0.
|
|
77741
|
+
houdini: "^0.19.1",
|
|
77742
|
+
"houdini-svelte": "^0.19.1",
|
|
77316
77743
|
graphql: "^15.8.0"
|
|
77317
77744
|
};
|
|
77318
77745
|
await fs_exports.writeFile(packagePath, JSON.stringify(packageJSON, null, 4));
|