houdini-svelte 0.17.13 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/plugin/index.d.ts +1 -1
- package/build/plugin/naming.d.ts +5 -0
- package/build/plugin/transforms/query.d.ts +0 -1
- package/build/plugin-cjs/index.js +851 -704
- package/build/plugin-esm/index.js +851 -704
- package/build/preprocess-cjs/index.js +964 -813
- package/build/preprocess-esm/index.js +964 -813
- package/build/runtime-cjs/stores/query.js +3 -1
- package/build/runtime-esm/stores/query.js +3 -1
- package/build/test-cjs/index.js +1681 -1188
- package/build/test-esm/index.js +1681 -1188
- package/package.json +3 -3
- package/build/runtime-cjs/stores/pagination/pageInfo.test.js +0 -34
- package/build/runtime-esm/stores/pagination/pageInfo.test.js +0 -33
|
@@ -11809,13 +11809,13 @@ var require_esprima5 = __commonJS({
|
|
|
11809
11809
|
return Reader2;
|
|
11810
11810
|
}();
|
|
11811
11811
|
var Tokenizer = function() {
|
|
11812
|
-
function Tokenizer2(code,
|
|
11812
|
+
function Tokenizer2(code, config3) {
|
|
11813
11813
|
this.errorHandler = new error_handler_1.ErrorHandler();
|
|
11814
|
-
this.errorHandler.tolerant =
|
|
11814
|
+
this.errorHandler.tolerant = config3 ? typeof config3.tolerant === "boolean" && config3.tolerant : false;
|
|
11815
11815
|
this.scanner = new scanner_1.Scanner(code, this.errorHandler);
|
|
11816
|
-
this.scanner.trackComment =
|
|
11817
|
-
this.trackRange =
|
|
11818
|
-
this.trackLoc =
|
|
11816
|
+
this.scanner.trackComment = config3 ? typeof config3.comment === "boolean" && config3.comment : false;
|
|
11817
|
+
this.trackRange = config3 ? typeof config3.range === "boolean" && config3.range : false;
|
|
11818
|
+
this.trackLoc = config3 ? typeof config3.loc === "boolean" && config3.loc : false;
|
|
11819
11819
|
this.buffer = [];
|
|
11820
11820
|
this.reader = new Reader();
|
|
11821
11821
|
}
|
|
@@ -13983,11 +13983,11 @@ var require_printer3 = __commonJS({
|
|
|
13983
13983
|
return this.code;
|
|
13984
13984
|
};
|
|
13985
13985
|
var emptyPrintResult = new PrintResult("");
|
|
13986
|
-
var Printer = function Printer2(
|
|
13986
|
+
var Printer = function Printer2(config3) {
|
|
13987
13987
|
assert_1.default.ok(this instanceof Printer2);
|
|
13988
|
-
var explicitTabWidth =
|
|
13989
|
-
|
|
13990
|
-
|
|
13988
|
+
var explicitTabWidth = config3 && config3.tabWidth;
|
|
13989
|
+
config3 = options_1.normalize(config3);
|
|
13990
|
+
config3.sourceFileName = null;
|
|
13991
13991
|
function makePrintFunctionWith(options, overrides) {
|
|
13992
13992
|
options = Object.assign({}, options, overrides);
|
|
13993
13993
|
return function(path3) {
|
|
@@ -14002,19 +14002,19 @@ var require_printer3 = __commonJS({
|
|
|
14002
14002
|
includeComments: false
|
|
14003
14003
|
}));
|
|
14004
14004
|
}
|
|
14005
|
-
var oldTabWidth =
|
|
14005
|
+
var oldTabWidth = config3.tabWidth;
|
|
14006
14006
|
if (!explicitTabWidth) {
|
|
14007
14007
|
var loc = path3.getNode().loc;
|
|
14008
14008
|
if (loc && loc.lines && loc.lines.guessTabWidth) {
|
|
14009
|
-
|
|
14009
|
+
config3.tabWidth = loc.lines.guessTabWidth();
|
|
14010
14010
|
}
|
|
14011
14011
|
}
|
|
14012
14012
|
var reprinter = patcher_1.getReprinter(path3);
|
|
14013
|
-
var lines = reprinter ? reprinter(print2) : genericPrint(path3,
|
|
14013
|
+
var lines = reprinter ? reprinter(print2) : genericPrint(path3, config3, options, makePrintFunctionWith(options, {
|
|
14014
14014
|
includeComments: true,
|
|
14015
14015
|
avoidRootParens: false
|
|
14016
14016
|
}));
|
|
14017
|
-
|
|
14017
|
+
config3.tabWidth = oldTabWidth;
|
|
14018
14018
|
return lines;
|
|
14019
14019
|
}
|
|
14020
14020
|
this.print = function(ast) {
|
|
@@ -14025,7 +14025,7 @@ var require_printer3 = __commonJS({
|
|
|
14025
14025
|
includeComments: true,
|
|
14026
14026
|
avoidRootParens: false
|
|
14027
14027
|
});
|
|
14028
|
-
return new PrintResult(lines.toString(
|
|
14028
|
+
return new PrintResult(lines.toString(config3), util.composeSourceMaps(config3.inputSourceMap, lines.getSourceMap(config3.sourceMapName, config3.sourceRoot)));
|
|
14029
14029
|
};
|
|
14030
14030
|
this.printGenerically = function(ast) {
|
|
14031
14031
|
if (!ast) {
|
|
@@ -14033,26 +14033,26 @@ var require_printer3 = __commonJS({
|
|
|
14033
14033
|
}
|
|
14034
14034
|
function printGenerically(path4) {
|
|
14035
14035
|
return comments_1.printComments(path4, function(path5) {
|
|
14036
|
-
return genericPrint(path5,
|
|
14036
|
+
return genericPrint(path5, config3, {
|
|
14037
14037
|
includeComments: true,
|
|
14038
14038
|
avoidRootParens: false
|
|
14039
14039
|
}, printGenerically);
|
|
14040
14040
|
});
|
|
14041
14041
|
}
|
|
14042
14042
|
var path3 = fast_path_1.default.from(ast);
|
|
14043
|
-
var oldReuseWhitespace =
|
|
14044
|
-
|
|
14045
|
-
var pr = new PrintResult(printGenerically(path3).toString(
|
|
14046
|
-
|
|
14043
|
+
var oldReuseWhitespace = config3.reuseWhitespace;
|
|
14044
|
+
config3.reuseWhitespace = false;
|
|
14045
|
+
var pr = new PrintResult(printGenerically(path3).toString(config3));
|
|
14046
|
+
config3.reuseWhitespace = oldReuseWhitespace;
|
|
14047
14047
|
return pr;
|
|
14048
14048
|
};
|
|
14049
14049
|
};
|
|
14050
14050
|
exports.Printer = Printer;
|
|
14051
|
-
function genericPrint(path3,
|
|
14051
|
+
function genericPrint(path3, config3, options, printPath) {
|
|
14052
14052
|
assert_1.default.ok(path3 instanceof fast_path_1.default);
|
|
14053
14053
|
var node2 = path3.getValue();
|
|
14054
14054
|
var parts = [];
|
|
14055
|
-
var linesWithoutParens = genericPrintNoParens(path3,
|
|
14055
|
+
var linesWithoutParens = genericPrintNoParens(path3, config3, printPath);
|
|
14056
14056
|
if (!node2 || linesWithoutParens.isEmpty()) {
|
|
14057
14057
|
return linesWithoutParens;
|
|
14058
14058
|
}
|
|
@@ -19720,25 +19720,25 @@ var require_definition3 = __commonJS({
|
|
|
19720
19720
|
return arr && arr.length > 0 ? arr : void 0;
|
|
19721
19721
|
}
|
|
19722
19722
|
var GraphQLScalarType = /* @__PURE__ */ function() {
|
|
19723
|
-
function GraphQLScalarType2(
|
|
19723
|
+
function GraphQLScalarType2(config3) {
|
|
19724
19724
|
var _config$parseValue, _config$serialize, _config$parseLiteral;
|
|
19725
|
-
var parseValue = (_config$parseValue =
|
|
19726
|
-
this.name =
|
|
19727
|
-
this.description =
|
|
19728
|
-
this.specifiedByUrl =
|
|
19729
|
-
this.serialize = (_config$serialize =
|
|
19725
|
+
var parseValue = (_config$parseValue = config3.parseValue) !== null && _config$parseValue !== void 0 ? _config$parseValue : _identityFunc.default;
|
|
19726
|
+
this.name = config3.name;
|
|
19727
|
+
this.description = config3.description;
|
|
19728
|
+
this.specifiedByUrl = config3.specifiedByUrl;
|
|
19729
|
+
this.serialize = (_config$serialize = config3.serialize) !== null && _config$serialize !== void 0 ? _config$serialize : _identityFunc.default;
|
|
19730
19730
|
this.parseValue = parseValue;
|
|
19731
|
-
this.parseLiteral = (_config$parseLiteral =
|
|
19731
|
+
this.parseLiteral = (_config$parseLiteral = config3.parseLiteral) !== null && _config$parseLiteral !== void 0 ? _config$parseLiteral : function(node2, variables) {
|
|
19732
19732
|
return parseValue((0, _valueFromASTUntyped.valueFromASTUntyped)(node2, variables));
|
|
19733
19733
|
};
|
|
19734
|
-
this.extensions =
|
|
19735
|
-
this.astNode =
|
|
19736
|
-
this.extensionASTNodes = undefineIfEmpty(
|
|
19737
|
-
typeof
|
|
19738
|
-
|
|
19739
|
-
|
|
19740
|
-
if (
|
|
19741
|
-
typeof
|
|
19734
|
+
this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
|
|
19735
|
+
this.astNode = config3.astNode;
|
|
19736
|
+
this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
|
|
19737
|
+
typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
|
|
19738
|
+
config3.specifiedByUrl == null || typeof config3.specifiedByUrl === "string" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide "specifiedByUrl" as a string, ') + "but got: ".concat((0, _inspect.default)(config3.specifiedByUrl), "."));
|
|
19739
|
+
config3.serialize == null || typeof config3.serialize === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.'));
|
|
19740
|
+
if (config3.parseLiteral) {
|
|
19741
|
+
typeof config3.parseValue === "function" && typeof config3.parseLiteral === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide both "parseValue" and "parseLiteral" functions.'));
|
|
19742
19742
|
}
|
|
19743
19743
|
}
|
|
19744
19744
|
var _proto = GraphQLScalarType2.prototype;
|
|
@@ -19773,17 +19773,17 @@ var require_definition3 = __commonJS({
|
|
|
19773
19773
|
exports.GraphQLScalarType = GraphQLScalarType;
|
|
19774
19774
|
(0, _defineInspect.default)(GraphQLScalarType);
|
|
19775
19775
|
var GraphQLObjectType = /* @__PURE__ */ function() {
|
|
19776
|
-
function GraphQLObjectType2(
|
|
19777
|
-
this.name =
|
|
19778
|
-
this.description =
|
|
19779
|
-
this.isTypeOf =
|
|
19780
|
-
this.extensions =
|
|
19781
|
-
this.astNode =
|
|
19782
|
-
this.extensionASTNodes = undefineIfEmpty(
|
|
19783
|
-
this._fields = defineFieldMap.bind(void 0,
|
|
19784
|
-
this._interfaces = defineInterfaces.bind(void 0,
|
|
19785
|
-
typeof
|
|
19786
|
-
|
|
19776
|
+
function GraphQLObjectType2(config3) {
|
|
19777
|
+
this.name = config3.name;
|
|
19778
|
+
this.description = config3.description;
|
|
19779
|
+
this.isTypeOf = config3.isTypeOf;
|
|
19780
|
+
this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
|
|
19781
|
+
this.astNode = config3.astNode;
|
|
19782
|
+
this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
|
|
19783
|
+
this._fields = defineFieldMap.bind(void 0, config3);
|
|
19784
|
+
this._interfaces = defineInterfaces.bind(void 0, config3);
|
|
19785
|
+
typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
|
|
19786
|
+
config3.isTypeOf == null || typeof config3.isTypeOf === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide "isTypeOf" as a function, ') + "but got: ".concat((0, _inspect.default)(config3.isTypeOf), "."));
|
|
19787
19787
|
}
|
|
19788
19788
|
var _proto2 = GraphQLObjectType2.prototype;
|
|
19789
19789
|
_proto2.getFields = function getFields() {
|
|
@@ -19826,22 +19826,22 @@ var require_definition3 = __commonJS({
|
|
|
19826
19826
|
}();
|
|
19827
19827
|
exports.GraphQLObjectType = GraphQLObjectType;
|
|
19828
19828
|
(0, _defineInspect.default)(GraphQLObjectType);
|
|
19829
|
-
function defineInterfaces(
|
|
19829
|
+
function defineInterfaces(config3) {
|
|
19830
19830
|
var _resolveThunk;
|
|
19831
|
-
var interfaces = (_resolveThunk = resolveThunk(
|
|
19832
|
-
Array.isArray(interfaces) || (0, _devAssert.default)(0, "".concat(
|
|
19831
|
+
var interfaces = (_resolveThunk = resolveThunk(config3.interfaces)) !== null && _resolveThunk !== void 0 ? _resolveThunk : [];
|
|
19832
|
+
Array.isArray(interfaces) || (0, _devAssert.default)(0, "".concat(config3.name, " interfaces must be an Array or a function which returns an Array."));
|
|
19833
19833
|
return interfaces;
|
|
19834
19834
|
}
|
|
19835
|
-
function defineFieldMap(
|
|
19836
|
-
var fieldMap = resolveThunk(
|
|
19837
|
-
isPlainObj(fieldMap) || (0, _devAssert.default)(0, "".concat(
|
|
19835
|
+
function defineFieldMap(config3) {
|
|
19836
|
+
var fieldMap = resolveThunk(config3.fields);
|
|
19837
|
+
isPlainObj(fieldMap) || (0, _devAssert.default)(0, "".concat(config3.name, " fields must be an object with field names as keys or a function which returns such an object."));
|
|
19838
19838
|
return (0, _mapValue.default)(fieldMap, function(fieldConfig, fieldName) {
|
|
19839
19839
|
var _fieldConfig$args;
|
|
19840
|
-
isPlainObj(fieldConfig) || (0, _devAssert.default)(0, "".concat(
|
|
19841
|
-
!("isDeprecated" in fieldConfig) || (0, _devAssert.default)(0, "".concat(
|
|
19842
|
-
fieldConfig.resolve == null || typeof fieldConfig.resolve === "function" || (0, _devAssert.default)(0, "".concat(
|
|
19840
|
+
isPlainObj(fieldConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, " field config must be an object."));
|
|
19841
|
+
!("isDeprecated" in fieldConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, ' should provide "deprecationReason" instead of "isDeprecated".'));
|
|
19842
|
+
fieldConfig.resolve == null || typeof fieldConfig.resolve === "function" || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, " field resolver must be a function if ") + "provided, but got: ".concat((0, _inspect.default)(fieldConfig.resolve), "."));
|
|
19843
19843
|
var argsConfig = (_fieldConfig$args = fieldConfig.args) !== null && _fieldConfig$args !== void 0 ? _fieldConfig$args : {};
|
|
19844
|
-
isPlainObj(argsConfig) || (0, _devAssert.default)(0, "".concat(
|
|
19844
|
+
isPlainObj(argsConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, " args must be an object with argument names as keys."));
|
|
19845
19845
|
var args = (0, _objectEntries.default)(argsConfig).map(function(_ref) {
|
|
19846
19846
|
var argName = _ref[0], argConfig = _ref[1];
|
|
19847
19847
|
return {
|
|
@@ -19903,17 +19903,17 @@ var require_definition3 = __commonJS({
|
|
|
19903
19903
|
return isNonNullType(arg.type) && arg.defaultValue === void 0;
|
|
19904
19904
|
}
|
|
19905
19905
|
var GraphQLInterfaceType = /* @__PURE__ */ function() {
|
|
19906
|
-
function GraphQLInterfaceType2(
|
|
19907
|
-
this.name =
|
|
19908
|
-
this.description =
|
|
19909
|
-
this.resolveType =
|
|
19910
|
-
this.extensions =
|
|
19911
|
-
this.astNode =
|
|
19912
|
-
this.extensionASTNodes = undefineIfEmpty(
|
|
19913
|
-
this._fields = defineFieldMap.bind(void 0,
|
|
19914
|
-
this._interfaces = defineInterfaces.bind(void 0,
|
|
19915
|
-
typeof
|
|
19916
|
-
|
|
19906
|
+
function GraphQLInterfaceType2(config3) {
|
|
19907
|
+
this.name = config3.name;
|
|
19908
|
+
this.description = config3.description;
|
|
19909
|
+
this.resolveType = config3.resolveType;
|
|
19910
|
+
this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
|
|
19911
|
+
this.astNode = config3.astNode;
|
|
19912
|
+
this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
|
|
19913
|
+
this._fields = defineFieldMap.bind(void 0, config3);
|
|
19914
|
+
this._interfaces = defineInterfaces.bind(void 0, config3);
|
|
19915
|
+
typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
|
|
19916
|
+
config3.resolveType == null || typeof config3.resolveType === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide "resolveType" as a function, ') + "but got: ".concat((0, _inspect.default)(config3.resolveType), "."));
|
|
19917
19917
|
}
|
|
19918
19918
|
var _proto3 = GraphQLInterfaceType2.prototype;
|
|
19919
19919
|
_proto3.getFields = function getFields() {
|
|
@@ -19958,16 +19958,16 @@ var require_definition3 = __commonJS({
|
|
|
19958
19958
|
exports.GraphQLInterfaceType = GraphQLInterfaceType;
|
|
19959
19959
|
(0, _defineInspect.default)(GraphQLInterfaceType);
|
|
19960
19960
|
var GraphQLUnionType = /* @__PURE__ */ function() {
|
|
19961
|
-
function GraphQLUnionType2(
|
|
19962
|
-
this.name =
|
|
19963
|
-
this.description =
|
|
19964
|
-
this.resolveType =
|
|
19965
|
-
this.extensions =
|
|
19966
|
-
this.astNode =
|
|
19967
|
-
this.extensionASTNodes = undefineIfEmpty(
|
|
19968
|
-
this._types = defineTypes.bind(void 0,
|
|
19969
|
-
typeof
|
|
19970
|
-
|
|
19961
|
+
function GraphQLUnionType2(config3) {
|
|
19962
|
+
this.name = config3.name;
|
|
19963
|
+
this.description = config3.description;
|
|
19964
|
+
this.resolveType = config3.resolveType;
|
|
19965
|
+
this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
|
|
19966
|
+
this.astNode = config3.astNode;
|
|
19967
|
+
this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
|
|
19968
|
+
this._types = defineTypes.bind(void 0, config3);
|
|
19969
|
+
typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
|
|
19970
|
+
config3.resolveType == null || typeof config3.resolveType === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide "resolveType" as a function, ') + "but got: ".concat((0, _inspect.default)(config3.resolveType), "."));
|
|
19971
19971
|
}
|
|
19972
19972
|
var _proto4 = GraphQLUnionType2.prototype;
|
|
19973
19973
|
_proto4.getTypes = function getTypes() {
|
|
@@ -20004,26 +20004,26 @@ var require_definition3 = __commonJS({
|
|
|
20004
20004
|
}();
|
|
20005
20005
|
exports.GraphQLUnionType = GraphQLUnionType;
|
|
20006
20006
|
(0, _defineInspect.default)(GraphQLUnionType);
|
|
20007
|
-
function defineTypes(
|
|
20008
|
-
var types11 = resolveThunk(
|
|
20009
|
-
Array.isArray(types11) || (0, _devAssert.default)(0, "Must provide Array of types or a function which returns such an array for Union ".concat(
|
|
20007
|
+
function defineTypes(config3) {
|
|
20008
|
+
var types11 = resolveThunk(config3.types);
|
|
20009
|
+
Array.isArray(types11) || (0, _devAssert.default)(0, "Must provide Array of types or a function which returns such an array for Union ".concat(config3.name, "."));
|
|
20010
20010
|
return types11;
|
|
20011
20011
|
}
|
|
20012
20012
|
var GraphQLEnumType = /* @__PURE__ */ function() {
|
|
20013
|
-
function GraphQLEnumType2(
|
|
20014
|
-
this.name =
|
|
20015
|
-
this.description =
|
|
20016
|
-
this.extensions =
|
|
20017
|
-
this.astNode =
|
|
20018
|
-
this.extensionASTNodes = undefineIfEmpty(
|
|
20019
|
-
this._values = defineEnumValues(this.name,
|
|
20013
|
+
function GraphQLEnumType2(config3) {
|
|
20014
|
+
this.name = config3.name;
|
|
20015
|
+
this.description = config3.description;
|
|
20016
|
+
this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
|
|
20017
|
+
this.astNode = config3.astNode;
|
|
20018
|
+
this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
|
|
20019
|
+
this._values = defineEnumValues(this.name, config3.values);
|
|
20020
20020
|
this._valueLookup = new Map(this._values.map(function(enumValue) {
|
|
20021
20021
|
return [enumValue.value, enumValue];
|
|
20022
20022
|
}));
|
|
20023
20023
|
this._nameLookup = (0, _keyMap.default)(this._values, function(value2) {
|
|
20024
20024
|
return value2.name;
|
|
20025
20025
|
});
|
|
20026
|
-
typeof
|
|
20026
|
+
typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
|
|
20027
20027
|
}
|
|
20028
20028
|
var _proto5 = GraphQLEnumType2.prototype;
|
|
20029
20029
|
_proto5.getValues = function getValues() {
|
|
@@ -20125,14 +20125,14 @@ var require_definition3 = __commonJS({
|
|
|
20125
20125
|
});
|
|
20126
20126
|
}
|
|
20127
20127
|
var GraphQLInputObjectType = /* @__PURE__ */ function() {
|
|
20128
|
-
function GraphQLInputObjectType2(
|
|
20129
|
-
this.name =
|
|
20130
|
-
this.description =
|
|
20131
|
-
this.extensions =
|
|
20132
|
-
this.astNode =
|
|
20133
|
-
this.extensionASTNodes = undefineIfEmpty(
|
|
20134
|
-
this._fields = defineInputFieldMap.bind(void 0,
|
|
20135
|
-
typeof
|
|
20128
|
+
function GraphQLInputObjectType2(config3) {
|
|
20129
|
+
this.name = config3.name;
|
|
20130
|
+
this.description = config3.description;
|
|
20131
|
+
this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
|
|
20132
|
+
this.astNode = config3.astNode;
|
|
20133
|
+
this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
|
|
20134
|
+
this._fields = defineInputFieldMap.bind(void 0, config3);
|
|
20135
|
+
typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
|
|
20136
20136
|
}
|
|
20137
20137
|
var _proto6 = GraphQLInputObjectType2.prototype;
|
|
20138
20138
|
_proto6.getFields = function getFields() {
|
|
@@ -20178,11 +20178,11 @@ var require_definition3 = __commonJS({
|
|
|
20178
20178
|
}();
|
|
20179
20179
|
exports.GraphQLInputObjectType = GraphQLInputObjectType;
|
|
20180
20180
|
(0, _defineInspect.default)(GraphQLInputObjectType);
|
|
20181
|
-
function defineInputFieldMap(
|
|
20182
|
-
var fieldMap = resolveThunk(
|
|
20183
|
-
isPlainObj(fieldMap) || (0, _devAssert.default)(0, "".concat(
|
|
20181
|
+
function defineInputFieldMap(config3) {
|
|
20182
|
+
var fieldMap = resolveThunk(config3.fields);
|
|
20183
|
+
isPlainObj(fieldMap) || (0, _devAssert.default)(0, "".concat(config3.name, " fields must be an object with field names as keys or a function which returns such an object."));
|
|
20184
20184
|
return (0, _mapValue.default)(fieldMap, function(fieldConfig, fieldName) {
|
|
20185
|
-
!("resolve" in fieldConfig) || (0, _devAssert.default)(0, "".concat(
|
|
20185
|
+
!("resolve" in fieldConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, " field has a resolve property, but Input Types cannot define resolvers."));
|
|
20186
20186
|
return {
|
|
20187
20187
|
name: fieldName,
|
|
20188
20188
|
description: fieldConfig.description,
|
|
@@ -21379,18 +21379,18 @@ var require_directives3 = __commonJS({
|
|
|
21379
21379
|
return directive;
|
|
21380
21380
|
}
|
|
21381
21381
|
var GraphQLDirective = /* @__PURE__ */ function() {
|
|
21382
|
-
function GraphQLDirective2(
|
|
21382
|
+
function GraphQLDirective2(config3) {
|
|
21383
21383
|
var _config$isRepeatable, _config$args;
|
|
21384
|
-
this.name =
|
|
21385
|
-
this.description =
|
|
21386
|
-
this.locations =
|
|
21387
|
-
this.isRepeatable = (_config$isRepeatable =
|
|
21388
|
-
this.extensions =
|
|
21389
|
-
this.astNode =
|
|
21390
|
-
|
|
21391
|
-
Array.isArray(
|
|
21392
|
-
var args = (_config$args =
|
|
21393
|
-
(0, _isObjectLike.default)(args) && !Array.isArray(args) || (0, _devAssert.default)(0, "@".concat(
|
|
21384
|
+
this.name = config3.name;
|
|
21385
|
+
this.description = config3.description;
|
|
21386
|
+
this.locations = config3.locations;
|
|
21387
|
+
this.isRepeatable = (_config$isRepeatable = config3.isRepeatable) !== null && _config$isRepeatable !== void 0 ? _config$isRepeatable : false;
|
|
21388
|
+
this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
|
|
21389
|
+
this.astNode = config3.astNode;
|
|
21390
|
+
config3.name || (0, _devAssert.default)(0, "Directive must be named.");
|
|
21391
|
+
Array.isArray(config3.locations) || (0, _devAssert.default)(0, "@".concat(config3.name, " locations must be an Array."));
|
|
21392
|
+
var args = (_config$args = config3.args) !== null && _config$args !== void 0 ? _config$args : {};
|
|
21393
|
+
(0, _isObjectLike.default)(args) && !Array.isArray(args) || (0, _devAssert.default)(0, "@".concat(config3.name, " args must be an object with argument names as keys."));
|
|
21394
21394
|
this.args = (0, _objectEntries.default)(args).map(function(_ref) {
|
|
21395
21395
|
var argName = _ref[0], argConfig = _ref[1];
|
|
21396
21396
|
return {
|
|
@@ -21546,23 +21546,23 @@ var require_schema3 = __commonJS({
|
|
|
21546
21546
|
return schema;
|
|
21547
21547
|
}
|
|
21548
21548
|
var GraphQLSchema = /* @__PURE__ */ function() {
|
|
21549
|
-
function GraphQLSchema2(
|
|
21549
|
+
function GraphQLSchema2(config3) {
|
|
21550
21550
|
var _config$directives;
|
|
21551
|
-
this.__validationErrors =
|
|
21552
|
-
(0, _isObjectLike.default)(
|
|
21553
|
-
!
|
|
21554
|
-
!
|
|
21555
|
-
this.description =
|
|
21556
|
-
this.extensions =
|
|
21557
|
-
this.astNode =
|
|
21558
|
-
this.extensionASTNodes =
|
|
21559
|
-
this._queryType =
|
|
21560
|
-
this._mutationType =
|
|
21561
|
-
this._subscriptionType =
|
|
21562
|
-
this._directives = (_config$directives =
|
|
21563
|
-
var allReferencedTypes = new Set(
|
|
21564
|
-
if (
|
|
21565
|
-
for (var _i2 = 0, _config$types2 =
|
|
21551
|
+
this.__validationErrors = config3.assumeValid === true ? [] : void 0;
|
|
21552
|
+
(0, _isObjectLike.default)(config3) || (0, _devAssert.default)(0, "Must provide configuration object.");
|
|
21553
|
+
!config3.types || Array.isArray(config3.types) || (0, _devAssert.default)(0, '"types" must be Array if provided but got: '.concat((0, _inspect.default)(config3.types), "."));
|
|
21554
|
+
!config3.directives || Array.isArray(config3.directives) || (0, _devAssert.default)(0, '"directives" must be Array if provided but got: ' + "".concat((0, _inspect.default)(config3.directives), "."));
|
|
21555
|
+
this.description = config3.description;
|
|
21556
|
+
this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
|
|
21557
|
+
this.astNode = config3.astNode;
|
|
21558
|
+
this.extensionASTNodes = config3.extensionASTNodes;
|
|
21559
|
+
this._queryType = config3.query;
|
|
21560
|
+
this._mutationType = config3.mutation;
|
|
21561
|
+
this._subscriptionType = config3.subscription;
|
|
21562
|
+
this._directives = (_config$directives = config3.directives) !== null && _config$directives !== void 0 ? _config$directives : _directives.specifiedDirectives;
|
|
21563
|
+
var allReferencedTypes = new Set(config3.types);
|
|
21564
|
+
if (config3.types != null) {
|
|
21565
|
+
for (var _i2 = 0, _config$types2 = config3.types; _i2 < _config$types2.length; _i2++) {
|
|
21566
21566
|
var type = _config$types2[_i2];
|
|
21567
21567
|
allReferencedTypes.delete(type);
|
|
21568
21568
|
collectReferencedTypes(type, allReferencedTypes);
|
|
@@ -27888,9 +27888,9 @@ var require_extendSchema3 = __commonJS({
|
|
|
27888
27888
|
return typeMap[type.name];
|
|
27889
27889
|
}
|
|
27890
27890
|
function replaceDirective(directive) {
|
|
27891
|
-
var
|
|
27892
|
-
return new _directives.GraphQLDirective(_objectSpread(_objectSpread({},
|
|
27893
|
-
args: (0, _mapValue.default)(
|
|
27891
|
+
var config3 = directive.toConfig();
|
|
27892
|
+
return new _directives.GraphQLDirective(_objectSpread(_objectSpread({}, config3), {}, {
|
|
27893
|
+
args: (0, _mapValue.default)(config3.args, extendArg)
|
|
27894
27894
|
}));
|
|
27895
27895
|
}
|
|
27896
27896
|
function extendNamedType(type) {
|
|
@@ -27919,80 +27919,80 @@ var require_extendSchema3 = __commonJS({
|
|
|
27919
27919
|
}
|
|
27920
27920
|
function extendInputObjectType(type) {
|
|
27921
27921
|
var _typeExtensionsMap$co;
|
|
27922
|
-
var
|
|
27923
|
-
var extensions = (_typeExtensionsMap$co = typeExtensionsMap[
|
|
27924
|
-
return new _definition.GraphQLInputObjectType(_objectSpread(_objectSpread({},
|
|
27922
|
+
var config3 = type.toConfig();
|
|
27923
|
+
var extensions = (_typeExtensionsMap$co = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co !== void 0 ? _typeExtensionsMap$co : [];
|
|
27924
|
+
return new _definition.GraphQLInputObjectType(_objectSpread(_objectSpread({}, config3), {}, {
|
|
27925
27925
|
fields: function fields() {
|
|
27926
|
-
return _objectSpread(_objectSpread({}, (0, _mapValue.default)(
|
|
27926
|
+
return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config3.fields, function(field) {
|
|
27927
27927
|
return _objectSpread(_objectSpread({}, field), {}, {
|
|
27928
27928
|
type: replaceType(field.type)
|
|
27929
27929
|
});
|
|
27930
27930
|
})), buildInputFieldMap(extensions));
|
|
27931
27931
|
},
|
|
27932
|
-
extensionASTNodes:
|
|
27932
|
+
extensionASTNodes: config3.extensionASTNodes.concat(extensions)
|
|
27933
27933
|
}));
|
|
27934
27934
|
}
|
|
27935
27935
|
function extendEnumType(type) {
|
|
27936
27936
|
var _typeExtensionsMap$ty;
|
|
27937
|
-
var
|
|
27937
|
+
var config3 = type.toConfig();
|
|
27938
27938
|
var extensions = (_typeExtensionsMap$ty = typeExtensionsMap[type.name]) !== null && _typeExtensionsMap$ty !== void 0 ? _typeExtensionsMap$ty : [];
|
|
27939
|
-
return new _definition.GraphQLEnumType(_objectSpread(_objectSpread({},
|
|
27940
|
-
values: _objectSpread(_objectSpread({},
|
|
27941
|
-
extensionASTNodes:
|
|
27939
|
+
return new _definition.GraphQLEnumType(_objectSpread(_objectSpread({}, config3), {}, {
|
|
27940
|
+
values: _objectSpread(_objectSpread({}, config3.values), buildEnumValueMap(extensions)),
|
|
27941
|
+
extensionASTNodes: config3.extensionASTNodes.concat(extensions)
|
|
27942
27942
|
}));
|
|
27943
27943
|
}
|
|
27944
27944
|
function extendScalarType(type) {
|
|
27945
27945
|
var _typeExtensionsMap$co2;
|
|
27946
|
-
var
|
|
27947
|
-
var extensions = (_typeExtensionsMap$co2 = typeExtensionsMap[
|
|
27948
|
-
var specifiedByUrl =
|
|
27946
|
+
var config3 = type.toConfig();
|
|
27947
|
+
var extensions = (_typeExtensionsMap$co2 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co2 !== void 0 ? _typeExtensionsMap$co2 : [];
|
|
27948
|
+
var specifiedByUrl = config3.specifiedByUrl;
|
|
27949
27949
|
for (var _i8 = 0; _i8 < extensions.length; _i8++) {
|
|
27950
27950
|
var _getSpecifiedByUrl;
|
|
27951
27951
|
var extensionNode = extensions[_i8];
|
|
27952
27952
|
specifiedByUrl = (_getSpecifiedByUrl = getSpecifiedByUrl(extensionNode)) !== null && _getSpecifiedByUrl !== void 0 ? _getSpecifiedByUrl : specifiedByUrl;
|
|
27953
27953
|
}
|
|
27954
|
-
return new _definition.GraphQLScalarType(_objectSpread(_objectSpread({},
|
|
27954
|
+
return new _definition.GraphQLScalarType(_objectSpread(_objectSpread({}, config3), {}, {
|
|
27955
27955
|
specifiedByUrl,
|
|
27956
|
-
extensionASTNodes:
|
|
27956
|
+
extensionASTNodes: config3.extensionASTNodes.concat(extensions)
|
|
27957
27957
|
}));
|
|
27958
27958
|
}
|
|
27959
27959
|
function extendObjectType(type) {
|
|
27960
27960
|
var _typeExtensionsMap$co3;
|
|
27961
|
-
var
|
|
27962
|
-
var extensions = (_typeExtensionsMap$co3 = typeExtensionsMap[
|
|
27963
|
-
return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({},
|
|
27961
|
+
var config3 = type.toConfig();
|
|
27962
|
+
var extensions = (_typeExtensionsMap$co3 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co3 !== void 0 ? _typeExtensionsMap$co3 : [];
|
|
27963
|
+
return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config3), {}, {
|
|
27964
27964
|
interfaces: function interfaces() {
|
|
27965
27965
|
return [].concat(type.getInterfaces().map(replaceNamedType), buildInterfaces(extensions));
|
|
27966
27966
|
},
|
|
27967
27967
|
fields: function fields() {
|
|
27968
|
-
return _objectSpread(_objectSpread({}, (0, _mapValue.default)(
|
|
27968
|
+
return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config3.fields, extendField)), buildFieldMap(extensions));
|
|
27969
27969
|
},
|
|
27970
|
-
extensionASTNodes:
|
|
27970
|
+
extensionASTNodes: config3.extensionASTNodes.concat(extensions)
|
|
27971
27971
|
}));
|
|
27972
27972
|
}
|
|
27973
27973
|
function extendInterfaceType(type) {
|
|
27974
27974
|
var _typeExtensionsMap$co4;
|
|
27975
|
-
var
|
|
27976
|
-
var extensions = (_typeExtensionsMap$co4 = typeExtensionsMap[
|
|
27977
|
-
return new _definition.GraphQLInterfaceType(_objectSpread(_objectSpread({},
|
|
27975
|
+
var config3 = type.toConfig();
|
|
27976
|
+
var extensions = (_typeExtensionsMap$co4 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co4 !== void 0 ? _typeExtensionsMap$co4 : [];
|
|
27977
|
+
return new _definition.GraphQLInterfaceType(_objectSpread(_objectSpread({}, config3), {}, {
|
|
27978
27978
|
interfaces: function interfaces() {
|
|
27979
27979
|
return [].concat(type.getInterfaces().map(replaceNamedType), buildInterfaces(extensions));
|
|
27980
27980
|
},
|
|
27981
27981
|
fields: function fields() {
|
|
27982
|
-
return _objectSpread(_objectSpread({}, (0, _mapValue.default)(
|
|
27982
|
+
return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config3.fields, extendField)), buildFieldMap(extensions));
|
|
27983
27983
|
},
|
|
27984
|
-
extensionASTNodes:
|
|
27984
|
+
extensionASTNodes: config3.extensionASTNodes.concat(extensions)
|
|
27985
27985
|
}));
|
|
27986
27986
|
}
|
|
27987
27987
|
function extendUnionType(type) {
|
|
27988
27988
|
var _typeExtensionsMap$co5;
|
|
27989
|
-
var
|
|
27990
|
-
var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[
|
|
27991
|
-
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({},
|
|
27989
|
+
var config3 = type.toConfig();
|
|
27990
|
+
var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
|
|
27991
|
+
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config3), {}, {
|
|
27992
27992
|
types: function types11() {
|
|
27993
27993
|
return [].concat(type.getTypes().map(replaceNamedType), buildUnionTypes(extensions));
|
|
27994
27994
|
},
|
|
27995
|
-
extensionASTNodes:
|
|
27995
|
+
extensionASTNodes: config3.extensionASTNodes.concat(extensions)
|
|
27996
27996
|
}));
|
|
27997
27997
|
}
|
|
27998
27998
|
function extendField(field) {
|
|
@@ -28309,24 +28309,24 @@ var require_buildASTSchema3 = __commonJS({
|
|
|
28309
28309
|
extensionASTNodes: [],
|
|
28310
28310
|
assumeValid: false
|
|
28311
28311
|
};
|
|
28312
|
-
var
|
|
28313
|
-
if (
|
|
28314
|
-
for (var _i2 = 0, _config$types2 =
|
|
28312
|
+
var config3 = (0, _extendSchema.extendSchemaImpl)(emptySchemaConfig, documentAST, options);
|
|
28313
|
+
if (config3.astNode == null) {
|
|
28314
|
+
for (var _i2 = 0, _config$types2 = config3.types; _i2 < _config$types2.length; _i2++) {
|
|
28315
28315
|
var type = _config$types2[_i2];
|
|
28316
28316
|
switch (type.name) {
|
|
28317
28317
|
case "Query":
|
|
28318
|
-
|
|
28318
|
+
config3.query = type;
|
|
28319
28319
|
break;
|
|
28320
28320
|
case "Mutation":
|
|
28321
|
-
|
|
28321
|
+
config3.mutation = type;
|
|
28322
28322
|
break;
|
|
28323
28323
|
case "Subscription":
|
|
28324
|
-
|
|
28324
|
+
config3.subscription = type;
|
|
28325
28325
|
break;
|
|
28326
28326
|
}
|
|
28327
28327
|
}
|
|
28328
28328
|
}
|
|
28329
|
-
var directives =
|
|
28329
|
+
var directives = config3.directives;
|
|
28330
28330
|
var _loop = function _loop2(_i42) {
|
|
28331
28331
|
var stdDirective = _directives.specifiedDirectives[_i42];
|
|
28332
28332
|
if (directives.every(function(directive) {
|
|
@@ -28338,7 +28338,7 @@ var require_buildASTSchema3 = __commonJS({
|
|
|
28338
28338
|
for (var _i4 = 0; _i4 < _directives.specifiedDirectives.length; _i4++) {
|
|
28339
28339
|
_loop(_i4);
|
|
28340
28340
|
}
|
|
28341
|
-
return new _schema.GraphQLSchema(
|
|
28341
|
+
return new _schema.GraphQLSchema(config3);
|
|
28342
28342
|
}
|
|
28343
28343
|
function buildSchema(source, options) {
|
|
28344
28344
|
var document = (0, _parser.parse)(source, {
|
|
@@ -28440,12 +28440,12 @@ var require_lexicographicSortSchema3 = __commonJS({
|
|
|
28440
28440
|
return maybeType && replaceNamedType(maybeType);
|
|
28441
28441
|
}
|
|
28442
28442
|
function sortDirective(directive) {
|
|
28443
|
-
var
|
|
28444
|
-
return new _directives.GraphQLDirective(_objectSpread(_objectSpread({},
|
|
28445
|
-
locations: sortBy(
|
|
28443
|
+
var config3 = directive.toConfig();
|
|
28444
|
+
return new _directives.GraphQLDirective(_objectSpread(_objectSpread({}, config3), {}, {
|
|
28445
|
+
locations: sortBy(config3.locations, function(x4) {
|
|
28446
28446
|
return x4;
|
|
28447
28447
|
}),
|
|
28448
|
-
args: sortArgs(
|
|
28448
|
+
args: sortArgs(config3.args)
|
|
28449
28449
|
}));
|
|
28450
28450
|
}
|
|
28451
28451
|
function sortArgs(args) {
|
|
@@ -28478,13 +28478,13 @@ var require_lexicographicSortSchema3 = __commonJS({
|
|
|
28478
28478
|
return type;
|
|
28479
28479
|
}
|
|
28480
28480
|
if ((0, _definition.isObjectType)(type)) {
|
|
28481
|
-
var
|
|
28482
|
-
return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({},
|
|
28481
|
+
var config3 = type.toConfig();
|
|
28482
|
+
return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config3), {}, {
|
|
28483
28483
|
interfaces: function interfaces() {
|
|
28484
|
-
return sortTypes(
|
|
28484
|
+
return sortTypes(config3.interfaces);
|
|
28485
28485
|
},
|
|
28486
28486
|
fields: function fields() {
|
|
28487
|
-
return sortFields(
|
|
28487
|
+
return sortFields(config3.fields);
|
|
28488
28488
|
}
|
|
28489
28489
|
}));
|
|
28490
28490
|
}
|
|
@@ -34390,25 +34390,25 @@ var require_definition = __commonJS2({
|
|
|
34390
34390
|
return arr && arr.length > 0 ? arr : void 0;
|
|
34391
34391
|
}
|
|
34392
34392
|
var GraphQLScalarType4 = /* @__PURE__ */ function() {
|
|
34393
|
-
function GraphQLScalarType5(
|
|
34393
|
+
function GraphQLScalarType5(config3) {
|
|
34394
34394
|
var _config$parseValue, _config$serialize, _config$parseLiteral;
|
|
34395
|
-
var parseValue = (_config$parseValue =
|
|
34396
|
-
this.name =
|
|
34397
|
-
this.description =
|
|
34398
|
-
this.specifiedByUrl =
|
|
34399
|
-
this.serialize = (_config$serialize =
|
|
34395
|
+
var parseValue = (_config$parseValue = config3.parseValue) !== null && _config$parseValue !== void 0 ? _config$parseValue : _identityFunc.default;
|
|
34396
|
+
this.name = config3.name;
|
|
34397
|
+
this.description = config3.description;
|
|
34398
|
+
this.specifiedByUrl = config3.specifiedByUrl;
|
|
34399
|
+
this.serialize = (_config$serialize = config3.serialize) !== null && _config$serialize !== void 0 ? _config$serialize : _identityFunc.default;
|
|
34400
34400
|
this.parseValue = parseValue;
|
|
34401
|
-
this.parseLiteral = (_config$parseLiteral =
|
|
34401
|
+
this.parseLiteral = (_config$parseLiteral = config3.parseLiteral) !== null && _config$parseLiteral !== void 0 ? _config$parseLiteral : function(node2, variables) {
|
|
34402
34402
|
return parseValue((0, _valueFromASTUntyped.valueFromASTUntyped)(node2, variables));
|
|
34403
34403
|
};
|
|
34404
|
-
this.extensions =
|
|
34405
|
-
this.astNode =
|
|
34406
|
-
this.extensionASTNodes = undefineIfEmpty(
|
|
34407
|
-
typeof
|
|
34408
|
-
|
|
34409
|
-
|
|
34410
|
-
if (
|
|
34411
|
-
typeof
|
|
34404
|
+
this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
|
|
34405
|
+
this.astNode = config3.astNode;
|
|
34406
|
+
this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
|
|
34407
|
+
typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
|
|
34408
|
+
config3.specifiedByUrl == null || typeof config3.specifiedByUrl === "string" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide "specifiedByUrl" as a string, ') + "but got: ".concat((0, _inspect.default)(config3.specifiedByUrl), "."));
|
|
34409
|
+
config3.serialize == null || typeof config3.serialize === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.'));
|
|
34410
|
+
if (config3.parseLiteral) {
|
|
34411
|
+
typeof config3.parseValue === "function" && typeof config3.parseLiteral === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide both "parseValue" and "parseLiteral" functions.'));
|
|
34412
34412
|
}
|
|
34413
34413
|
}
|
|
34414
34414
|
var _proto = GraphQLScalarType5.prototype;
|
|
@@ -34443,17 +34443,17 @@ var require_definition = __commonJS2({
|
|
|
34443
34443
|
exports.GraphQLScalarType = GraphQLScalarType4;
|
|
34444
34444
|
(0, _defineInspect.default)(GraphQLScalarType4);
|
|
34445
34445
|
var GraphQLObjectType5 = /* @__PURE__ */ function() {
|
|
34446
|
-
function GraphQLObjectType6(
|
|
34447
|
-
this.name =
|
|
34448
|
-
this.description =
|
|
34449
|
-
this.isTypeOf =
|
|
34450
|
-
this.extensions =
|
|
34451
|
-
this.astNode =
|
|
34452
|
-
this.extensionASTNodes = undefineIfEmpty(
|
|
34453
|
-
this._fields = defineFieldMap.bind(void 0,
|
|
34454
|
-
this._interfaces = defineInterfaces.bind(void 0,
|
|
34455
|
-
typeof
|
|
34456
|
-
|
|
34446
|
+
function GraphQLObjectType6(config3) {
|
|
34447
|
+
this.name = config3.name;
|
|
34448
|
+
this.description = config3.description;
|
|
34449
|
+
this.isTypeOf = config3.isTypeOf;
|
|
34450
|
+
this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
|
|
34451
|
+
this.astNode = config3.astNode;
|
|
34452
|
+
this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
|
|
34453
|
+
this._fields = defineFieldMap.bind(void 0, config3);
|
|
34454
|
+
this._interfaces = defineInterfaces.bind(void 0, config3);
|
|
34455
|
+
typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
|
|
34456
|
+
config3.isTypeOf == null || typeof config3.isTypeOf === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide "isTypeOf" as a function, ') + "but got: ".concat((0, _inspect.default)(config3.isTypeOf), "."));
|
|
34457
34457
|
}
|
|
34458
34458
|
var _proto2 = GraphQLObjectType6.prototype;
|
|
34459
34459
|
_proto2.getFields = function getFields() {
|
|
@@ -34496,22 +34496,22 @@ var require_definition = __commonJS2({
|
|
|
34496
34496
|
}();
|
|
34497
34497
|
exports.GraphQLObjectType = GraphQLObjectType5;
|
|
34498
34498
|
(0, _defineInspect.default)(GraphQLObjectType5);
|
|
34499
|
-
function defineInterfaces(
|
|
34499
|
+
function defineInterfaces(config3) {
|
|
34500
34500
|
var _resolveThunk;
|
|
34501
|
-
var interfaces = (_resolveThunk = resolveThunk(
|
|
34502
|
-
Array.isArray(interfaces) || (0, _devAssert.default)(0, "".concat(
|
|
34501
|
+
var interfaces = (_resolveThunk = resolveThunk(config3.interfaces)) !== null && _resolveThunk !== void 0 ? _resolveThunk : [];
|
|
34502
|
+
Array.isArray(interfaces) || (0, _devAssert.default)(0, "".concat(config3.name, " interfaces must be an Array or a function which returns an Array."));
|
|
34503
34503
|
return interfaces;
|
|
34504
34504
|
}
|
|
34505
|
-
function defineFieldMap(
|
|
34506
|
-
var fieldMap = resolveThunk(
|
|
34507
|
-
isPlainObj(fieldMap) || (0, _devAssert.default)(0, "".concat(
|
|
34505
|
+
function defineFieldMap(config3) {
|
|
34506
|
+
var fieldMap = resolveThunk(config3.fields);
|
|
34507
|
+
isPlainObj(fieldMap) || (0, _devAssert.default)(0, "".concat(config3.name, " fields must be an object with field names as keys or a function which returns such an object."));
|
|
34508
34508
|
return (0, _mapValue.default)(fieldMap, function(fieldConfig, fieldName) {
|
|
34509
34509
|
var _fieldConfig$args;
|
|
34510
|
-
isPlainObj(fieldConfig) || (0, _devAssert.default)(0, "".concat(
|
|
34511
|
-
!("isDeprecated" in fieldConfig) || (0, _devAssert.default)(0, "".concat(
|
|
34512
|
-
fieldConfig.resolve == null || typeof fieldConfig.resolve === "function" || (0, _devAssert.default)(0, "".concat(
|
|
34510
|
+
isPlainObj(fieldConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, " field config must be an object."));
|
|
34511
|
+
!("isDeprecated" in fieldConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, ' should provide "deprecationReason" instead of "isDeprecated".'));
|
|
34512
|
+
fieldConfig.resolve == null || typeof fieldConfig.resolve === "function" || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, " field resolver must be a function if ") + "provided, but got: ".concat((0, _inspect.default)(fieldConfig.resolve), "."));
|
|
34513
34513
|
var argsConfig = (_fieldConfig$args = fieldConfig.args) !== null && _fieldConfig$args !== void 0 ? _fieldConfig$args : {};
|
|
34514
|
-
isPlainObj(argsConfig) || (0, _devAssert.default)(0, "".concat(
|
|
34514
|
+
isPlainObj(argsConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, " args must be an object with argument names as keys."));
|
|
34515
34515
|
var args = (0, _objectEntries.default)(argsConfig).map(function(_ref) {
|
|
34516
34516
|
var argName = _ref[0], argConfig = _ref[1];
|
|
34517
34517
|
return {
|
|
@@ -34573,17 +34573,17 @@ var require_definition = __commonJS2({
|
|
|
34573
34573
|
return isNonNullType6(arg.type) && arg.defaultValue === void 0;
|
|
34574
34574
|
}
|
|
34575
34575
|
var GraphQLInterfaceType5 = /* @__PURE__ */ function() {
|
|
34576
|
-
function GraphQLInterfaceType6(
|
|
34577
|
-
this.name =
|
|
34578
|
-
this.description =
|
|
34579
|
-
this.resolveType =
|
|
34580
|
-
this.extensions =
|
|
34581
|
-
this.astNode =
|
|
34582
|
-
this.extensionASTNodes = undefineIfEmpty(
|
|
34583
|
-
this._fields = defineFieldMap.bind(void 0,
|
|
34584
|
-
this._interfaces = defineInterfaces.bind(void 0,
|
|
34585
|
-
typeof
|
|
34586
|
-
|
|
34576
|
+
function GraphQLInterfaceType6(config3) {
|
|
34577
|
+
this.name = config3.name;
|
|
34578
|
+
this.description = config3.description;
|
|
34579
|
+
this.resolveType = config3.resolveType;
|
|
34580
|
+
this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
|
|
34581
|
+
this.astNode = config3.astNode;
|
|
34582
|
+
this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
|
|
34583
|
+
this._fields = defineFieldMap.bind(void 0, config3);
|
|
34584
|
+
this._interfaces = defineInterfaces.bind(void 0, config3);
|
|
34585
|
+
typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
|
|
34586
|
+
config3.resolveType == null || typeof config3.resolveType === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide "resolveType" as a function, ') + "but got: ".concat((0, _inspect.default)(config3.resolveType), "."));
|
|
34587
34587
|
}
|
|
34588
34588
|
var _proto3 = GraphQLInterfaceType6.prototype;
|
|
34589
34589
|
_proto3.getFields = function getFields() {
|
|
@@ -34628,16 +34628,16 @@ var require_definition = __commonJS2({
|
|
|
34628
34628
|
exports.GraphQLInterfaceType = GraphQLInterfaceType5;
|
|
34629
34629
|
(0, _defineInspect.default)(GraphQLInterfaceType5);
|
|
34630
34630
|
var GraphQLUnionType3 = /* @__PURE__ */ function() {
|
|
34631
|
-
function GraphQLUnionType4(
|
|
34632
|
-
this.name =
|
|
34633
|
-
this.description =
|
|
34634
|
-
this.resolveType =
|
|
34635
|
-
this.extensions =
|
|
34636
|
-
this.astNode =
|
|
34637
|
-
this.extensionASTNodes = undefineIfEmpty(
|
|
34638
|
-
this._types = defineTypes.bind(void 0,
|
|
34639
|
-
typeof
|
|
34640
|
-
|
|
34631
|
+
function GraphQLUnionType4(config3) {
|
|
34632
|
+
this.name = config3.name;
|
|
34633
|
+
this.description = config3.description;
|
|
34634
|
+
this.resolveType = config3.resolveType;
|
|
34635
|
+
this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
|
|
34636
|
+
this.astNode = config3.astNode;
|
|
34637
|
+
this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
|
|
34638
|
+
this._types = defineTypes.bind(void 0, config3);
|
|
34639
|
+
typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
|
|
34640
|
+
config3.resolveType == null || typeof config3.resolveType === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide "resolveType" as a function, ') + "but got: ".concat((0, _inspect.default)(config3.resolveType), "."));
|
|
34641
34641
|
}
|
|
34642
34642
|
var _proto4 = GraphQLUnionType4.prototype;
|
|
34643
34643
|
_proto4.getTypes = function getTypes() {
|
|
@@ -34674,26 +34674,26 @@ var require_definition = __commonJS2({
|
|
|
34674
34674
|
}();
|
|
34675
34675
|
exports.GraphQLUnionType = GraphQLUnionType3;
|
|
34676
34676
|
(0, _defineInspect.default)(GraphQLUnionType3);
|
|
34677
|
-
function defineTypes(
|
|
34678
|
-
var types42 = resolveThunk(
|
|
34679
|
-
Array.isArray(types42) || (0, _devAssert.default)(0, "Must provide Array of types or a function which returns such an array for Union ".concat(
|
|
34677
|
+
function defineTypes(config3) {
|
|
34678
|
+
var types42 = resolveThunk(config3.types);
|
|
34679
|
+
Array.isArray(types42) || (0, _devAssert.default)(0, "Must provide Array of types or a function which returns such an array for Union ".concat(config3.name, "."));
|
|
34680
34680
|
return types42;
|
|
34681
34681
|
}
|
|
34682
34682
|
var GraphQLEnumType4 = /* @__PURE__ */ function() {
|
|
34683
|
-
function GraphQLEnumType5(
|
|
34684
|
-
this.name =
|
|
34685
|
-
this.description =
|
|
34686
|
-
this.extensions =
|
|
34687
|
-
this.astNode =
|
|
34688
|
-
this.extensionASTNodes = undefineIfEmpty(
|
|
34689
|
-
this._values = defineEnumValues(this.name,
|
|
34683
|
+
function GraphQLEnumType5(config3) {
|
|
34684
|
+
this.name = config3.name;
|
|
34685
|
+
this.description = config3.description;
|
|
34686
|
+
this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
|
|
34687
|
+
this.astNode = config3.astNode;
|
|
34688
|
+
this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
|
|
34689
|
+
this._values = defineEnumValues(this.name, config3.values);
|
|
34690
34690
|
this._valueLookup = new Map(this._values.map(function(enumValue) {
|
|
34691
34691
|
return [enumValue.value, enumValue];
|
|
34692
34692
|
}));
|
|
34693
34693
|
this._nameLookup = (0, _keyMap.default)(this._values, function(value2) {
|
|
34694
34694
|
return value2.name;
|
|
34695
34695
|
});
|
|
34696
|
-
typeof
|
|
34696
|
+
typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
|
|
34697
34697
|
}
|
|
34698
34698
|
var _proto5 = GraphQLEnumType5.prototype;
|
|
34699
34699
|
_proto5.getValues = function getValues() {
|
|
@@ -34795,14 +34795,14 @@ var require_definition = __commonJS2({
|
|
|
34795
34795
|
});
|
|
34796
34796
|
}
|
|
34797
34797
|
var GraphQLInputObjectType4 = /* @__PURE__ */ function() {
|
|
34798
|
-
function GraphQLInputObjectType5(
|
|
34799
|
-
this.name =
|
|
34800
|
-
this.description =
|
|
34801
|
-
this.extensions =
|
|
34802
|
-
this.astNode =
|
|
34803
|
-
this.extensionASTNodes = undefineIfEmpty(
|
|
34804
|
-
this._fields = defineInputFieldMap.bind(void 0,
|
|
34805
|
-
typeof
|
|
34798
|
+
function GraphQLInputObjectType5(config3) {
|
|
34799
|
+
this.name = config3.name;
|
|
34800
|
+
this.description = config3.description;
|
|
34801
|
+
this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
|
|
34802
|
+
this.astNode = config3.astNode;
|
|
34803
|
+
this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
|
|
34804
|
+
this._fields = defineInputFieldMap.bind(void 0, config3);
|
|
34805
|
+
typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
|
|
34806
34806
|
}
|
|
34807
34807
|
var _proto6 = GraphQLInputObjectType5.prototype;
|
|
34808
34808
|
_proto6.getFields = function getFields() {
|
|
@@ -34848,11 +34848,11 @@ var require_definition = __commonJS2({
|
|
|
34848
34848
|
}();
|
|
34849
34849
|
exports.GraphQLInputObjectType = GraphQLInputObjectType4;
|
|
34850
34850
|
(0, _defineInspect.default)(GraphQLInputObjectType4);
|
|
34851
|
-
function defineInputFieldMap(
|
|
34852
|
-
var fieldMap = resolveThunk(
|
|
34853
|
-
isPlainObj(fieldMap) || (0, _devAssert.default)(0, "".concat(
|
|
34851
|
+
function defineInputFieldMap(config3) {
|
|
34852
|
+
var fieldMap = resolveThunk(config3.fields);
|
|
34853
|
+
isPlainObj(fieldMap) || (0, _devAssert.default)(0, "".concat(config3.name, " fields must be an object with field names as keys or a function which returns such an object."));
|
|
34854
34854
|
return (0, _mapValue.default)(fieldMap, function(fieldConfig, fieldName) {
|
|
34855
|
-
!("resolve" in fieldConfig) || (0, _devAssert.default)(0, "".concat(
|
|
34855
|
+
!("resolve" in fieldConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, " field has a resolve property, but Input Types cannot define resolvers."));
|
|
34856
34856
|
return {
|
|
34857
34857
|
name: fieldName,
|
|
34858
34858
|
description: fieldConfig.description,
|
|
@@ -36031,18 +36031,18 @@ var require_directives = __commonJS2({
|
|
|
36031
36031
|
return directive;
|
|
36032
36032
|
}
|
|
36033
36033
|
var GraphQLDirective2 = /* @__PURE__ */ function() {
|
|
36034
|
-
function GraphQLDirective3(
|
|
36034
|
+
function GraphQLDirective3(config3) {
|
|
36035
36035
|
var _config$isRepeatable, _config$args;
|
|
36036
|
-
this.name =
|
|
36037
|
-
this.description =
|
|
36038
|
-
this.locations =
|
|
36039
|
-
this.isRepeatable = (_config$isRepeatable =
|
|
36040
|
-
this.extensions =
|
|
36041
|
-
this.astNode =
|
|
36042
|
-
|
|
36043
|
-
Array.isArray(
|
|
36044
|
-
var args = (_config$args =
|
|
36045
|
-
(0, _isObjectLike.default)(args) && !Array.isArray(args) || (0, _devAssert.default)(0, "@".concat(
|
|
36036
|
+
this.name = config3.name;
|
|
36037
|
+
this.description = config3.description;
|
|
36038
|
+
this.locations = config3.locations;
|
|
36039
|
+
this.isRepeatable = (_config$isRepeatable = config3.isRepeatable) !== null && _config$isRepeatable !== void 0 ? _config$isRepeatable : false;
|
|
36040
|
+
this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
|
|
36041
|
+
this.astNode = config3.astNode;
|
|
36042
|
+
config3.name || (0, _devAssert.default)(0, "Directive must be named.");
|
|
36043
|
+
Array.isArray(config3.locations) || (0, _devAssert.default)(0, "@".concat(config3.name, " locations must be an Array."));
|
|
36044
|
+
var args = (_config$args = config3.args) !== null && _config$args !== void 0 ? _config$args : {};
|
|
36045
|
+
(0, _isObjectLike.default)(args) && !Array.isArray(args) || (0, _devAssert.default)(0, "@".concat(config3.name, " args must be an object with argument names as keys."));
|
|
36046
36046
|
this.args = (0, _objectEntries.default)(args).map(function(_ref) {
|
|
36047
36047
|
var argName = _ref[0], argConfig = _ref[1];
|
|
36048
36048
|
return {
|
|
@@ -36196,23 +36196,23 @@ var require_schema = __commonJS2({
|
|
|
36196
36196
|
return schema;
|
|
36197
36197
|
}
|
|
36198
36198
|
var GraphQLSchema2 = /* @__PURE__ */ function() {
|
|
36199
|
-
function GraphQLSchema3(
|
|
36199
|
+
function GraphQLSchema3(config3) {
|
|
36200
36200
|
var _config$directives;
|
|
36201
|
-
this.__validationErrors =
|
|
36202
|
-
(0, _isObjectLike.default)(
|
|
36203
|
-
!
|
|
36204
|
-
!
|
|
36205
|
-
this.description =
|
|
36206
|
-
this.extensions =
|
|
36207
|
-
this.astNode =
|
|
36208
|
-
this.extensionASTNodes =
|
|
36209
|
-
this._queryType =
|
|
36210
|
-
this._mutationType =
|
|
36211
|
-
this._subscriptionType =
|
|
36212
|
-
this._directives = (_config$directives =
|
|
36213
|
-
var allReferencedTypes = new Set(
|
|
36214
|
-
if (
|
|
36215
|
-
for (var _i2 = 0, _config$types2 =
|
|
36201
|
+
this.__validationErrors = config3.assumeValid === true ? [] : void 0;
|
|
36202
|
+
(0, _isObjectLike.default)(config3) || (0, _devAssert.default)(0, "Must provide configuration object.");
|
|
36203
|
+
!config3.types || Array.isArray(config3.types) || (0, _devAssert.default)(0, '"types" must be Array if provided but got: '.concat((0, _inspect.default)(config3.types), "."));
|
|
36204
|
+
!config3.directives || Array.isArray(config3.directives) || (0, _devAssert.default)(0, '"directives" must be Array if provided but got: ' + "".concat((0, _inspect.default)(config3.directives), "."));
|
|
36205
|
+
this.description = config3.description;
|
|
36206
|
+
this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
|
|
36207
|
+
this.astNode = config3.astNode;
|
|
36208
|
+
this.extensionASTNodes = config3.extensionASTNodes;
|
|
36209
|
+
this._queryType = config3.query;
|
|
36210
|
+
this._mutationType = config3.mutation;
|
|
36211
|
+
this._subscriptionType = config3.subscription;
|
|
36212
|
+
this._directives = (_config$directives = config3.directives) !== null && _config$directives !== void 0 ? _config$directives : _directives.specifiedDirectives;
|
|
36213
|
+
var allReferencedTypes = new Set(config3.types);
|
|
36214
|
+
if (config3.types != null) {
|
|
36215
|
+
for (var _i2 = 0, _config$types2 = config3.types; _i2 < _config$types2.length; _i2++) {
|
|
36216
36216
|
var type = _config$types2[_i2];
|
|
36217
36217
|
allReferencedTypes.delete(type);
|
|
36218
36218
|
collectReferencedTypes(type, allReferencedTypes);
|
|
@@ -42402,9 +42402,9 @@ var require_extendSchema = __commonJS2({
|
|
|
42402
42402
|
return typeMap[type.name];
|
|
42403
42403
|
}
|
|
42404
42404
|
function replaceDirective(directive) {
|
|
42405
|
-
var
|
|
42406
|
-
return new _directives.GraphQLDirective(_objectSpread(_objectSpread({},
|
|
42407
|
-
args: (0, _mapValue.default)(
|
|
42405
|
+
var config3 = directive.toConfig();
|
|
42406
|
+
return new _directives.GraphQLDirective(_objectSpread(_objectSpread({}, config3), {}, {
|
|
42407
|
+
args: (0, _mapValue.default)(config3.args, extendArg)
|
|
42408
42408
|
}));
|
|
42409
42409
|
}
|
|
42410
42410
|
function extendNamedType(type) {
|
|
@@ -42433,80 +42433,80 @@ var require_extendSchema = __commonJS2({
|
|
|
42433
42433
|
}
|
|
42434
42434
|
function extendInputObjectType(type) {
|
|
42435
42435
|
var _typeExtensionsMap$co;
|
|
42436
|
-
var
|
|
42437
|
-
var extensions = (_typeExtensionsMap$co = typeExtensionsMap[
|
|
42438
|
-
return new _definition.GraphQLInputObjectType(_objectSpread(_objectSpread({},
|
|
42436
|
+
var config3 = type.toConfig();
|
|
42437
|
+
var extensions = (_typeExtensionsMap$co = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co !== void 0 ? _typeExtensionsMap$co : [];
|
|
42438
|
+
return new _definition.GraphQLInputObjectType(_objectSpread(_objectSpread({}, config3), {}, {
|
|
42439
42439
|
fields: function fields() {
|
|
42440
|
-
return _objectSpread(_objectSpread({}, (0, _mapValue.default)(
|
|
42440
|
+
return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config3.fields, function(field) {
|
|
42441
42441
|
return _objectSpread(_objectSpread({}, field), {}, {
|
|
42442
42442
|
type: replaceType(field.type)
|
|
42443
42443
|
});
|
|
42444
42444
|
})), buildInputFieldMap(extensions));
|
|
42445
42445
|
},
|
|
42446
|
-
extensionASTNodes:
|
|
42446
|
+
extensionASTNodes: config3.extensionASTNodes.concat(extensions)
|
|
42447
42447
|
}));
|
|
42448
42448
|
}
|
|
42449
42449
|
function extendEnumType(type) {
|
|
42450
42450
|
var _typeExtensionsMap$ty;
|
|
42451
|
-
var
|
|
42451
|
+
var config3 = type.toConfig();
|
|
42452
42452
|
var extensions = (_typeExtensionsMap$ty = typeExtensionsMap[type.name]) !== null && _typeExtensionsMap$ty !== void 0 ? _typeExtensionsMap$ty : [];
|
|
42453
|
-
return new _definition.GraphQLEnumType(_objectSpread(_objectSpread({},
|
|
42454
|
-
values: _objectSpread(_objectSpread({},
|
|
42455
|
-
extensionASTNodes:
|
|
42453
|
+
return new _definition.GraphQLEnumType(_objectSpread(_objectSpread({}, config3), {}, {
|
|
42454
|
+
values: _objectSpread(_objectSpread({}, config3.values), buildEnumValueMap(extensions)),
|
|
42455
|
+
extensionASTNodes: config3.extensionASTNodes.concat(extensions)
|
|
42456
42456
|
}));
|
|
42457
42457
|
}
|
|
42458
42458
|
function extendScalarType(type) {
|
|
42459
42459
|
var _typeExtensionsMap$co2;
|
|
42460
|
-
var
|
|
42461
|
-
var extensions = (_typeExtensionsMap$co2 = typeExtensionsMap[
|
|
42462
|
-
var specifiedByUrl =
|
|
42460
|
+
var config3 = type.toConfig();
|
|
42461
|
+
var extensions = (_typeExtensionsMap$co2 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co2 !== void 0 ? _typeExtensionsMap$co2 : [];
|
|
42462
|
+
var specifiedByUrl = config3.specifiedByUrl;
|
|
42463
42463
|
for (var _i8 = 0; _i8 < extensions.length; _i8++) {
|
|
42464
42464
|
var _getSpecifiedByUrl;
|
|
42465
42465
|
var extensionNode = extensions[_i8];
|
|
42466
42466
|
specifiedByUrl = (_getSpecifiedByUrl = getSpecifiedByUrl(extensionNode)) !== null && _getSpecifiedByUrl !== void 0 ? _getSpecifiedByUrl : specifiedByUrl;
|
|
42467
42467
|
}
|
|
42468
|
-
return new _definition.GraphQLScalarType(_objectSpread(_objectSpread({},
|
|
42468
|
+
return new _definition.GraphQLScalarType(_objectSpread(_objectSpread({}, config3), {}, {
|
|
42469
42469
|
specifiedByUrl,
|
|
42470
|
-
extensionASTNodes:
|
|
42470
|
+
extensionASTNodes: config3.extensionASTNodes.concat(extensions)
|
|
42471
42471
|
}));
|
|
42472
42472
|
}
|
|
42473
42473
|
function extendObjectType(type) {
|
|
42474
42474
|
var _typeExtensionsMap$co3;
|
|
42475
|
-
var
|
|
42476
|
-
var extensions = (_typeExtensionsMap$co3 = typeExtensionsMap[
|
|
42477
|
-
return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({},
|
|
42475
|
+
var config3 = type.toConfig();
|
|
42476
|
+
var extensions = (_typeExtensionsMap$co3 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co3 !== void 0 ? _typeExtensionsMap$co3 : [];
|
|
42477
|
+
return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config3), {}, {
|
|
42478
42478
|
interfaces: function interfaces() {
|
|
42479
42479
|
return [].concat(type.getInterfaces().map(replaceNamedType), buildInterfaces(extensions));
|
|
42480
42480
|
},
|
|
42481
42481
|
fields: function fields() {
|
|
42482
|
-
return _objectSpread(_objectSpread({}, (0, _mapValue.default)(
|
|
42482
|
+
return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config3.fields, extendField)), buildFieldMap(extensions));
|
|
42483
42483
|
},
|
|
42484
|
-
extensionASTNodes:
|
|
42484
|
+
extensionASTNodes: config3.extensionASTNodes.concat(extensions)
|
|
42485
42485
|
}));
|
|
42486
42486
|
}
|
|
42487
42487
|
function extendInterfaceType(type) {
|
|
42488
42488
|
var _typeExtensionsMap$co4;
|
|
42489
|
-
var
|
|
42490
|
-
var extensions = (_typeExtensionsMap$co4 = typeExtensionsMap[
|
|
42491
|
-
return new _definition.GraphQLInterfaceType(_objectSpread(_objectSpread({},
|
|
42489
|
+
var config3 = type.toConfig();
|
|
42490
|
+
var extensions = (_typeExtensionsMap$co4 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co4 !== void 0 ? _typeExtensionsMap$co4 : [];
|
|
42491
|
+
return new _definition.GraphQLInterfaceType(_objectSpread(_objectSpread({}, config3), {}, {
|
|
42492
42492
|
interfaces: function interfaces() {
|
|
42493
42493
|
return [].concat(type.getInterfaces().map(replaceNamedType), buildInterfaces(extensions));
|
|
42494
42494
|
},
|
|
42495
42495
|
fields: function fields() {
|
|
42496
|
-
return _objectSpread(_objectSpread({}, (0, _mapValue.default)(
|
|
42496
|
+
return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config3.fields, extendField)), buildFieldMap(extensions));
|
|
42497
42497
|
},
|
|
42498
|
-
extensionASTNodes:
|
|
42498
|
+
extensionASTNodes: config3.extensionASTNodes.concat(extensions)
|
|
42499
42499
|
}));
|
|
42500
42500
|
}
|
|
42501
42501
|
function extendUnionType(type) {
|
|
42502
42502
|
var _typeExtensionsMap$co5;
|
|
42503
|
-
var
|
|
42504
|
-
var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[
|
|
42505
|
-
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({},
|
|
42503
|
+
var config3 = type.toConfig();
|
|
42504
|
+
var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
|
|
42505
|
+
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config3), {}, {
|
|
42506
42506
|
types: function types42() {
|
|
42507
42507
|
return [].concat(type.getTypes().map(replaceNamedType), buildUnionTypes(extensions));
|
|
42508
42508
|
},
|
|
42509
|
-
extensionASTNodes:
|
|
42509
|
+
extensionASTNodes: config3.extensionASTNodes.concat(extensions)
|
|
42510
42510
|
}));
|
|
42511
42511
|
}
|
|
42512
42512
|
function extendField(field) {
|
|
@@ -42821,24 +42821,24 @@ var require_buildASTSchema = __commonJS2({
|
|
|
42821
42821
|
extensionASTNodes: [],
|
|
42822
42822
|
assumeValid: false
|
|
42823
42823
|
};
|
|
42824
|
-
var
|
|
42825
|
-
if (
|
|
42826
|
-
for (var _i2 = 0, _config$types2 =
|
|
42824
|
+
var config3 = (0, _extendSchema.extendSchemaImpl)(emptySchemaConfig, documentAST, options);
|
|
42825
|
+
if (config3.astNode == null) {
|
|
42826
|
+
for (var _i2 = 0, _config$types2 = config3.types; _i2 < _config$types2.length; _i2++) {
|
|
42827
42827
|
var type = _config$types2[_i2];
|
|
42828
42828
|
switch (type.name) {
|
|
42829
42829
|
case "Query":
|
|
42830
|
-
|
|
42830
|
+
config3.query = type;
|
|
42831
42831
|
break;
|
|
42832
42832
|
case "Mutation":
|
|
42833
|
-
|
|
42833
|
+
config3.mutation = type;
|
|
42834
42834
|
break;
|
|
42835
42835
|
case "Subscription":
|
|
42836
|
-
|
|
42836
|
+
config3.subscription = type;
|
|
42837
42837
|
break;
|
|
42838
42838
|
}
|
|
42839
42839
|
}
|
|
42840
42840
|
}
|
|
42841
|
-
var directives =
|
|
42841
|
+
var directives = config3.directives;
|
|
42842
42842
|
var _loop = function _loop2(_i42) {
|
|
42843
42843
|
var stdDirective = _directives.specifiedDirectives[_i42];
|
|
42844
42844
|
if (directives.every(function(directive) {
|
|
@@ -42850,7 +42850,7 @@ var require_buildASTSchema = __commonJS2({
|
|
|
42850
42850
|
for (var _i4 = 0; _i4 < _directives.specifiedDirectives.length; _i4++) {
|
|
42851
42851
|
_loop(_i4);
|
|
42852
42852
|
}
|
|
42853
|
-
return new _schema.GraphQLSchema(
|
|
42853
|
+
return new _schema.GraphQLSchema(config3);
|
|
42854
42854
|
}
|
|
42855
42855
|
function buildSchema3(source, options) {
|
|
42856
42856
|
var document = (0, _parser.parse)(source, {
|
|
@@ -42950,12 +42950,12 @@ var require_lexicographicSortSchema = __commonJS2({
|
|
|
42950
42950
|
return maybeType && replaceNamedType(maybeType);
|
|
42951
42951
|
}
|
|
42952
42952
|
function sortDirective(directive) {
|
|
42953
|
-
var
|
|
42954
|
-
return new _directives.GraphQLDirective(_objectSpread(_objectSpread({},
|
|
42955
|
-
locations: sortBy(
|
|
42953
|
+
var config3 = directive.toConfig();
|
|
42954
|
+
return new _directives.GraphQLDirective(_objectSpread(_objectSpread({}, config3), {}, {
|
|
42955
|
+
locations: sortBy(config3.locations, function(x22) {
|
|
42956
42956
|
return x22;
|
|
42957
42957
|
}),
|
|
42958
|
-
args: sortArgs(
|
|
42958
|
+
args: sortArgs(config3.args)
|
|
42959
42959
|
}));
|
|
42960
42960
|
}
|
|
42961
42961
|
function sortArgs(args) {
|
|
@@ -42988,13 +42988,13 @@ var require_lexicographicSortSchema = __commonJS2({
|
|
|
42988
42988
|
return type;
|
|
42989
42989
|
}
|
|
42990
42990
|
if ((0, _definition.isObjectType)(type)) {
|
|
42991
|
-
var
|
|
42992
|
-
return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({},
|
|
42991
|
+
var config3 = type.toConfig();
|
|
42992
|
+
return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config3), {}, {
|
|
42993
42993
|
interfaces: function interfaces() {
|
|
42994
|
-
return sortTypes(
|
|
42994
|
+
return sortTypes(config3.interfaces);
|
|
42995
42995
|
},
|
|
42996
42996
|
fields: function fields() {
|
|
42997
|
-
return sortFields(
|
|
42997
|
+
return sortFields(config3.fields);
|
|
42998
42998
|
}
|
|
42999
42999
|
}));
|
|
43000
43000
|
}
|
|
@@ -83799,13 +83799,13 @@ var require_esprima2 = __commonJS2({
|
|
|
83799
83799
|
return Reader2;
|
|
83800
83800
|
}();
|
|
83801
83801
|
var Tokenizer = function() {
|
|
83802
|
-
function Tokenizer2(code,
|
|
83802
|
+
function Tokenizer2(code, config3) {
|
|
83803
83803
|
this.errorHandler = new error_handler_1.ErrorHandler();
|
|
83804
|
-
this.errorHandler.tolerant =
|
|
83804
|
+
this.errorHandler.tolerant = config3 ? typeof config3.tolerant === "boolean" && config3.tolerant : false;
|
|
83805
83805
|
this.scanner = new scanner_1.Scanner(code, this.errorHandler);
|
|
83806
|
-
this.scanner.trackComment =
|
|
83807
|
-
this.trackRange =
|
|
83808
|
-
this.trackLoc =
|
|
83806
|
+
this.scanner.trackComment = config3 ? typeof config3.comment === "boolean" && config3.comment : false;
|
|
83807
|
+
this.trackRange = config3 ? typeof config3.range === "boolean" && config3.range : false;
|
|
83808
|
+
this.trackLoc = config3 ? typeof config3.loc === "boolean" && config3.loc : false;
|
|
83809
83809
|
this.buffer = [];
|
|
83810
83810
|
this.reader = new Reader();
|
|
83811
83811
|
}
|
|
@@ -85955,11 +85955,11 @@ var require_printer2 = __commonJS2({
|
|
|
85955
85955
|
return this.code;
|
|
85956
85956
|
};
|
|
85957
85957
|
var emptyPrintResult = new PrintResult("");
|
|
85958
|
-
var Printer = function Printer2(
|
|
85958
|
+
var Printer = function Printer2(config3) {
|
|
85959
85959
|
assert_1.default.ok(this instanceof Printer2);
|
|
85960
|
-
var explicitTabWidth =
|
|
85961
|
-
|
|
85962
|
-
|
|
85960
|
+
var explicitTabWidth = config3 && config3.tabWidth;
|
|
85961
|
+
config3 = options_1.normalize(config3);
|
|
85962
|
+
config3.sourceFileName = null;
|
|
85963
85963
|
function makePrintFunctionWith(options, overrides) {
|
|
85964
85964
|
options = Object.assign({}, options, overrides);
|
|
85965
85965
|
return function(path22) {
|
|
@@ -85974,19 +85974,19 @@ var require_printer2 = __commonJS2({
|
|
|
85974
85974
|
includeComments: false
|
|
85975
85975
|
}));
|
|
85976
85976
|
}
|
|
85977
|
-
var oldTabWidth =
|
|
85977
|
+
var oldTabWidth = config3.tabWidth;
|
|
85978
85978
|
if (!explicitTabWidth) {
|
|
85979
85979
|
var loc = path22.getNode().loc;
|
|
85980
85980
|
if (loc && loc.lines && loc.lines.guessTabWidth) {
|
|
85981
|
-
|
|
85981
|
+
config3.tabWidth = loc.lines.guessTabWidth();
|
|
85982
85982
|
}
|
|
85983
85983
|
}
|
|
85984
85984
|
var reprinter = patcher_1.getReprinter(path22);
|
|
85985
|
-
var lines = reprinter ? reprinter(print5) : genericPrint(path22,
|
|
85985
|
+
var lines = reprinter ? reprinter(print5) : genericPrint(path22, config3, options, makePrintFunctionWith(options, {
|
|
85986
85986
|
includeComments: true,
|
|
85987
85987
|
avoidRootParens: false
|
|
85988
85988
|
}));
|
|
85989
|
-
|
|
85989
|
+
config3.tabWidth = oldTabWidth;
|
|
85990
85990
|
return lines;
|
|
85991
85991
|
}
|
|
85992
85992
|
this.print = function(ast) {
|
|
@@ -85997,7 +85997,7 @@ var require_printer2 = __commonJS2({
|
|
|
85997
85997
|
includeComments: true,
|
|
85998
85998
|
avoidRootParens: false
|
|
85999
85999
|
});
|
|
86000
|
-
return new PrintResult(lines.toString(
|
|
86000
|
+
return new PrintResult(lines.toString(config3), util.composeSourceMaps(config3.inputSourceMap, lines.getSourceMap(config3.sourceMapName, config3.sourceRoot)));
|
|
86001
86001
|
};
|
|
86002
86002
|
this.printGenerically = function(ast) {
|
|
86003
86003
|
if (!ast) {
|
|
@@ -86005,26 +86005,26 @@ var require_printer2 = __commonJS2({
|
|
|
86005
86005
|
}
|
|
86006
86006
|
function printGenerically(path3) {
|
|
86007
86007
|
return comments_1.printComments(path3, function(path4) {
|
|
86008
|
-
return genericPrint(path4,
|
|
86008
|
+
return genericPrint(path4, config3, {
|
|
86009
86009
|
includeComments: true,
|
|
86010
86010
|
avoidRootParens: false
|
|
86011
86011
|
}, printGenerically);
|
|
86012
86012
|
});
|
|
86013
86013
|
}
|
|
86014
86014
|
var path22 = fast_path_1.default.from(ast);
|
|
86015
|
-
var oldReuseWhitespace =
|
|
86016
|
-
|
|
86017
|
-
var pr = new PrintResult(printGenerically(path22).toString(
|
|
86018
|
-
|
|
86015
|
+
var oldReuseWhitespace = config3.reuseWhitespace;
|
|
86016
|
+
config3.reuseWhitespace = false;
|
|
86017
|
+
var pr = new PrintResult(printGenerically(path22).toString(config3));
|
|
86018
|
+
config3.reuseWhitespace = oldReuseWhitespace;
|
|
86019
86019
|
return pr;
|
|
86020
86020
|
};
|
|
86021
86021
|
};
|
|
86022
86022
|
exports.Printer = Printer;
|
|
86023
|
-
function genericPrint(path22,
|
|
86023
|
+
function genericPrint(path22, config3, options, printPath) {
|
|
86024
86024
|
assert_1.default.ok(path22 instanceof fast_path_1.default);
|
|
86025
86025
|
var node2 = path22.getValue();
|
|
86026
86026
|
var parts = [];
|
|
86027
|
-
var linesWithoutParens = genericPrintNoParens(path22,
|
|
86027
|
+
var linesWithoutParens = genericPrintNoParens(path22, config3, printPath);
|
|
86028
86028
|
if (!node2 || linesWithoutParens.isEmpty()) {
|
|
86029
86029
|
return linesWithoutParens;
|
|
86030
86030
|
}
|
|
@@ -88087,9 +88087,9 @@ var require_main2 = __commonJS2({
|
|
|
88087
88087
|
}
|
|
88088
88088
|
}
|
|
88089
88089
|
});
|
|
88090
|
-
async function runPipeline(
|
|
88090
|
+
async function runPipeline(config3, pipeline22, target) {
|
|
88091
88091
|
for (const transform of pipeline22) {
|
|
88092
|
-
await transform?.(
|
|
88092
|
+
await transform?.(config3, target);
|
|
88093
88093
|
}
|
|
88094
88094
|
}
|
|
88095
88095
|
var import_graphql16 = __toESM2(require_graphql2(), 1);
|
|
@@ -89168,35 +89168,35 @@ function rewireTypes(originalTypeMap, directives) {
|
|
|
89168
89168
|
}
|
|
89169
89169
|
function rewireNamedType(type) {
|
|
89170
89170
|
if ((0, import_graphql8.isObjectType)(type)) {
|
|
89171
|
-
const
|
|
89171
|
+
const config3 = type.toConfig();
|
|
89172
89172
|
const newConfig = {
|
|
89173
|
-
...
|
|
89174
|
-
fields: () => rewireFields(
|
|
89175
|
-
interfaces: () => rewireNamedTypes(
|
|
89173
|
+
...config3,
|
|
89174
|
+
fields: () => rewireFields(config3.fields),
|
|
89175
|
+
interfaces: () => rewireNamedTypes(config3.interfaces)
|
|
89176
89176
|
};
|
|
89177
89177
|
return new import_graphql8.GraphQLObjectType(newConfig);
|
|
89178
89178
|
} else if ((0, import_graphql8.isInterfaceType)(type)) {
|
|
89179
|
-
const
|
|
89179
|
+
const config3 = type.toConfig();
|
|
89180
89180
|
const newConfig = {
|
|
89181
|
-
...
|
|
89182
|
-
fields: () => rewireFields(
|
|
89181
|
+
...config3,
|
|
89182
|
+
fields: () => rewireFields(config3.fields)
|
|
89183
89183
|
};
|
|
89184
89184
|
if ("interfaces" in newConfig) {
|
|
89185
|
-
newConfig.interfaces = () => rewireNamedTypes(
|
|
89185
|
+
newConfig.interfaces = () => rewireNamedTypes(config3.interfaces);
|
|
89186
89186
|
}
|
|
89187
89187
|
return new import_graphql8.GraphQLInterfaceType(newConfig);
|
|
89188
89188
|
} else if ((0, import_graphql8.isUnionType)(type)) {
|
|
89189
|
-
const
|
|
89189
|
+
const config3 = type.toConfig();
|
|
89190
89190
|
const newConfig = {
|
|
89191
|
-
...
|
|
89192
|
-
types: () => rewireNamedTypes(
|
|
89191
|
+
...config3,
|
|
89192
|
+
types: () => rewireNamedTypes(config3.types)
|
|
89193
89193
|
};
|
|
89194
89194
|
return new import_graphql8.GraphQLUnionType(newConfig);
|
|
89195
89195
|
} else if ((0, import_graphql8.isInputObjectType)(type)) {
|
|
89196
|
-
const
|
|
89196
|
+
const config3 = type.toConfig();
|
|
89197
89197
|
const newConfig = {
|
|
89198
|
-
...
|
|
89199
|
-
fields: () => rewireInputFields(
|
|
89198
|
+
...config3,
|
|
89199
|
+
fields: () => rewireInputFields(config3.fields)
|
|
89200
89200
|
};
|
|
89201
89201
|
return new import_graphql8.GraphQLInputObjectType(newConfig);
|
|
89202
89202
|
} else if ((0, import_graphql8.isEnumType)(type)) {
|
|
@@ -89349,8 +89349,8 @@ function mapEnumValues(originalTypeMap, schema, schemaMapper) {
|
|
|
89349
89349
|
}
|
|
89350
89350
|
return mapTypes(originalTypeMap, schema, {
|
|
89351
89351
|
[MapperKind.ENUM_TYPE]: (type) => {
|
|
89352
|
-
const
|
|
89353
|
-
const originalEnumValueConfigMap =
|
|
89352
|
+
const config3 = type.toConfig();
|
|
89353
|
+
const originalEnumValueConfigMap = config3.values;
|
|
89354
89354
|
const newEnumValueConfigMap = {};
|
|
89355
89355
|
for (const externalValue in originalEnumValueConfigMap) {
|
|
89356
89356
|
const originalEnumValueConfig = originalEnumValueConfigMap[externalValue];
|
|
@@ -89365,7 +89365,7 @@ function mapEnumValues(originalTypeMap, schema, schemaMapper) {
|
|
|
89365
89365
|
}
|
|
89366
89366
|
}
|
|
89367
89367
|
return correctASTNodes(new import_graphql10.GraphQLEnumType({
|
|
89368
|
-
...
|
|
89368
|
+
...config3,
|
|
89369
89369
|
values: newEnumValueConfigMap
|
|
89370
89370
|
}));
|
|
89371
89371
|
}
|
|
@@ -89428,8 +89428,8 @@ function mapFields(originalTypeMap, schema, schemaMapper) {
|
|
|
89428
89428
|
newTypeMap[typeName] = originalType;
|
|
89429
89429
|
continue;
|
|
89430
89430
|
}
|
|
89431
|
-
const
|
|
89432
|
-
const originalFieldConfigMap =
|
|
89431
|
+
const config3 = originalType.toConfig();
|
|
89432
|
+
const originalFieldConfigMap = config3.fields;
|
|
89433
89433
|
const newFieldConfigMap = {};
|
|
89434
89434
|
for (const fieldName in originalFieldConfigMap) {
|
|
89435
89435
|
const originalFieldConfig = originalFieldConfigMap[fieldName];
|
|
@@ -89454,17 +89454,17 @@ function mapFields(originalTypeMap, schema, schemaMapper) {
|
|
|
89454
89454
|
}
|
|
89455
89455
|
if ((0, import_graphql10.isObjectType)(originalType)) {
|
|
89456
89456
|
newTypeMap[typeName] = correctASTNodes(new import_graphql10.GraphQLObjectType({
|
|
89457
|
-
...
|
|
89457
|
+
...config3,
|
|
89458
89458
|
fields: newFieldConfigMap
|
|
89459
89459
|
}));
|
|
89460
89460
|
} else if ((0, import_graphql10.isInterfaceType)(originalType)) {
|
|
89461
89461
|
newTypeMap[typeName] = correctASTNodes(new import_graphql10.GraphQLInterfaceType({
|
|
89462
|
-
...
|
|
89462
|
+
...config3,
|
|
89463
89463
|
fields: newFieldConfigMap
|
|
89464
89464
|
}));
|
|
89465
89465
|
} else {
|
|
89466
89466
|
newTypeMap[typeName] = correctASTNodes(new import_graphql10.GraphQLInputObjectType({
|
|
89467
|
-
...
|
|
89467
|
+
...config3,
|
|
89468
89468
|
fields: newFieldConfigMap
|
|
89469
89469
|
}));
|
|
89470
89470
|
}
|
|
@@ -89486,8 +89486,8 @@ function mapArguments(originalTypeMap, schema, schemaMapper) {
|
|
|
89486
89486
|
newTypeMap[typeName] = originalType;
|
|
89487
89487
|
continue;
|
|
89488
89488
|
}
|
|
89489
|
-
const
|
|
89490
|
-
const originalFieldConfigMap =
|
|
89489
|
+
const config3 = originalType.toConfig();
|
|
89490
|
+
const originalFieldConfigMap = config3.fields;
|
|
89491
89491
|
const newFieldConfigMap = {};
|
|
89492
89492
|
for (const fieldName in originalFieldConfigMap) {
|
|
89493
89493
|
const originalFieldConfig = originalFieldConfigMap[fieldName];
|
|
@@ -89521,17 +89521,17 @@ function mapArguments(originalTypeMap, schema, schemaMapper) {
|
|
|
89521
89521
|
}
|
|
89522
89522
|
if ((0, import_graphql10.isObjectType)(originalType)) {
|
|
89523
89523
|
newTypeMap[typeName] = new import_graphql10.GraphQLObjectType({
|
|
89524
|
-
...
|
|
89524
|
+
...config3,
|
|
89525
89525
|
fields: newFieldConfigMap
|
|
89526
89526
|
});
|
|
89527
89527
|
} else if ((0, import_graphql10.isInterfaceType)(originalType)) {
|
|
89528
89528
|
newTypeMap[typeName] = new import_graphql10.GraphQLInterfaceType({
|
|
89529
|
-
...
|
|
89529
|
+
...config3,
|
|
89530
89530
|
fields: newFieldConfigMap
|
|
89531
89531
|
});
|
|
89532
89532
|
} else {
|
|
89533
89533
|
newTypeMap[typeName] = new import_graphql10.GraphQLInputObjectType({
|
|
89534
|
-
...
|
|
89534
|
+
...config3,
|
|
89535
89535
|
fields: newFieldConfigMap
|
|
89536
89536
|
});
|
|
89537
89537
|
}
|
|
@@ -89635,99 +89635,99 @@ function getEnumValueMapper(schemaMapper) {
|
|
|
89635
89635
|
}
|
|
89636
89636
|
function correctASTNodes(type) {
|
|
89637
89637
|
if ((0, import_graphql10.isObjectType)(type)) {
|
|
89638
|
-
const
|
|
89639
|
-
if (
|
|
89638
|
+
const config3 = type.toConfig();
|
|
89639
|
+
if (config3.astNode != null) {
|
|
89640
89640
|
const fields = [];
|
|
89641
|
-
for (const fieldName in
|
|
89642
|
-
const fieldConfig =
|
|
89641
|
+
for (const fieldName in config3.fields) {
|
|
89642
|
+
const fieldConfig = config3.fields[fieldName];
|
|
89643
89643
|
if (fieldConfig.astNode != null) {
|
|
89644
89644
|
fields.push(fieldConfig.astNode);
|
|
89645
89645
|
}
|
|
89646
89646
|
}
|
|
89647
|
-
|
|
89648
|
-
...
|
|
89647
|
+
config3.astNode = {
|
|
89648
|
+
...config3.astNode,
|
|
89649
89649
|
kind: import_graphql10.Kind.OBJECT_TYPE_DEFINITION,
|
|
89650
89650
|
fields
|
|
89651
89651
|
};
|
|
89652
89652
|
}
|
|
89653
|
-
if (
|
|
89654
|
-
|
|
89653
|
+
if (config3.extensionASTNodes != null) {
|
|
89654
|
+
config3.extensionASTNodes = config3.extensionASTNodes.map((node2) => ({
|
|
89655
89655
|
...node2,
|
|
89656
89656
|
kind: import_graphql10.Kind.OBJECT_TYPE_EXTENSION,
|
|
89657
89657
|
fields: void 0
|
|
89658
89658
|
}));
|
|
89659
89659
|
}
|
|
89660
|
-
return new import_graphql10.GraphQLObjectType(
|
|
89660
|
+
return new import_graphql10.GraphQLObjectType(config3);
|
|
89661
89661
|
} else if ((0, import_graphql10.isInterfaceType)(type)) {
|
|
89662
|
-
const
|
|
89663
|
-
if (
|
|
89662
|
+
const config3 = type.toConfig();
|
|
89663
|
+
if (config3.astNode != null) {
|
|
89664
89664
|
const fields = [];
|
|
89665
|
-
for (const fieldName in
|
|
89666
|
-
const fieldConfig =
|
|
89665
|
+
for (const fieldName in config3.fields) {
|
|
89666
|
+
const fieldConfig = config3.fields[fieldName];
|
|
89667
89667
|
if (fieldConfig.astNode != null) {
|
|
89668
89668
|
fields.push(fieldConfig.astNode);
|
|
89669
89669
|
}
|
|
89670
89670
|
}
|
|
89671
|
-
|
|
89672
|
-
...
|
|
89671
|
+
config3.astNode = {
|
|
89672
|
+
...config3.astNode,
|
|
89673
89673
|
kind: import_graphql10.Kind.INTERFACE_TYPE_DEFINITION,
|
|
89674
89674
|
fields
|
|
89675
89675
|
};
|
|
89676
89676
|
}
|
|
89677
|
-
if (
|
|
89678
|
-
|
|
89677
|
+
if (config3.extensionASTNodes != null) {
|
|
89678
|
+
config3.extensionASTNodes = config3.extensionASTNodes.map((node2) => ({
|
|
89679
89679
|
...node2,
|
|
89680
89680
|
kind: import_graphql10.Kind.INTERFACE_TYPE_EXTENSION,
|
|
89681
89681
|
fields: void 0
|
|
89682
89682
|
}));
|
|
89683
89683
|
}
|
|
89684
|
-
return new import_graphql10.GraphQLInterfaceType(
|
|
89684
|
+
return new import_graphql10.GraphQLInterfaceType(config3);
|
|
89685
89685
|
} else if ((0, import_graphql10.isInputObjectType)(type)) {
|
|
89686
|
-
const
|
|
89687
|
-
if (
|
|
89686
|
+
const config3 = type.toConfig();
|
|
89687
|
+
if (config3.astNode != null) {
|
|
89688
89688
|
const fields = [];
|
|
89689
|
-
for (const fieldName in
|
|
89690
|
-
const fieldConfig =
|
|
89689
|
+
for (const fieldName in config3.fields) {
|
|
89690
|
+
const fieldConfig = config3.fields[fieldName];
|
|
89691
89691
|
if (fieldConfig.astNode != null) {
|
|
89692
89692
|
fields.push(fieldConfig.astNode);
|
|
89693
89693
|
}
|
|
89694
89694
|
}
|
|
89695
|
-
|
|
89696
|
-
...
|
|
89695
|
+
config3.astNode = {
|
|
89696
|
+
...config3.astNode,
|
|
89697
89697
|
kind: import_graphql10.Kind.INPUT_OBJECT_TYPE_DEFINITION,
|
|
89698
89698
|
fields
|
|
89699
89699
|
};
|
|
89700
89700
|
}
|
|
89701
|
-
if (
|
|
89702
|
-
|
|
89701
|
+
if (config3.extensionASTNodes != null) {
|
|
89702
|
+
config3.extensionASTNodes = config3.extensionASTNodes.map((node2) => ({
|
|
89703
89703
|
...node2,
|
|
89704
89704
|
kind: import_graphql10.Kind.INPUT_OBJECT_TYPE_EXTENSION,
|
|
89705
89705
|
fields: void 0
|
|
89706
89706
|
}));
|
|
89707
89707
|
}
|
|
89708
|
-
return new import_graphql10.GraphQLInputObjectType(
|
|
89708
|
+
return new import_graphql10.GraphQLInputObjectType(config3);
|
|
89709
89709
|
} else if ((0, import_graphql10.isEnumType)(type)) {
|
|
89710
|
-
const
|
|
89711
|
-
if (
|
|
89710
|
+
const config3 = type.toConfig();
|
|
89711
|
+
if (config3.astNode != null) {
|
|
89712
89712
|
const values = [];
|
|
89713
|
-
for (const enumKey in
|
|
89714
|
-
const enumValueConfig =
|
|
89713
|
+
for (const enumKey in config3.values) {
|
|
89714
|
+
const enumValueConfig = config3.values[enumKey];
|
|
89715
89715
|
if (enumValueConfig.astNode != null) {
|
|
89716
89716
|
values.push(enumValueConfig.astNode);
|
|
89717
89717
|
}
|
|
89718
89718
|
}
|
|
89719
|
-
|
|
89720
|
-
...
|
|
89719
|
+
config3.astNode = {
|
|
89720
|
+
...config3.astNode,
|
|
89721
89721
|
values
|
|
89722
89722
|
};
|
|
89723
89723
|
}
|
|
89724
|
-
if (
|
|
89725
|
-
|
|
89724
|
+
if (config3.extensionASTNodes != null) {
|
|
89725
|
+
config3.extensionASTNodes = config3.extensionASTNodes.map((node2) => ({
|
|
89726
89726
|
...node2,
|
|
89727
89727
|
values: void 0
|
|
89728
89728
|
}));
|
|
89729
89729
|
}
|
|
89730
|
-
return new import_graphql10.GraphQLEnumType(
|
|
89730
|
+
return new import_graphql10.GraphQLEnumType(config3);
|
|
89731
89731
|
} else {
|
|
89732
89732
|
return type;
|
|
89733
89733
|
}
|
|
@@ -89857,9 +89857,9 @@ function getResolversFromSchema(schema, includeDefaultMergedResolver) {
|
|
|
89857
89857
|
const type = typeMap[typeName];
|
|
89858
89858
|
if ((0, import_graphql12.isScalarType)(type)) {
|
|
89859
89859
|
if (!(0, import_graphql12.isSpecifiedScalarType)(type)) {
|
|
89860
|
-
const
|
|
89861
|
-
delete
|
|
89862
|
-
resolvers[typeName] = new import_graphql12.GraphQLScalarType(
|
|
89860
|
+
const config3 = type.toConfig();
|
|
89861
|
+
delete config3.astNode;
|
|
89862
|
+
resolvers[typeName] = new import_graphql12.GraphQLScalarType(config3);
|
|
89863
89863
|
}
|
|
89864
89864
|
} else if ((0, import_graphql12.isEnumType)(type)) {
|
|
89865
89865
|
resolvers[typeName] = {};
|
|
@@ -90215,26 +90215,26 @@ function addResolversToExistingSchema(schema, resolvers, defaultFieldResolver) {
|
|
|
90215
90215
|
}
|
|
90216
90216
|
}
|
|
90217
90217
|
} else if ((0, import_graphql17.isEnumType)(type)) {
|
|
90218
|
-
const
|
|
90219
|
-
const enumValueConfigMap =
|
|
90218
|
+
const config3 = type.toConfig();
|
|
90219
|
+
const enumValueConfigMap = config3.values;
|
|
90220
90220
|
for (const fieldName in resolverValue) {
|
|
90221
90221
|
if (fieldName.startsWith("__")) {
|
|
90222
|
-
|
|
90223
|
-
} else if (fieldName === "astNode" &&
|
|
90224
|
-
|
|
90225
|
-
...
|
|
90226
|
-
description: (_h = (_g = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.astNode) === null || _g === void 0 ? void 0 : _g.description) !== null && _h !== void 0 ? _h :
|
|
90227
|
-
directives: ((_j =
|
|
90222
|
+
config3[fieldName.substring(2)] = resolverValue[fieldName];
|
|
90223
|
+
} else if (fieldName === "astNode" && config3.astNode != null) {
|
|
90224
|
+
config3.astNode = {
|
|
90225
|
+
...config3.astNode,
|
|
90226
|
+
description: (_h = (_g = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.astNode) === null || _g === void 0 ? void 0 : _g.description) !== null && _h !== void 0 ? _h : config3.astNode.description,
|
|
90227
|
+
directives: ((_j = config3.astNode.directives) !== null && _j !== void 0 ? _j : []).concat((_l = (_k = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.astNode) === null || _k === void 0 ? void 0 : _k.directives) !== null && _l !== void 0 ? _l : [])
|
|
90228
90228
|
};
|
|
90229
|
-
} else if (fieldName === "extensionASTNodes" &&
|
|
90230
|
-
|
|
90229
|
+
} else if (fieldName === "extensionASTNodes" && config3.extensionASTNodes != null) {
|
|
90230
|
+
config3.extensionASTNodes = config3.extensionASTNodes.concat((_m = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.extensionASTNodes) !== null && _m !== void 0 ? _m : []);
|
|
90231
90231
|
} else if (fieldName === "extensions" && type.extensions != null && resolverValue.extensions != null) {
|
|
90232
90232
|
type.extensions = Object.assign(/* @__PURE__ */ Object.create(null), type.extensions, resolverValue.extensions);
|
|
90233
90233
|
} else if (enumValueConfigMap[fieldName]) {
|
|
90234
90234
|
enumValueConfigMap[fieldName].value = resolverValue[fieldName];
|
|
90235
90235
|
}
|
|
90236
90236
|
}
|
|
90237
|
-
typeMap[typeName] = new import_graphql17.GraphQLEnumType(
|
|
90237
|
+
typeMap[typeName] = new import_graphql17.GraphQLEnumType(config3);
|
|
90238
90238
|
} else if ((0, import_graphql17.isUnionType)(type)) {
|
|
90239
90239
|
for (const fieldName in resolverValue) {
|
|
90240
90240
|
if (fieldName.startsWith("__")) {
|
|
@@ -90276,83 +90276,83 @@ function createNewSchemaWithResolvers(schema, resolvers, defaultFieldResolver) {
|
|
|
90276
90276
|
schema = mapSchema(schema, {
|
|
90277
90277
|
[MapperKind.SCALAR_TYPE]: (type) => {
|
|
90278
90278
|
var _a, _b, _c, _d, _e, _f;
|
|
90279
|
-
const
|
|
90279
|
+
const config3 = type.toConfig();
|
|
90280
90280
|
const resolverValue = resolvers[type.name];
|
|
90281
90281
|
if (!(0, import_graphql17.isSpecifiedScalarType)(type) && resolverValue != null) {
|
|
90282
90282
|
for (const fieldName in resolverValue) {
|
|
90283
90283
|
if (fieldName.startsWith("__")) {
|
|
90284
|
-
|
|
90285
|
-
} else if (fieldName === "astNode" &&
|
|
90286
|
-
|
|
90287
|
-
...
|
|
90288
|
-
description: (_b = (_a = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.astNode) === null || _a === void 0 ? void 0 : _a.description) !== null && _b !== void 0 ? _b :
|
|
90289
|
-
directives: ((_c =
|
|
90290
|
-
};
|
|
90291
|
-
} else if (fieldName === "extensionASTNodes" &&
|
|
90292
|
-
|
|
90293
|
-
} else if (fieldName === "extensions" &&
|
|
90294
|
-
|
|
90284
|
+
config3[fieldName.substring(2)] = resolverValue[fieldName];
|
|
90285
|
+
} else if (fieldName === "astNode" && config3.astNode != null) {
|
|
90286
|
+
config3.astNode = {
|
|
90287
|
+
...config3.astNode,
|
|
90288
|
+
description: (_b = (_a = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.astNode) === null || _a === void 0 ? void 0 : _a.description) !== null && _b !== void 0 ? _b : config3.astNode.description,
|
|
90289
|
+
directives: ((_c = config3.astNode.directives) !== null && _c !== void 0 ? _c : []).concat((_e = (_d = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.astNode) === null || _d === void 0 ? void 0 : _d.directives) !== null && _e !== void 0 ? _e : [])
|
|
90290
|
+
};
|
|
90291
|
+
} else if (fieldName === "extensionASTNodes" && config3.extensionASTNodes != null) {
|
|
90292
|
+
config3.extensionASTNodes = config3.extensionASTNodes.concat((_f = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.extensionASTNodes) !== null && _f !== void 0 ? _f : []);
|
|
90293
|
+
} else if (fieldName === "extensions" && config3.extensions != null && resolverValue.extensions != null) {
|
|
90294
|
+
config3.extensions = Object.assign(/* @__PURE__ */ Object.create(null), type.extensions, resolverValue.extensions);
|
|
90295
90295
|
} else {
|
|
90296
|
-
|
|
90296
|
+
config3[fieldName] = resolverValue[fieldName];
|
|
90297
90297
|
}
|
|
90298
90298
|
}
|
|
90299
|
-
return new import_graphql17.GraphQLScalarType(
|
|
90299
|
+
return new import_graphql17.GraphQLScalarType(config3);
|
|
90300
90300
|
}
|
|
90301
90301
|
},
|
|
90302
90302
|
[MapperKind.ENUM_TYPE]: (type) => {
|
|
90303
90303
|
var _a, _b, _c, _d, _e, _f;
|
|
90304
90304
|
const resolverValue = resolvers[type.name];
|
|
90305
|
-
const
|
|
90306
|
-
const enumValueConfigMap =
|
|
90305
|
+
const config3 = type.toConfig();
|
|
90306
|
+
const enumValueConfigMap = config3.values;
|
|
90307
90307
|
if (resolverValue != null) {
|
|
90308
90308
|
for (const fieldName in resolverValue) {
|
|
90309
90309
|
if (fieldName.startsWith("__")) {
|
|
90310
|
-
|
|
90311
|
-
} else if (fieldName === "astNode" &&
|
|
90312
|
-
|
|
90313
|
-
...
|
|
90314
|
-
description: (_b = (_a = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.astNode) === null || _a === void 0 ? void 0 : _a.description) !== null && _b !== void 0 ? _b :
|
|
90315
|
-
directives: ((_c =
|
|
90316
|
-
};
|
|
90317
|
-
} else if (fieldName === "extensionASTNodes" &&
|
|
90318
|
-
|
|
90319
|
-
} else if (fieldName === "extensions" &&
|
|
90320
|
-
|
|
90310
|
+
config3[fieldName.substring(2)] = resolverValue[fieldName];
|
|
90311
|
+
} else if (fieldName === "astNode" && config3.astNode != null) {
|
|
90312
|
+
config3.astNode = {
|
|
90313
|
+
...config3.astNode,
|
|
90314
|
+
description: (_b = (_a = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.astNode) === null || _a === void 0 ? void 0 : _a.description) !== null && _b !== void 0 ? _b : config3.astNode.description,
|
|
90315
|
+
directives: ((_c = config3.astNode.directives) !== null && _c !== void 0 ? _c : []).concat((_e = (_d = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.astNode) === null || _d === void 0 ? void 0 : _d.directives) !== null && _e !== void 0 ? _e : [])
|
|
90316
|
+
};
|
|
90317
|
+
} else if (fieldName === "extensionASTNodes" && config3.extensionASTNodes != null) {
|
|
90318
|
+
config3.extensionASTNodes = config3.extensionASTNodes.concat((_f = resolverValue === null || resolverValue === void 0 ? void 0 : resolverValue.extensionASTNodes) !== null && _f !== void 0 ? _f : []);
|
|
90319
|
+
} else if (fieldName === "extensions" && config3.extensions != null && resolverValue.extensions != null) {
|
|
90320
|
+
config3.extensions = Object.assign(/* @__PURE__ */ Object.create(null), type.extensions, resolverValue.extensions);
|
|
90321
90321
|
} else if (enumValueConfigMap[fieldName]) {
|
|
90322
90322
|
enumValueConfigMap[fieldName].value = resolverValue[fieldName];
|
|
90323
90323
|
}
|
|
90324
90324
|
}
|
|
90325
|
-
return new import_graphql17.GraphQLEnumType(
|
|
90325
|
+
return new import_graphql17.GraphQLEnumType(config3);
|
|
90326
90326
|
}
|
|
90327
90327
|
},
|
|
90328
90328
|
[MapperKind.UNION_TYPE]: (type) => {
|
|
90329
90329
|
const resolverValue = resolvers[type.name];
|
|
90330
90330
|
if (resolverValue != null) {
|
|
90331
|
-
const
|
|
90331
|
+
const config3 = type.toConfig();
|
|
90332
90332
|
if (resolverValue["__resolveType"]) {
|
|
90333
|
-
|
|
90333
|
+
config3.resolveType = resolverValue["__resolveType"];
|
|
90334
90334
|
}
|
|
90335
|
-
return new import_graphql17.GraphQLUnionType(
|
|
90335
|
+
return new import_graphql17.GraphQLUnionType(config3);
|
|
90336
90336
|
}
|
|
90337
90337
|
},
|
|
90338
90338
|
[MapperKind.OBJECT_TYPE]: (type) => {
|
|
90339
90339
|
const resolverValue = resolvers[type.name];
|
|
90340
90340
|
if (resolverValue != null) {
|
|
90341
|
-
const
|
|
90341
|
+
const config3 = type.toConfig();
|
|
90342
90342
|
if (resolverValue["__isTypeOf"]) {
|
|
90343
|
-
|
|
90343
|
+
config3.isTypeOf = resolverValue["__isTypeOf"];
|
|
90344
90344
|
}
|
|
90345
|
-
return new import_graphql17.GraphQLObjectType(
|
|
90345
|
+
return new import_graphql17.GraphQLObjectType(config3);
|
|
90346
90346
|
}
|
|
90347
90347
|
},
|
|
90348
90348
|
[MapperKind.INTERFACE_TYPE]: (type) => {
|
|
90349
90349
|
const resolverValue = resolvers[type.name];
|
|
90350
90350
|
if (resolverValue != null) {
|
|
90351
|
-
const
|
|
90351
|
+
const config3 = type.toConfig();
|
|
90352
90352
|
if (resolverValue["__resolveType"]) {
|
|
90353
|
-
|
|
90353
|
+
config3.resolveType = resolverValue["__resolveType"];
|
|
90354
90354
|
}
|
|
90355
|
-
return new import_graphql17.GraphQLInterfaceType(
|
|
90355
|
+
return new import_graphql17.GraphQLInterfaceType(config3);
|
|
90356
90356
|
}
|
|
90357
90357
|
},
|
|
90358
90358
|
[MapperKind.COMPOSITE_FIELD]: (fieldConfig, fieldName, typeName) => {
|
|
@@ -90419,9 +90419,9 @@ function mergeResolvers(resolversDefinitions, options) {
|
|
|
90419
90419
|
}
|
|
90420
90420
|
return result;
|
|
90421
90421
|
}
|
|
90422
|
-
function mergeArguments(args1, args2,
|
|
90422
|
+
function mergeArguments(args1, args2, config3) {
|
|
90423
90423
|
const result = deduplicateArguments([...args2, ...args1].filter(isSome));
|
|
90424
|
-
if (
|
|
90424
|
+
if (config3 && config3.sort) {
|
|
90425
90425
|
result.sort(compareNodes);
|
|
90426
90426
|
}
|
|
90427
90427
|
return result;
|
|
@@ -90475,8 +90475,8 @@ function deduplicateDirectives(directives) {
|
|
|
90475
90475
|
return directive;
|
|
90476
90476
|
}).filter(isSome);
|
|
90477
90477
|
}
|
|
90478
|
-
function mergeDirectives(d1 = [], d2 = [],
|
|
90479
|
-
const reverseOrder =
|
|
90478
|
+
function mergeDirectives(d1 = [], d2 = [], config3) {
|
|
90479
|
+
const reverseOrder = config3 && config3.reverseDirectives;
|
|
90480
90480
|
const asNext = reverseOrder ? d1 : d2;
|
|
90481
90481
|
const asFirst = reverseOrder ? d2 : d1;
|
|
90482
90482
|
const result = deduplicateDirectives([...asNext]);
|
|
@@ -90526,8 +90526,8 @@ function mergeDirective(node2, existingNode) {
|
|
|
90526
90526
|
function deduplicateLists(source, target, filterFn) {
|
|
90527
90527
|
return source.concat(target.filter((val) => filterFn(val, source)));
|
|
90528
90528
|
}
|
|
90529
|
-
function mergeEnumValues(first, second,
|
|
90530
|
-
if (
|
|
90529
|
+
function mergeEnumValues(first, second, config3) {
|
|
90530
|
+
if (config3 === null || config3 === void 0 ? void 0 : config3.consistentEnumMerge) {
|
|
90531
90531
|
const reversed = [];
|
|
90532
90532
|
if (first) {
|
|
90533
90533
|
reversed.push(...first);
|
|
@@ -90554,24 +90554,24 @@ function mergeEnumValues(first, second, config2) {
|
|
|
90554
90554
|
}
|
|
90555
90555
|
}
|
|
90556
90556
|
const result = [...enumValueMap.values()];
|
|
90557
|
-
if (
|
|
90557
|
+
if (config3 && config3.sort) {
|
|
90558
90558
|
result.sort(compareNodes);
|
|
90559
90559
|
}
|
|
90560
90560
|
return result;
|
|
90561
90561
|
}
|
|
90562
90562
|
var import_graphql19 = __toESM2(require_graphql2(), 1);
|
|
90563
|
-
function mergeEnum(e1, e22,
|
|
90563
|
+
function mergeEnum(e1, e22, config3) {
|
|
90564
90564
|
if (e22) {
|
|
90565
90565
|
return {
|
|
90566
90566
|
name: e1.name,
|
|
90567
90567
|
description: e1["description"] || e22["description"],
|
|
90568
|
-
kind: (
|
|
90568
|
+
kind: (config3 === null || config3 === void 0 ? void 0 : config3.convertExtensions) || e1.kind === "EnumTypeDefinition" || e22.kind === "EnumTypeDefinition" ? "EnumTypeDefinition" : "EnumTypeExtension",
|
|
90569
90569
|
loc: e1.loc,
|
|
90570
|
-
directives: mergeDirectives(e1.directives, e22.directives,
|
|
90571
|
-
values: mergeEnumValues(e1.values, e22.values,
|
|
90570
|
+
directives: mergeDirectives(e1.directives, e22.directives, config3),
|
|
90571
|
+
values: mergeEnumValues(e1.values, e22.values, config3)
|
|
90572
90572
|
};
|
|
90573
90573
|
}
|
|
90574
|
-
return (
|
|
90574
|
+
return (config3 === null || config3 === void 0 ? void 0 : config3.convertExtensions) ? {
|
|
90575
90575
|
...e1,
|
|
90576
90576
|
kind: import_graphql19.Kind.ENUM_TYPE_DEFINITION
|
|
90577
90577
|
} : e1;
|
|
@@ -90630,9 +90630,9 @@ function defaultStringComparator(a, b) {
|
|
|
90630
90630
|
return CompareVal.A_GREATER_THAN_B;
|
|
90631
90631
|
return CompareVal.A_EQUALS_B;
|
|
90632
90632
|
}
|
|
90633
|
-
function fieldAlreadyExists(fieldsArr, otherField,
|
|
90633
|
+
function fieldAlreadyExists(fieldsArr, otherField, config3) {
|
|
90634
90634
|
const result = fieldsArr.find((field) => field.name.value === otherField.name.value);
|
|
90635
|
-
if (result && !(
|
|
90635
|
+
if (result && !(config3 === null || config3 === void 0 ? void 0 : config3.ignoreFieldConflicts)) {
|
|
90636
90636
|
const t1 = extractType(result.type);
|
|
90637
90637
|
const t22 = extractType(otherField.type);
|
|
90638
90638
|
if (t1.name.value !== t22.name.value) {
|
|
@@ -90641,17 +90641,17 @@ function fieldAlreadyExists(fieldsArr, otherField, config2) {
|
|
|
90641
90641
|
}
|
|
90642
90642
|
return !!result;
|
|
90643
90643
|
}
|
|
90644
|
-
function mergeFields(type, f1, f222,
|
|
90644
|
+
function mergeFields(type, f1, f222, config3) {
|
|
90645
90645
|
const result = [];
|
|
90646
90646
|
if (f222 != null) {
|
|
90647
90647
|
result.push(...f222);
|
|
90648
90648
|
}
|
|
90649
90649
|
if (f1 != null) {
|
|
90650
90650
|
for (const field of f1) {
|
|
90651
|
-
if (fieldAlreadyExists(result, field,
|
|
90651
|
+
if (fieldAlreadyExists(result, field, config3)) {
|
|
90652
90652
|
const existing = result.find((f32) => f32.name.value === field.name.value);
|
|
90653
|
-
if (!(
|
|
90654
|
-
if (
|
|
90653
|
+
if (!(config3 === null || config3 === void 0 ? void 0 : config3.ignoreFieldConflicts)) {
|
|
90654
|
+
if (config3 === null || config3 === void 0 ? void 0 : config3.throwOnConflict) {
|
|
90655
90655
|
preventConflicts(type, existing, field, false);
|
|
90656
90656
|
} else {
|
|
90657
90657
|
preventConflicts(type, existing, field, true);
|
|
@@ -90660,19 +90660,19 @@ function mergeFields(type, f1, f222, config2) {
|
|
|
90660
90660
|
existing.type = field.type;
|
|
90661
90661
|
}
|
|
90662
90662
|
}
|
|
90663
|
-
existing.arguments = mergeArguments(field["arguments"] || [], existing.arguments || [],
|
|
90664
|
-
existing.directives = mergeDirectives(field.directives, existing.directives,
|
|
90663
|
+
existing.arguments = mergeArguments(field["arguments"] || [], existing.arguments || [], config3);
|
|
90664
|
+
existing.directives = mergeDirectives(field.directives, existing.directives, config3);
|
|
90665
90665
|
existing.description = field.description || existing.description;
|
|
90666
90666
|
} else {
|
|
90667
90667
|
result.push(field);
|
|
90668
90668
|
}
|
|
90669
90669
|
}
|
|
90670
90670
|
}
|
|
90671
|
-
if (
|
|
90671
|
+
if (config3 && config3.sort) {
|
|
90672
90672
|
result.sort(compareNodes);
|
|
90673
90673
|
}
|
|
90674
|
-
if (
|
|
90675
|
-
const exclusions =
|
|
90674
|
+
if (config3 && config3.exclusions) {
|
|
90675
|
+
const exclusions = config3.exclusions;
|
|
90676
90676
|
return result.filter((field) => !exclusions.includes(`${type.name.value}.${field.name.value}`));
|
|
90677
90677
|
}
|
|
90678
90678
|
return result;
|
|
@@ -90701,44 +90701,44 @@ function safeChangeForFieldType(oldType, newType, ignoreNullability = false) {
|
|
|
90701
90701
|
return false;
|
|
90702
90702
|
}
|
|
90703
90703
|
var import_graphql21 = __toESM2(require_graphql2(), 1);
|
|
90704
|
-
function mergeInputType(node2, existingNode,
|
|
90704
|
+
function mergeInputType(node2, existingNode, config3) {
|
|
90705
90705
|
if (existingNode) {
|
|
90706
90706
|
try {
|
|
90707
90707
|
return {
|
|
90708
90708
|
name: node2.name,
|
|
90709
90709
|
description: node2["description"] || existingNode["description"],
|
|
90710
|
-
kind: (
|
|
90710
|
+
kind: (config3 === null || config3 === void 0 ? void 0 : config3.convertExtensions) || node2.kind === "InputObjectTypeDefinition" || existingNode.kind === "InputObjectTypeDefinition" ? "InputObjectTypeDefinition" : "InputObjectTypeExtension",
|
|
90711
90711
|
loc: node2.loc,
|
|
90712
|
-
fields: mergeFields(node2, node2.fields, existingNode.fields,
|
|
90713
|
-
directives: mergeDirectives(node2.directives, existingNode.directives,
|
|
90712
|
+
fields: mergeFields(node2, node2.fields, existingNode.fields, config3),
|
|
90713
|
+
directives: mergeDirectives(node2.directives, existingNode.directives, config3)
|
|
90714
90714
|
};
|
|
90715
90715
|
} catch (e22) {
|
|
90716
90716
|
throw new Error(`Unable to merge GraphQL input type "${node2.name.value}": ${e22.message}`);
|
|
90717
90717
|
}
|
|
90718
90718
|
}
|
|
90719
|
-
return (
|
|
90719
|
+
return (config3 === null || config3 === void 0 ? void 0 : config3.convertExtensions) ? {
|
|
90720
90720
|
...node2,
|
|
90721
90721
|
kind: import_graphql21.Kind.INPUT_OBJECT_TYPE_DEFINITION
|
|
90722
90722
|
} : node2;
|
|
90723
90723
|
}
|
|
90724
90724
|
var import_graphql22 = __toESM2(require_graphql2(), 1);
|
|
90725
|
-
function mergeInterface(node2, existingNode,
|
|
90725
|
+
function mergeInterface(node2, existingNode, config3) {
|
|
90726
90726
|
if (existingNode) {
|
|
90727
90727
|
try {
|
|
90728
90728
|
return {
|
|
90729
90729
|
name: node2.name,
|
|
90730
90730
|
description: node2["description"] || existingNode["description"],
|
|
90731
|
-
kind: (
|
|
90731
|
+
kind: (config3 === null || config3 === void 0 ? void 0 : config3.convertExtensions) || node2.kind === "InterfaceTypeDefinition" || existingNode.kind === "InterfaceTypeDefinition" ? "InterfaceTypeDefinition" : "InterfaceTypeExtension",
|
|
90732
90732
|
loc: node2.loc,
|
|
90733
|
-
fields: mergeFields(node2, node2.fields, existingNode.fields,
|
|
90734
|
-
directives: mergeDirectives(node2.directives, existingNode.directives,
|
|
90735
|
-
interfaces: node2["interfaces"] ? mergeNamedTypeArray(node2["interfaces"], existingNode["interfaces"],
|
|
90733
|
+
fields: mergeFields(node2, node2.fields, existingNode.fields, config3),
|
|
90734
|
+
directives: mergeDirectives(node2.directives, existingNode.directives, config3),
|
|
90735
|
+
interfaces: node2["interfaces"] ? mergeNamedTypeArray(node2["interfaces"], existingNode["interfaces"], config3) : void 0
|
|
90736
90736
|
};
|
|
90737
90737
|
} catch (e22) {
|
|
90738
90738
|
throw new Error(`Unable to merge GraphQL interface "${node2.name.value}": ${e22.message}`);
|
|
90739
90739
|
}
|
|
90740
90740
|
}
|
|
90741
|
-
return (
|
|
90741
|
+
return (config3 === null || config3 === void 0 ? void 0 : config3.convertExtensions) ? {
|
|
90742
90742
|
...node2,
|
|
90743
90743
|
kind: import_graphql22.Kind.INTERFACE_TYPE_DEFINITION
|
|
90744
90744
|
} : node2;
|
|
@@ -90746,65 +90746,65 @@ function mergeInterface(node2, existingNode, config2) {
|
|
|
90746
90746
|
function alreadyExists(arr, other) {
|
|
90747
90747
|
return !!arr.find((i22) => i22.name.value === other.name.value);
|
|
90748
90748
|
}
|
|
90749
|
-
function mergeNamedTypeArray(first = [], second = [],
|
|
90749
|
+
function mergeNamedTypeArray(first = [], second = [], config3 = {}) {
|
|
90750
90750
|
const result = [...second, ...first.filter((d) => !alreadyExists(second, d))];
|
|
90751
|
-
if (
|
|
90751
|
+
if (config3 && config3.sort) {
|
|
90752
90752
|
result.sort(compareNodes);
|
|
90753
90753
|
}
|
|
90754
90754
|
return result;
|
|
90755
90755
|
}
|
|
90756
90756
|
var import_graphql27 = __toESM2(require_graphql2(), 1);
|
|
90757
90757
|
var import_graphql23 = __toESM2(require_graphql2(), 1);
|
|
90758
|
-
function mergeType(node2, existingNode,
|
|
90758
|
+
function mergeType(node2, existingNode, config3) {
|
|
90759
90759
|
if (existingNode) {
|
|
90760
90760
|
try {
|
|
90761
90761
|
return {
|
|
90762
90762
|
name: node2.name,
|
|
90763
90763
|
description: node2["description"] || existingNode["description"],
|
|
90764
|
-
kind: (
|
|
90764
|
+
kind: (config3 === null || config3 === void 0 ? void 0 : config3.convertExtensions) || node2.kind === "ObjectTypeDefinition" || existingNode.kind === "ObjectTypeDefinition" ? "ObjectTypeDefinition" : "ObjectTypeExtension",
|
|
90765
90765
|
loc: node2.loc,
|
|
90766
|
-
fields: mergeFields(node2, node2.fields, existingNode.fields,
|
|
90767
|
-
directives: mergeDirectives(node2.directives, existingNode.directives,
|
|
90768
|
-
interfaces: mergeNamedTypeArray(node2.interfaces, existingNode.interfaces,
|
|
90766
|
+
fields: mergeFields(node2, node2.fields, existingNode.fields, config3),
|
|
90767
|
+
directives: mergeDirectives(node2.directives, existingNode.directives, config3),
|
|
90768
|
+
interfaces: mergeNamedTypeArray(node2.interfaces, existingNode.interfaces, config3)
|
|
90769
90769
|
};
|
|
90770
90770
|
} catch (e22) {
|
|
90771
90771
|
throw new Error(`Unable to merge GraphQL type "${node2.name.value}": ${e22.message}`);
|
|
90772
90772
|
}
|
|
90773
90773
|
}
|
|
90774
|
-
return (
|
|
90774
|
+
return (config3 === null || config3 === void 0 ? void 0 : config3.convertExtensions) ? {
|
|
90775
90775
|
...node2,
|
|
90776
90776
|
kind: import_graphql23.Kind.OBJECT_TYPE_DEFINITION
|
|
90777
90777
|
} : node2;
|
|
90778
90778
|
}
|
|
90779
90779
|
var import_graphql24 = __toESM2(require_graphql2(), 1);
|
|
90780
|
-
function mergeScalar(node2, existingNode,
|
|
90780
|
+
function mergeScalar(node2, existingNode, config3) {
|
|
90781
90781
|
if (existingNode) {
|
|
90782
90782
|
return {
|
|
90783
90783
|
name: node2.name,
|
|
90784
90784
|
description: node2["description"] || existingNode["description"],
|
|
90785
|
-
kind: (
|
|
90785
|
+
kind: (config3 === null || config3 === void 0 ? void 0 : config3.convertExtensions) || node2.kind === "ScalarTypeDefinition" || existingNode.kind === "ScalarTypeDefinition" ? "ScalarTypeDefinition" : "ScalarTypeExtension",
|
|
90786
90786
|
loc: node2.loc,
|
|
90787
|
-
directives: mergeDirectives(node2.directives, existingNode.directives,
|
|
90787
|
+
directives: mergeDirectives(node2.directives, existingNode.directives, config3)
|
|
90788
90788
|
};
|
|
90789
90789
|
}
|
|
90790
|
-
return (
|
|
90790
|
+
return (config3 === null || config3 === void 0 ? void 0 : config3.convertExtensions) ? {
|
|
90791
90791
|
...node2,
|
|
90792
90792
|
kind: import_graphql24.Kind.SCALAR_TYPE_DEFINITION
|
|
90793
90793
|
} : node2;
|
|
90794
90794
|
}
|
|
90795
90795
|
var import_graphql25 = __toESM2(require_graphql2(), 1);
|
|
90796
|
-
function mergeUnion(first, second,
|
|
90796
|
+
function mergeUnion(first, second, config3) {
|
|
90797
90797
|
if (second) {
|
|
90798
90798
|
return {
|
|
90799
90799
|
name: first.name,
|
|
90800
90800
|
description: first["description"] || second["description"],
|
|
90801
|
-
directives: mergeDirectives(first.directives, second.directives,
|
|
90802
|
-
kind: (
|
|
90801
|
+
directives: mergeDirectives(first.directives, second.directives, config3),
|
|
90802
|
+
kind: (config3 === null || config3 === void 0 ? void 0 : config3.convertExtensions) || first.kind === "UnionTypeDefinition" || second.kind === "UnionTypeDefinition" ? import_graphql25.Kind.UNION_TYPE_DEFINITION : import_graphql25.Kind.UNION_TYPE_EXTENSION,
|
|
90803
90803
|
loc: first.loc,
|
|
90804
|
-
types: mergeNamedTypeArray(first.types, second.types,
|
|
90804
|
+
types: mergeNamedTypeArray(first.types, second.types, config3)
|
|
90805
90805
|
};
|
|
90806
90806
|
}
|
|
90807
|
-
return (
|
|
90807
|
+
return (config3 === null || config3 === void 0 ? void 0 : config3.convertExtensions) ? {
|
|
90808
90808
|
...first,
|
|
90809
90809
|
kind: import_graphql25.Kind.UNION_TYPE_DEFINITION
|
|
90810
90810
|
} : first;
|
|
@@ -90825,16 +90825,16 @@ function mergeOperationTypes(opNodeList = [], existingOpNodeList = []) {
|
|
|
90825
90825
|
}
|
|
90826
90826
|
return finalOpNodeList;
|
|
90827
90827
|
}
|
|
90828
|
-
function mergeSchemaDefs(node2, existingNode,
|
|
90828
|
+
function mergeSchemaDefs(node2, existingNode, config3) {
|
|
90829
90829
|
if (existingNode) {
|
|
90830
90830
|
return {
|
|
90831
90831
|
kind: node2.kind === import_graphql26.Kind.SCHEMA_DEFINITION || existingNode.kind === import_graphql26.Kind.SCHEMA_DEFINITION ? import_graphql26.Kind.SCHEMA_DEFINITION : import_graphql26.Kind.SCHEMA_EXTENSION,
|
|
90832
90832
|
description: node2["description"] || existingNode["description"],
|
|
90833
|
-
directives: mergeDirectives(node2.directives, existingNode.directives,
|
|
90833
|
+
directives: mergeDirectives(node2.directives, existingNode.directives, config3),
|
|
90834
90834
|
operationTypes: mergeOperationTypes(node2.operationTypes, existingNode.operationTypes)
|
|
90835
90835
|
};
|
|
90836
90836
|
}
|
|
90837
|
-
return (
|
|
90837
|
+
return (config3 === null || config3 === void 0 ? void 0 : config3.convertExtensions) ? {
|
|
90838
90838
|
...node2,
|
|
90839
90839
|
kind: import_graphql26.Kind.SCHEMA_DEFINITION
|
|
90840
90840
|
} : node2;
|
|
@@ -90843,45 +90843,45 @@ var schemaDefSymbol = "SCHEMA_DEF_SYMBOL";
|
|
|
90843
90843
|
function isNamedDefinitionNode(definitionNode) {
|
|
90844
90844
|
return "name" in definitionNode;
|
|
90845
90845
|
}
|
|
90846
|
-
function mergeGraphQLNodes(nodes,
|
|
90846
|
+
function mergeGraphQLNodes(nodes, config3) {
|
|
90847
90847
|
var _a, _b, _c;
|
|
90848
90848
|
const mergedResultMap = {};
|
|
90849
90849
|
for (const nodeDefinition of nodes) {
|
|
90850
90850
|
if (isNamedDefinitionNode(nodeDefinition)) {
|
|
90851
90851
|
const name2 = (_a = nodeDefinition.name) === null || _a === void 0 ? void 0 : _a.value;
|
|
90852
|
-
if (
|
|
90852
|
+
if (config3 === null || config3 === void 0 ? void 0 : config3.commentDescriptions) {
|
|
90853
90853
|
collectComment(nodeDefinition);
|
|
90854
90854
|
}
|
|
90855
90855
|
if (name2 == null) {
|
|
90856
90856
|
continue;
|
|
90857
90857
|
}
|
|
90858
|
-
if (((_b =
|
|
90858
|
+
if (((_b = config3 === null || config3 === void 0 ? void 0 : config3.exclusions) === null || _b === void 0 ? void 0 : _b.includes(name2 + ".*")) || ((_c = config3 === null || config3 === void 0 ? void 0 : config3.exclusions) === null || _c === void 0 ? void 0 : _c.includes(name2))) {
|
|
90859
90859
|
delete mergedResultMap[name2];
|
|
90860
90860
|
} else {
|
|
90861
90861
|
switch (nodeDefinition.kind) {
|
|
90862
90862
|
case import_graphql27.Kind.OBJECT_TYPE_DEFINITION:
|
|
90863
90863
|
case import_graphql27.Kind.OBJECT_TYPE_EXTENSION:
|
|
90864
|
-
mergedResultMap[name2] = mergeType(nodeDefinition, mergedResultMap[name2],
|
|
90864
|
+
mergedResultMap[name2] = mergeType(nodeDefinition, mergedResultMap[name2], config3);
|
|
90865
90865
|
break;
|
|
90866
90866
|
case import_graphql27.Kind.ENUM_TYPE_DEFINITION:
|
|
90867
90867
|
case import_graphql27.Kind.ENUM_TYPE_EXTENSION:
|
|
90868
|
-
mergedResultMap[name2] = mergeEnum(nodeDefinition, mergedResultMap[name2],
|
|
90868
|
+
mergedResultMap[name2] = mergeEnum(nodeDefinition, mergedResultMap[name2], config3);
|
|
90869
90869
|
break;
|
|
90870
90870
|
case import_graphql27.Kind.UNION_TYPE_DEFINITION:
|
|
90871
90871
|
case import_graphql27.Kind.UNION_TYPE_EXTENSION:
|
|
90872
|
-
mergedResultMap[name2] = mergeUnion(nodeDefinition, mergedResultMap[name2],
|
|
90872
|
+
mergedResultMap[name2] = mergeUnion(nodeDefinition, mergedResultMap[name2], config3);
|
|
90873
90873
|
break;
|
|
90874
90874
|
case import_graphql27.Kind.SCALAR_TYPE_DEFINITION:
|
|
90875
90875
|
case import_graphql27.Kind.SCALAR_TYPE_EXTENSION:
|
|
90876
|
-
mergedResultMap[name2] = mergeScalar(nodeDefinition, mergedResultMap[name2],
|
|
90876
|
+
mergedResultMap[name2] = mergeScalar(nodeDefinition, mergedResultMap[name2], config3);
|
|
90877
90877
|
break;
|
|
90878
90878
|
case import_graphql27.Kind.INPUT_OBJECT_TYPE_DEFINITION:
|
|
90879
90879
|
case import_graphql27.Kind.INPUT_OBJECT_TYPE_EXTENSION:
|
|
90880
|
-
mergedResultMap[name2] = mergeInputType(nodeDefinition, mergedResultMap[name2],
|
|
90880
|
+
mergedResultMap[name2] = mergeInputType(nodeDefinition, mergedResultMap[name2], config3);
|
|
90881
90881
|
break;
|
|
90882
90882
|
case import_graphql27.Kind.INTERFACE_TYPE_DEFINITION:
|
|
90883
90883
|
case import_graphql27.Kind.INTERFACE_TYPE_EXTENSION:
|
|
90884
|
-
mergedResultMap[name2] = mergeInterface(nodeDefinition, mergedResultMap[name2],
|
|
90884
|
+
mergedResultMap[name2] = mergeInterface(nodeDefinition, mergedResultMap[name2], config3);
|
|
90885
90885
|
break;
|
|
90886
90886
|
case import_graphql27.Kind.DIRECTIVE_DEFINITION:
|
|
90887
90887
|
mergedResultMap[name2] = mergeDirective(nodeDefinition, mergedResultMap[name2]);
|
|
@@ -90889,13 +90889,13 @@ function mergeGraphQLNodes(nodes, config2) {
|
|
|
90889
90889
|
}
|
|
90890
90890
|
}
|
|
90891
90891
|
} else if (nodeDefinition.kind === import_graphql27.Kind.SCHEMA_DEFINITION || nodeDefinition.kind === import_graphql27.Kind.SCHEMA_EXTENSION) {
|
|
90892
|
-
mergedResultMap[schemaDefSymbol] = mergeSchemaDefs(nodeDefinition, mergedResultMap[schemaDefSymbol],
|
|
90892
|
+
mergedResultMap[schemaDefSymbol] = mergeSchemaDefs(nodeDefinition, mergedResultMap[schemaDefSymbol], config3);
|
|
90893
90893
|
}
|
|
90894
90894
|
}
|
|
90895
90895
|
return mergedResultMap;
|
|
90896
90896
|
}
|
|
90897
90897
|
var import_graphql28 = __toESM2(require_graphql2(), 1);
|
|
90898
|
-
function mergeTypeDefs(typeSource,
|
|
90898
|
+
function mergeTypeDefs(typeSource, config3) {
|
|
90899
90899
|
resetComments();
|
|
90900
90900
|
const doc = {
|
|
90901
90901
|
kind: import_graphql28.Kind.DOCUMENT,
|
|
@@ -90904,11 +90904,11 @@ function mergeTypeDefs(typeSource, config2) {
|
|
|
90904
90904
|
forceSchemaDefinition: false,
|
|
90905
90905
|
throwOnConflict: false,
|
|
90906
90906
|
commentDescriptions: false,
|
|
90907
|
-
...
|
|
90907
|
+
...config3
|
|
90908
90908
|
})
|
|
90909
90909
|
};
|
|
90910
90910
|
let result;
|
|
90911
|
-
if (
|
|
90911
|
+
if (config3 === null || config3 === void 0 ? void 0 : config3.commentDescriptions) {
|
|
90912
90912
|
result = printWithComments(doc);
|
|
90913
90913
|
} else {
|
|
90914
90914
|
result = doc;
|
|
@@ -90941,12 +90941,12 @@ function visitTypeSources(typeSource, options, allNodes = [], visitedTypeSources
|
|
|
90941
90941
|
}
|
|
90942
90942
|
return allNodes;
|
|
90943
90943
|
}
|
|
90944
|
-
function mergeGraphQLTypes(typeSource,
|
|
90944
|
+
function mergeGraphQLTypes(typeSource, config3) {
|
|
90945
90945
|
var _a, _b, _c;
|
|
90946
90946
|
resetComments();
|
|
90947
|
-
const allNodes = visitTypeSources(typeSource,
|
|
90948
|
-
const mergedNodes = mergeGraphQLNodes(allNodes,
|
|
90949
|
-
if (
|
|
90947
|
+
const allNodes = visitTypeSources(typeSource, config3);
|
|
90948
|
+
const mergedNodes = mergeGraphQLNodes(allNodes, config3);
|
|
90949
|
+
if (config3 === null || config3 === void 0 ? void 0 : config3.useSchemaDefinition) {
|
|
90950
90950
|
const schemaDef = mergedNodes[schemaDefSymbol] || {
|
|
90951
90951
|
kind: import_graphql28.Kind.SCHEMA_DEFINITION,
|
|
90952
90952
|
operationTypes: []
|
|
@@ -90973,7 +90973,7 @@ function mergeGraphQLTypes(typeSource, config2) {
|
|
|
90973
90973
|
mergedNodes[schemaDefSymbol] = schemaDef;
|
|
90974
90974
|
}
|
|
90975
90975
|
}
|
|
90976
|
-
if ((
|
|
90976
|
+
if ((config3 === null || config3 === void 0 ? void 0 : config3.forceSchemaDefinition) && !((_c = (_b = mergedNodes[schemaDefSymbol]) === null || _b === void 0 ? void 0 : _b.operationTypes) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
90977
90977
|
mergedNodes[schemaDefSymbol] = {
|
|
90978
90978
|
kind: import_graphql28.Kind.SCHEMA_DEFINITION,
|
|
90979
90979
|
operationTypes: [
|
|
@@ -90992,8 +90992,8 @@ function mergeGraphQLTypes(typeSource, config2) {
|
|
|
90992
90992
|
};
|
|
90993
90993
|
}
|
|
90994
90994
|
const mergedNodeDefinitions = Object.values(mergedNodes);
|
|
90995
|
-
if (
|
|
90996
|
-
const sortFn = typeof
|
|
90995
|
+
if (config3 === null || config3 === void 0 ? void 0 : config3.sort) {
|
|
90996
|
+
const sortFn = typeof config3.sort === "function" ? config3.sort : defaultStringComparator;
|
|
90997
90997
|
mergedNodeDefinitions.sort((a, b) => {
|
|
90998
90998
|
var _a2, _b2;
|
|
90999
90999
|
return sortFn((_a2 = a.name) === null || _a2 === void 0 ? void 0 : _a2.value, (_b2 = b.name) === null || _b2 === void 0 ? void 0 : _b2.value);
|
|
@@ -91077,30 +91077,30 @@ function makeExecutableSchema({ typeDefs, resolvers = {}, resolverValidationOpti
|
|
|
91077
91077
|
}
|
|
91078
91078
|
return schema;
|
|
91079
91079
|
}
|
|
91080
|
-
function mergeSchemas(
|
|
91080
|
+
function mergeSchemas(config3) {
|
|
91081
91081
|
const extractedTypeDefs = [];
|
|
91082
91082
|
const extractedResolvers = [];
|
|
91083
91083
|
const extractedSchemaExtensions = [];
|
|
91084
|
-
if (
|
|
91085
|
-
for (const schema of
|
|
91084
|
+
if (config3.schemas != null) {
|
|
91085
|
+
for (const schema of config3.schemas) {
|
|
91086
91086
|
extractedTypeDefs.push(schema);
|
|
91087
91087
|
extractedResolvers.push(getResolversFromSchema(schema));
|
|
91088
91088
|
extractedSchemaExtensions.push(extractExtensionsFromSchema(schema));
|
|
91089
91089
|
}
|
|
91090
91090
|
}
|
|
91091
|
-
if (
|
|
91092
|
-
extractedTypeDefs.push(
|
|
91091
|
+
if (config3.typeDefs != null) {
|
|
91092
|
+
extractedTypeDefs.push(config3.typeDefs);
|
|
91093
91093
|
}
|
|
91094
|
-
if (
|
|
91095
|
-
const additionalResolvers = asArray(
|
|
91094
|
+
if (config3.resolvers != null) {
|
|
91095
|
+
const additionalResolvers = asArray(config3.resolvers);
|
|
91096
91096
|
extractedResolvers.push(...additionalResolvers);
|
|
91097
91097
|
}
|
|
91098
|
-
if (
|
|
91099
|
-
const additionalSchemaExtensions = asArray(
|
|
91098
|
+
if (config3.schemaExtensions != null) {
|
|
91099
|
+
const additionalSchemaExtensions = asArray(config3.schemaExtensions);
|
|
91100
91100
|
extractedSchemaExtensions.push(...additionalSchemaExtensions);
|
|
91101
91101
|
}
|
|
91102
91102
|
return makeExecutableSchema({
|
|
91103
|
-
...
|
|
91103
|
+
...config3,
|
|
91104
91104
|
typeDefs: extractedTypeDefs,
|
|
91105
91105
|
resolvers: extractedResolvers,
|
|
91106
91106
|
schemaExtensions: extractedSchemaExtensions
|
|
@@ -91162,6 +91162,18 @@ function deepEquals(objA, objB, map = /* @__PURE__ */ new WeakMap()) {
|
|
|
91162
91162
|
}
|
|
91163
91163
|
return true;
|
|
91164
91164
|
}
|
|
91165
|
+
function getFieldsForType(selection, __typename) {
|
|
91166
|
+
let targetSelection = selection.fields || {};
|
|
91167
|
+
if (selection.abstractFields && __typename) {
|
|
91168
|
+
const mappedType = selection.abstractFields.typeMap[__typename];
|
|
91169
|
+
if (mappedType) {
|
|
91170
|
+
targetSelection = selection.abstractFields.fields[mappedType];
|
|
91171
|
+
} else if (selection.abstractFields.fields[__typename]) {
|
|
91172
|
+
targetSelection = selection.abstractFields.fields[__typename];
|
|
91173
|
+
}
|
|
91174
|
+
}
|
|
91175
|
+
return targetSelection;
|
|
91176
|
+
}
|
|
91165
91177
|
var GarbageCollector = class {
|
|
91166
91178
|
cache;
|
|
91167
91179
|
lifetimes = /* @__PURE__ */ new Map();
|
|
@@ -91379,23 +91391,32 @@ var List = class {
|
|
|
91379
91391
|
let insertData = data2;
|
|
91380
91392
|
if (this.connection) {
|
|
91381
91393
|
insertSelection = {
|
|
91382
|
-
|
|
91383
|
-
|
|
91384
|
-
|
|
91385
|
-
|
|
91386
|
-
|
|
91387
|
-
keyRaw: "edges",
|
|
91388
|
-
type: "ConnectionEdge",
|
|
91389
|
-
update: where === "first" ? "prepend" : "append",
|
|
91394
|
+
fields: {
|
|
91395
|
+
newEntry: {
|
|
91396
|
+
keyRaw: this.key,
|
|
91397
|
+
type: "Connection",
|
|
91398
|
+
selection: {
|
|
91390
91399
|
fields: {
|
|
91391
|
-
|
|
91392
|
-
|
|
91393
|
-
|
|
91394
|
-
|
|
91395
|
-
|
|
91396
|
-
|
|
91397
|
-
|
|
91398
|
-
|
|
91400
|
+
edges: {
|
|
91401
|
+
keyRaw: "edges",
|
|
91402
|
+
type: "ConnectionEdge",
|
|
91403
|
+
update: where === "first" ? "prepend" : "append",
|
|
91404
|
+
selection: {
|
|
91405
|
+
fields: {
|
|
91406
|
+
node: {
|
|
91407
|
+
type: listType,
|
|
91408
|
+
keyRaw: "node",
|
|
91409
|
+
selection: {
|
|
91410
|
+
...selection,
|
|
91411
|
+
fields: {
|
|
91412
|
+
...selection.fields,
|
|
91413
|
+
__typename: {
|
|
91414
|
+
keyRaw: "__typename",
|
|
91415
|
+
type: "String"
|
|
91416
|
+
}
|
|
91417
|
+
}
|
|
91418
|
+
}
|
|
91419
|
+
}
|
|
91399
91420
|
}
|
|
91400
91421
|
}
|
|
91401
91422
|
}
|
|
@@ -91411,15 +91432,20 @@ var List = class {
|
|
|
91411
91432
|
};
|
|
91412
91433
|
} else {
|
|
91413
91434
|
insertSelection = {
|
|
91414
|
-
|
|
91415
|
-
|
|
91416
|
-
|
|
91417
|
-
|
|
91418
|
-
|
|
91419
|
-
|
|
91420
|
-
|
|
91421
|
-
|
|
91422
|
-
|
|
91435
|
+
fields: {
|
|
91436
|
+
newEntries: {
|
|
91437
|
+
keyRaw: this.key,
|
|
91438
|
+
type: listType,
|
|
91439
|
+
update: where === "first" ? "prepend" : "append",
|
|
91440
|
+
selection: {
|
|
91441
|
+
...selection,
|
|
91442
|
+
fields: {
|
|
91443
|
+
...selection.fields,
|
|
91444
|
+
__typename: {
|
|
91445
|
+
keyRaw: "__typename",
|
|
91446
|
+
type: "String"
|
|
91447
|
+
}
|
|
91448
|
+
}
|
|
91423
91449
|
}
|
|
91424
91450
|
}
|
|
91425
91451
|
}
|
|
@@ -91479,7 +91505,7 @@ var List = class {
|
|
|
91479
91505
|
const subscribers = this.cache._internal_unstable.subscriptions.get(this.recordID, this.key);
|
|
91480
91506
|
this.cache._internal_unstable.subscriptions.remove(
|
|
91481
91507
|
targetID,
|
|
91482
|
-
this.connection ? this.selection.edges.
|
|
91508
|
+
this.connection ? this.selection.fields.edges.selection : this.selection,
|
|
91483
91509
|
subscribers,
|
|
91484
91510
|
variables
|
|
91485
91511
|
);
|
|
@@ -91964,18 +91990,20 @@ var InMemorySubscriptions = class {
|
|
|
91964
91990
|
variables,
|
|
91965
91991
|
parentType
|
|
91966
91992
|
}) {
|
|
91967
|
-
|
|
91968
|
-
|
|
91993
|
+
const __typename = this.cache._internal_unstable.storage.get(parent, "__typename").value;
|
|
91994
|
+
let targetSelection = getFieldsForType(selection, __typename);
|
|
91995
|
+
for (const fieldSelection of Object.values(targetSelection || {})) {
|
|
91996
|
+
const { keyRaw, selection: innerSelection, type } = fieldSelection;
|
|
91969
91997
|
const key = evaluateKey(keyRaw, variables);
|
|
91970
91998
|
this.addFieldSubscription({
|
|
91971
91999
|
id: parent,
|
|
91972
92000
|
key,
|
|
91973
|
-
|
|
92001
|
+
field: fieldSelection,
|
|
91974
92002
|
spec,
|
|
91975
92003
|
parentType: parentType || spec.rootType,
|
|
91976
92004
|
variables
|
|
91977
92005
|
});
|
|
91978
|
-
if (
|
|
92006
|
+
if (innerSelection) {
|
|
91979
92007
|
const { value: linkedRecord } = this.cache._internal_unstable.storage.get(
|
|
91980
92008
|
parent,
|
|
91981
92009
|
key
|
|
@@ -91988,7 +92016,7 @@ var InMemorySubscriptions = class {
|
|
|
91988
92016
|
this.add({
|
|
91989
92017
|
parent: child,
|
|
91990
92018
|
spec,
|
|
91991
|
-
selection:
|
|
92019
|
+
selection: innerSelection,
|
|
91992
92020
|
variables,
|
|
91993
92021
|
parentType: type
|
|
91994
92022
|
});
|
|
@@ -91999,7 +92027,7 @@ var InMemorySubscriptions = class {
|
|
|
91999
92027
|
addFieldSubscription({
|
|
92000
92028
|
id: id2,
|
|
92001
92029
|
key,
|
|
92002
|
-
|
|
92030
|
+
field,
|
|
92003
92031
|
spec,
|
|
92004
92032
|
parentType,
|
|
92005
92033
|
variables
|
|
@@ -92026,8 +92054,8 @@ var InMemorySubscriptions = class {
|
|
|
92026
92054
|
const counts = this.referenceCounts[id2][key];
|
|
92027
92055
|
counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
|
|
92028
92056
|
this.cache._internal_unstable.lifetimes.resetLifetime(id2, key);
|
|
92029
|
-
const {
|
|
92030
|
-
if (
|
|
92057
|
+
const { selection, list, filters } = field;
|
|
92058
|
+
if (selection && list) {
|
|
92031
92059
|
this.cache._internal_unstable.lists.add({
|
|
92032
92060
|
name: list.name,
|
|
92033
92061
|
connection: list.connection,
|
|
@@ -92035,7 +92063,7 @@ var InMemorySubscriptions = class {
|
|
|
92035
92063
|
recordType: this.cache._internal_unstable.storage.get(id2, "__typename")?.value || parentType,
|
|
92036
92064
|
listType: list.type,
|
|
92037
92065
|
key,
|
|
92038
|
-
selection
|
|
92066
|
+
selection,
|
|
92039
92067
|
filters: Object.entries(filters || {}).reduce((acc, [key2, { kind, value: value2 }]) => {
|
|
92040
92068
|
return {
|
|
92041
92069
|
...acc,
|
|
@@ -92052,20 +92080,21 @@ var InMemorySubscriptions = class {
|
|
|
92052
92080
|
subscribers,
|
|
92053
92081
|
parentType
|
|
92054
92082
|
}) {
|
|
92055
|
-
|
|
92056
|
-
|
|
92083
|
+
let targetSelection = getFieldsForType(selection, parentType);
|
|
92084
|
+
for (const fieldSelection of Object.values(targetSelection)) {
|
|
92085
|
+
const { type: linkedType, keyRaw, selection: innerSelection } = fieldSelection;
|
|
92057
92086
|
const key = evaluateKey(keyRaw, variables);
|
|
92058
92087
|
for (const spec of subscribers) {
|
|
92059
92088
|
this.addFieldSubscription({
|
|
92060
92089
|
id: parent,
|
|
92061
92090
|
key,
|
|
92062
|
-
|
|
92091
|
+
field: fieldSelection,
|
|
92063
92092
|
spec,
|
|
92064
92093
|
parentType,
|
|
92065
92094
|
variables
|
|
92066
92095
|
});
|
|
92067
92096
|
}
|
|
92068
|
-
if (
|
|
92097
|
+
if (innerSelection) {
|
|
92069
92098
|
const { value: link } = this.cache._internal_unstable.storage.get(parent, key);
|
|
92070
92099
|
const children = !Array.isArray(link) ? [link] : flattenList(link);
|
|
92071
92100
|
for (const linkedRecord of children) {
|
|
@@ -92074,7 +92103,7 @@ var InMemorySubscriptions = class {
|
|
|
92074
92103
|
}
|
|
92075
92104
|
this.addMany({
|
|
92076
92105
|
parent: linkedRecord,
|
|
92077
|
-
selection:
|
|
92106
|
+
selection: innerSelection,
|
|
92078
92107
|
variables,
|
|
92079
92108
|
subscribers,
|
|
92080
92109
|
parentType: linkedType
|
|
@@ -92086,22 +92115,20 @@ var InMemorySubscriptions = class {
|
|
|
92086
92115
|
get(id2, field) {
|
|
92087
92116
|
return this.subscribers[id2]?.[field] || [];
|
|
92088
92117
|
}
|
|
92089
|
-
remove(id2,
|
|
92118
|
+
remove(id2, selection, targets, variables, visited = []) {
|
|
92090
92119
|
visited.push(id2);
|
|
92091
92120
|
const linkedIDs = [];
|
|
92092
|
-
for (const
|
|
92093
|
-
const key = evaluateKey(
|
|
92121
|
+
for (const fieldSelection of Object.values(selection.fields || {})) {
|
|
92122
|
+
const key = evaluateKey(fieldSelection.keyRaw, variables);
|
|
92094
92123
|
this.removeSubscribers(id2, key, targets);
|
|
92095
|
-
if (!selection
|
|
92124
|
+
if (!fieldSelection.selection?.fields) {
|
|
92096
92125
|
continue;
|
|
92097
92126
|
}
|
|
92098
|
-
if (selection.list) {
|
|
92099
|
-
}
|
|
92100
92127
|
const { value: previousValue } = this.cache._internal_unstable.storage.get(id2, key);
|
|
92101
92128
|
const links = !Array.isArray(previousValue) ? [previousValue] : flattenList(previousValue);
|
|
92102
92129
|
for (const link of links) {
|
|
92103
92130
|
if (link !== null) {
|
|
92104
|
-
linkedIDs.push([link, selection
|
|
92131
|
+
linkedIDs.push([link, fieldSelection.selection || {}]);
|
|
92105
92132
|
}
|
|
92106
92133
|
}
|
|
92107
92134
|
}
|
|
@@ -92150,7 +92177,7 @@ var InMemorySubscriptions = class {
|
|
|
92150
92177
|
};
|
|
92151
92178
|
var Cache2 = class {
|
|
92152
92179
|
_internal_unstable;
|
|
92153
|
-
constructor(
|
|
92180
|
+
constructor(config3) {
|
|
92154
92181
|
this._internal_unstable = new CacheInternal({
|
|
92155
92182
|
cache: this,
|
|
92156
92183
|
storage: new InMemoryStorage(),
|
|
@@ -92158,8 +92185,8 @@ var Cache2 = class {
|
|
|
92158
92185
|
lists: new ListManager(this, rootID),
|
|
92159
92186
|
lifetimes: new GarbageCollector(this)
|
|
92160
92187
|
});
|
|
92161
|
-
if (
|
|
92162
|
-
this.setConfig(defaultConfigValues(
|
|
92188
|
+
if (config3) {
|
|
92189
|
+
this.setConfig(defaultConfigValues(config3));
|
|
92163
92190
|
}
|
|
92164
92191
|
}
|
|
92165
92192
|
write({
|
|
@@ -92224,8 +92251,8 @@ var Cache2 = class {
|
|
|
92224
92251
|
this._internal_unstable.lists.removeIDFromAllLists(id2);
|
|
92225
92252
|
this._internal_unstable.storage.delete(id2);
|
|
92226
92253
|
}
|
|
92227
|
-
setConfig(
|
|
92228
|
-
this._internal_unstable.setConfig(
|
|
92254
|
+
setConfig(config3) {
|
|
92255
|
+
this._internal_unstable.setConfig(config3);
|
|
92229
92256
|
}
|
|
92230
92257
|
};
|
|
92231
92258
|
var CacheInternal = class {
|
|
@@ -92260,8 +92287,8 @@ var CacheInternal = class {
|
|
|
92260
92287
|
this._disabled = typeof globalThis.window === "undefined";
|
|
92261
92288
|
}
|
|
92262
92289
|
}
|
|
92263
|
-
setConfig(
|
|
92264
|
-
this.config =
|
|
92290
|
+
setConfig(config3) {
|
|
92291
|
+
this.config = config3;
|
|
92265
92292
|
}
|
|
92266
92293
|
writeSelection({
|
|
92267
92294
|
data: data2,
|
|
@@ -92277,8 +92304,9 @@ var CacheInternal = class {
|
|
|
92277
92304
|
if (this._disabled) {
|
|
92278
92305
|
return [];
|
|
92279
92306
|
}
|
|
92307
|
+
let targetSelection = getFieldsForType(selection, data2["__typename"]);
|
|
92280
92308
|
for (const [field, value2] of Object.entries(data2)) {
|
|
92281
|
-
if (!selection || !
|
|
92309
|
+
if (!selection || !targetSelection[field]) {
|
|
92282
92310
|
throw new Error(
|
|
92283
92311
|
"Could not find field listing in selection for " + field + " @ " + JSON.stringify(selection)
|
|
92284
92312
|
);
|
|
@@ -92286,11 +92314,11 @@ var CacheInternal = class {
|
|
|
92286
92314
|
let {
|
|
92287
92315
|
type: linkedType,
|
|
92288
92316
|
keyRaw,
|
|
92289
|
-
|
|
92317
|
+
selection: fieldSelection,
|
|
92290
92318
|
operations,
|
|
92291
92319
|
abstract: isAbstract,
|
|
92292
92320
|
update
|
|
92293
|
-
} =
|
|
92321
|
+
} = targetSelection[field];
|
|
92294
92322
|
const key = evaluateKey(keyRaw, variables);
|
|
92295
92323
|
const currentSubscribers = this.subscriptions.get(parent, key);
|
|
92296
92324
|
const { value: previousValue, displayLayers } = this.storage.get(parent, key);
|
|
@@ -92298,7 +92326,7 @@ var CacheInternal = class {
|
|
|
92298
92326
|
if (displayLayer) {
|
|
92299
92327
|
this.lifetimes.resetLifetime(parent, key);
|
|
92300
92328
|
}
|
|
92301
|
-
if (!
|
|
92329
|
+
if (!fieldSelection) {
|
|
92302
92330
|
let newValue = value2;
|
|
92303
92331
|
if (Array.isArray(value2) && applyUpdates && update) {
|
|
92304
92332
|
if (update === "append") {
|
|
@@ -92318,7 +92346,7 @@ var CacheInternal = class {
|
|
|
92318
92346
|
}
|
|
92319
92347
|
const previousLinks = flattenList([previousValue]);
|
|
92320
92348
|
for (const link of previousLinks) {
|
|
92321
|
-
this.subscriptions.remove(link,
|
|
92349
|
+
this.subscriptions.remove(link, fieldSelection, currentSubscribers, variables);
|
|
92322
92350
|
}
|
|
92323
92351
|
layer.writeLink(parent, key, null);
|
|
92324
92352
|
toNotify.push(...currentSubscribers);
|
|
@@ -92344,14 +92372,14 @@ var CacheInternal = class {
|
|
|
92344
92372
|
if (previousValue && typeof previousValue === "string") {
|
|
92345
92373
|
this.subscriptions.remove(
|
|
92346
92374
|
previousValue,
|
|
92347
|
-
|
|
92375
|
+
fieldSelection,
|
|
92348
92376
|
currentSubscribers,
|
|
92349
92377
|
variables
|
|
92350
92378
|
);
|
|
92351
92379
|
}
|
|
92352
92380
|
this.subscriptions.addMany({
|
|
92353
92381
|
parent: linkedID,
|
|
92354
|
-
selection:
|
|
92382
|
+
selection: fieldSelection,
|
|
92355
92383
|
subscribers: currentSubscribers,
|
|
92356
92384
|
variables,
|
|
92357
92385
|
parentType: linkedType
|
|
@@ -92361,14 +92389,14 @@ var CacheInternal = class {
|
|
|
92361
92389
|
if (linkedID) {
|
|
92362
92390
|
this.writeSelection({
|
|
92363
92391
|
root,
|
|
92364
|
-
selection:
|
|
92392
|
+
selection: fieldSelection,
|
|
92365
92393
|
parent: linkedID,
|
|
92366
92394
|
data: value2,
|
|
92367
92395
|
variables,
|
|
92368
92396
|
toNotify,
|
|
92369
92397
|
applyUpdates,
|
|
92370
92398
|
layer,
|
|
92371
|
-
forceNotify
|
|
92399
|
+
forceNotify
|
|
92372
92400
|
});
|
|
92373
92401
|
}
|
|
92374
92402
|
} else if (Array.isArray(value2) && (typeof previousValue === "undefined" || Array.isArray(previousValue))) {
|
|
@@ -92397,7 +92425,7 @@ var CacheInternal = class {
|
|
|
92397
92425
|
key,
|
|
92398
92426
|
linkedType,
|
|
92399
92427
|
variables,
|
|
92400
|
-
fields,
|
|
92428
|
+
fields: fieldSelection,
|
|
92401
92429
|
layer,
|
|
92402
92430
|
forceNotify
|
|
92403
92431
|
});
|
|
@@ -92447,7 +92475,7 @@ var CacheInternal = class {
|
|
|
92447
92475
|
if (linkedIDs.includes(lostID) || !lostID) {
|
|
92448
92476
|
continue;
|
|
92449
92477
|
}
|
|
92450
|
-
this.subscriptions.remove(lostID,
|
|
92478
|
+
this.subscriptions.remove(lostID, fieldSelection, currentSubscribers, variables);
|
|
92451
92479
|
}
|
|
92452
92480
|
if (contentChanged || oldIDs.length === 0 && newIDs.length === 0) {
|
|
92453
92481
|
layer.writeLink(parent, key, linkedIDs);
|
|
@@ -92458,7 +92486,7 @@ var CacheInternal = class {
|
|
|
92458
92486
|
}
|
|
92459
92487
|
this.subscriptions.addMany({
|
|
92460
92488
|
parent: id2,
|
|
92461
|
-
selection:
|
|
92489
|
+
selection: fieldSelection,
|
|
92462
92490
|
subscribers: currentSubscribers,
|
|
92463
92491
|
variables,
|
|
92464
92492
|
parentType: linkedType
|
|
@@ -92483,9 +92511,14 @@ var CacheInternal = class {
|
|
|
92483
92511
|
}
|
|
92484
92512
|
const targets = Array.isArray(value2) ? value2 : [value2];
|
|
92485
92513
|
for (const target of targets) {
|
|
92486
|
-
if (operation.action === "insert" && target instanceof Object &&
|
|
92487
|
-
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(
|
|
92488
|
-
|
|
92514
|
+
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
92515
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(
|
|
92516
|
+
fieldSelection,
|
|
92517
|
+
target,
|
|
92518
|
+
variables,
|
|
92519
|
+
operation.position || "last"
|
|
92520
|
+
);
|
|
92521
|
+
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
92489
92522
|
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
|
|
92490
92523
|
} else if (operation.action === "delete" && operation.type) {
|
|
92491
92524
|
if (typeof target !== "string") {
|
|
@@ -92496,8 +92529,13 @@ var CacheInternal = class {
|
|
|
92496
92529
|
continue;
|
|
92497
92530
|
}
|
|
92498
92531
|
this.cache.delete(targetID);
|
|
92499
|
-
} else if (operation.action === "toggle" && target instanceof Object &&
|
|
92500
|
-
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(
|
|
92532
|
+
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
92533
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(
|
|
92534
|
+
fieldSelection,
|
|
92535
|
+
target,
|
|
92536
|
+
variables,
|
|
92537
|
+
operation.position || "last"
|
|
92538
|
+
);
|
|
92501
92539
|
}
|
|
92502
92540
|
}
|
|
92503
92541
|
}
|
|
@@ -92517,9 +92555,12 @@ var CacheInternal = class {
|
|
|
92517
92555
|
let hasData = false;
|
|
92518
92556
|
let partial = false;
|
|
92519
92557
|
let cascadeNull = false;
|
|
92520
|
-
|
|
92521
|
-
|
|
92522
|
-
|
|
92558
|
+
const typename = this.storage.get(parent, "__typename").value;
|
|
92559
|
+
let targetSelection = getFieldsForType(selection, typename);
|
|
92560
|
+
for (const [
|
|
92561
|
+
attributeName,
|
|
92562
|
+
{ type, keyRaw, selection: fieldSelection, nullable, list }
|
|
92563
|
+
] of Object.entries(targetSelection)) {
|
|
92523
92564
|
const key = evaluateKey(keyRaw, variables);
|
|
92524
92565
|
const { value: value2 } = this.storage.get(parent, key);
|
|
92525
92566
|
let nextStep = stepsFromConnection;
|
|
@@ -92542,7 +92583,7 @@ var CacheInternal = class {
|
|
|
92542
92583
|
if (typeof value2 !== "undefined") {
|
|
92543
92584
|
hasData = true;
|
|
92544
92585
|
}
|
|
92545
|
-
} else if (!
|
|
92586
|
+
} else if (!fieldSelection) {
|
|
92546
92587
|
const fnUnmarshal = this.config?.scalars?.[type]?.unmarshal;
|
|
92547
92588
|
if (fnUnmarshal) {
|
|
92548
92589
|
target[attributeName] = fnUnmarshal(value2);
|
|
@@ -92552,7 +92593,7 @@ var CacheInternal = class {
|
|
|
92552
92593
|
hasData = true;
|
|
92553
92594
|
} else if (Array.isArray(value2)) {
|
|
92554
92595
|
const listValue = this.hydrateNestedList({
|
|
92555
|
-
fields,
|
|
92596
|
+
fields: fieldSelection,
|
|
92556
92597
|
variables,
|
|
92557
92598
|
linkedList: value2,
|
|
92558
92599
|
stepsFromConnection: nextStep
|
|
@@ -92567,7 +92608,7 @@ var CacheInternal = class {
|
|
|
92567
92608
|
} else {
|
|
92568
92609
|
const objectFields = this.getSelection({
|
|
92569
92610
|
parent: value2,
|
|
92570
|
-
selection:
|
|
92611
|
+
selection: fieldSelection,
|
|
92571
92612
|
variables,
|
|
92572
92613
|
stepsFromConnection: nextStep
|
|
92573
92614
|
});
|
|
@@ -94230,7 +94271,7 @@ var Config = class {
|
|
|
94230
94271
|
typeConfig;
|
|
94231
94272
|
configFile;
|
|
94232
94273
|
logLevel;
|
|
94233
|
-
|
|
94274
|
+
defaultFragmentMasking = "enable";
|
|
94234
94275
|
configIsRoute = null;
|
|
94235
94276
|
routesDir;
|
|
94236
94277
|
schemaPollInterval;
|
|
@@ -94243,6 +94284,11 @@ var Config = class {
|
|
|
94243
94284
|
...configFile
|
|
94244
94285
|
}) {
|
|
94245
94286
|
this.configFile = defaultConfigValues(configFile);
|
|
94287
|
+
if (configFile.disableMasking !== void 0) {
|
|
94288
|
+
throw new HoudiniError({
|
|
94289
|
+
message: `"disableMasking" was replaced by "defaultFragmentMasking". Please update your config file.`
|
|
94290
|
+
});
|
|
94291
|
+
}
|
|
94246
94292
|
let {
|
|
94247
94293
|
schema,
|
|
94248
94294
|
schemaPath = "./schema.graphql",
|
|
@@ -94259,7 +94305,7 @@ var Config = class {
|
|
|
94259
94305
|
defaultKeys,
|
|
94260
94306
|
types: types42 = {},
|
|
94261
94307
|
logLevel,
|
|
94262
|
-
|
|
94308
|
+
defaultFragmentMasking = "enable",
|
|
94263
94309
|
schemaPollInterval = 2e3,
|
|
94264
94310
|
schemaPollHeaders = {},
|
|
94265
94311
|
projectDir
|
|
@@ -94278,7 +94324,11 @@ var Config = class {
|
|
|
94278
94324
|
logLevel = LogLevel.Summary;
|
|
94279
94325
|
}
|
|
94280
94326
|
this.schemaPath = schemaPath;
|
|
94281
|
-
|
|
94327
|
+
if (apiUrl && apiUrl.startsWith("env:")) {
|
|
94328
|
+
this.apiUrl = process.env[apiUrl.slice("env:".length)];
|
|
94329
|
+
} else {
|
|
94330
|
+
this.apiUrl = apiUrl;
|
|
94331
|
+
}
|
|
94282
94332
|
this.filepath = filepath;
|
|
94283
94333
|
this.exclude = Array.isArray(exclude) ? exclude : [exclude];
|
|
94284
94334
|
this.module = module2;
|
|
@@ -94290,10 +94340,10 @@ var Config = class {
|
|
|
94290
94340
|
this.defaultCachePolicy = defaultCachePolicy;
|
|
94291
94341
|
this.defaultPartial = defaultPartial;
|
|
94292
94342
|
this.internalListPosition = defaultListPosition === "append" ? "last" : "first";
|
|
94293
|
-
this.defaultListTarget
|
|
94343
|
+
this.defaultListTarget = defaultListTarget;
|
|
94294
94344
|
this.definitionsFolder = definitionsPath;
|
|
94295
94345
|
this.logLevel = (logLevel || LogLevel.Summary).toLowerCase();
|
|
94296
|
-
this.
|
|
94346
|
+
this.defaultFragmentMasking = defaultFragmentMasking;
|
|
94297
94347
|
this.routesDir = join2(this.projectRoot, "src", "routes");
|
|
94298
94348
|
this.schemaPollInterval = schemaPollInterval;
|
|
94299
94349
|
this.schemaPollHeaders = schemaPollHeaders;
|
|
@@ -94487,8 +94537,14 @@ var Config = class {
|
|
|
94487
94537
|
pluginDirectory(name2) {
|
|
94488
94538
|
return houdini_mode.is_testing ? resolve("../../../", name2) : join2(this.rootDir, "plugins", name2);
|
|
94489
94539
|
}
|
|
94490
|
-
get
|
|
94491
|
-
return "
|
|
94540
|
+
get manualLoadDirective() {
|
|
94541
|
+
return "manual_load";
|
|
94542
|
+
}
|
|
94543
|
+
get maskEnableDirective() {
|
|
94544
|
+
return "mask_enable";
|
|
94545
|
+
}
|
|
94546
|
+
get maskDisableDirective() {
|
|
94547
|
+
return "mask_disable";
|
|
94492
94548
|
}
|
|
94493
94549
|
get listDirective() {
|
|
94494
94550
|
return "list";
|
|
@@ -94500,9 +94556,9 @@ var Config = class {
|
|
|
94500
94556
|
return "append";
|
|
94501
94557
|
}
|
|
94502
94558
|
get listParentDirective() {
|
|
94503
|
-
return
|
|
94559
|
+
return "parentID";
|
|
94504
94560
|
}
|
|
94505
|
-
get
|
|
94561
|
+
get deprecatedlistDirectiveParentIDArg() {
|
|
94506
94562
|
return "parentID";
|
|
94507
94563
|
}
|
|
94508
94564
|
get listAllListsDirective() {
|
|
@@ -94588,7 +94644,7 @@ var Config = class {
|
|
|
94588
94644
|
this.listDirective,
|
|
94589
94645
|
this.listPrependDirective,
|
|
94590
94646
|
this.listAppendDirective,
|
|
94591
|
-
this.
|
|
94647
|
+
this.listParentDirective,
|
|
94592
94648
|
this.listAllListsDirective,
|
|
94593
94649
|
this.whenDirective,
|
|
94594
94650
|
this.whenNotDirective,
|
|
@@ -94596,7 +94652,9 @@ var Config = class {
|
|
|
94596
94652
|
this.withDirective,
|
|
94597
94653
|
this.paginateDirective,
|
|
94598
94654
|
this.cacheDirective,
|
|
94599
|
-
this.
|
|
94655
|
+
this.manualLoadDirective,
|
|
94656
|
+
this.maskEnableDirective,
|
|
94657
|
+
this.maskDisableDirective
|
|
94600
94658
|
].includes(name2.value) || this.isDeleteDirective(name2.value);
|
|
94601
94659
|
}
|
|
94602
94660
|
isListFragment(name2) {
|
|
@@ -94664,8 +94722,8 @@ async function readConfigFile(configPath = DEFAULT_CONFIG_PATH) {
|
|
|
94664
94722
|
throw new Error(`Could not load config file at file://${configPath}.
|
|
94665
94723
|
${e22.message}`);
|
|
94666
94724
|
}
|
|
94667
|
-
const
|
|
94668
|
-
return
|
|
94725
|
+
const config3 = imported.default || imported;
|
|
94726
|
+
return config3;
|
|
94669
94727
|
}
|
|
94670
94728
|
var _config;
|
|
94671
94729
|
async function loadSchemaFile(schemaPath) {
|
|
@@ -94945,7 +95003,7 @@ async function asyncWalk(ast, { enter, leave }) {
|
|
|
94945
95003
|
return await instance.visit(ast, null);
|
|
94946
95004
|
}
|
|
94947
95005
|
var graphql4 = __toESM2(require_graphql2(), 1);
|
|
94948
|
-
async function find_graphql(
|
|
95006
|
+
async function find_graphql(config3, parsedScript, walker) {
|
|
94949
95007
|
await asyncWalk(parsedScript, {
|
|
94950
95008
|
async enter(node2, parent) {
|
|
94951
95009
|
if (node2.type === "TaggedTemplateExpression" && node2.tag.name === "graphql") {
|
|
@@ -94955,7 +95013,7 @@ async function find_graphql(config2, parsedScript, walker) {
|
|
|
94955
95013
|
if (walker.where && !walker.where(parsedTag)) {
|
|
94956
95014
|
return;
|
|
94957
95015
|
}
|
|
94958
|
-
const definition =
|
|
95016
|
+
const definition = config3.extractDefinition(parsedTag);
|
|
94959
95017
|
const name2 = definition.name?.value;
|
|
94960
95018
|
if (!name2) {
|
|
94961
95019
|
throw new Error("Could not find definition name");
|
|
@@ -94972,7 +95030,7 @@ async function find_graphql(config2, parsedScript, walker) {
|
|
|
94972
95030
|
kind = CompiledSubscriptionKind;
|
|
94973
95031
|
}
|
|
94974
95032
|
}
|
|
94975
|
-
walker.dependency?.(
|
|
95033
|
+
walker.dependency?.(config3.artifactPath(parsedTag));
|
|
94976
95034
|
await walker.tag({
|
|
94977
95035
|
parsedDocument: parsedTag,
|
|
94978
95036
|
node: {
|
|
@@ -103114,54 +103172,54 @@ function createParseContext(name2) {
|
|
|
103114
103172
|
return this[name2]();
|
|
103115
103173
|
};
|
|
103116
103174
|
}
|
|
103117
|
-
function processConfig(
|
|
103175
|
+
function processConfig(config3) {
|
|
103118
103176
|
var parserConfig = {
|
|
103119
103177
|
context: {},
|
|
103120
103178
|
scope: {},
|
|
103121
103179
|
atrule: {},
|
|
103122
103180
|
pseudo: {}
|
|
103123
103181
|
};
|
|
103124
|
-
if (
|
|
103125
|
-
for (var name2 in
|
|
103126
|
-
switch (typeof
|
|
103182
|
+
if (config3.parseContext) {
|
|
103183
|
+
for (var name2 in config3.parseContext) {
|
|
103184
|
+
switch (typeof config3.parseContext[name2]) {
|
|
103127
103185
|
case "function":
|
|
103128
|
-
parserConfig.context[name2] =
|
|
103186
|
+
parserConfig.context[name2] = config3.parseContext[name2];
|
|
103129
103187
|
break;
|
|
103130
103188
|
case "string":
|
|
103131
|
-
parserConfig.context[name2] = createParseContext(
|
|
103189
|
+
parserConfig.context[name2] = createParseContext(config3.parseContext[name2]);
|
|
103132
103190
|
break;
|
|
103133
103191
|
}
|
|
103134
103192
|
}
|
|
103135
103193
|
}
|
|
103136
|
-
if (
|
|
103137
|
-
for (var name2 in
|
|
103138
|
-
parserConfig.scope[name2] =
|
|
103194
|
+
if (config3.scope) {
|
|
103195
|
+
for (var name2 in config3.scope) {
|
|
103196
|
+
parserConfig.scope[name2] = config3.scope[name2];
|
|
103139
103197
|
}
|
|
103140
103198
|
}
|
|
103141
|
-
if (
|
|
103142
|
-
for (var name2 in
|
|
103143
|
-
var atrule2 =
|
|
103199
|
+
if (config3.atrule) {
|
|
103200
|
+
for (var name2 in config3.atrule) {
|
|
103201
|
+
var atrule2 = config3.atrule[name2];
|
|
103144
103202
|
if (atrule2.parse) {
|
|
103145
103203
|
parserConfig.atrule[name2] = atrule2.parse;
|
|
103146
103204
|
}
|
|
103147
103205
|
}
|
|
103148
103206
|
}
|
|
103149
|
-
if (
|
|
103150
|
-
for (var name2 in
|
|
103151
|
-
var pseudo2 =
|
|
103207
|
+
if (config3.pseudo) {
|
|
103208
|
+
for (var name2 in config3.pseudo) {
|
|
103209
|
+
var pseudo2 = config3.pseudo[name2];
|
|
103152
103210
|
if (pseudo2.parse) {
|
|
103153
103211
|
parserConfig.pseudo[name2] = pseudo2.parse;
|
|
103154
103212
|
}
|
|
103155
103213
|
}
|
|
103156
103214
|
}
|
|
103157
|
-
if (
|
|
103158
|
-
for (var name2 in
|
|
103159
|
-
parserConfig[name2] =
|
|
103215
|
+
if (config3.node) {
|
|
103216
|
+
for (var name2 in config3.node) {
|
|
103217
|
+
parserConfig[name2] = config3.node[name2].parse;
|
|
103160
103218
|
}
|
|
103161
103219
|
}
|
|
103162
103220
|
return parserConfig;
|
|
103163
103221
|
}
|
|
103164
|
-
var create = function createParser(
|
|
103222
|
+
var create = function createParser(config3) {
|
|
103165
103223
|
var parser2 = {
|
|
103166
103224
|
scanner: new TokenStream_1(),
|
|
103167
103225
|
locationMap: new OffsetToLocation_1(),
|
|
@@ -103288,9 +103346,9 @@ var create = function createParser(config2) {
|
|
|
103288
103346
|
);
|
|
103289
103347
|
}
|
|
103290
103348
|
};
|
|
103291
|
-
|
|
103292
|
-
for (var key in
|
|
103293
|
-
parser2[key] =
|
|
103349
|
+
config3 = processConfig(config3 || {});
|
|
103350
|
+
for (var key in config3) {
|
|
103351
|
+
parser2[key] = config3[key];
|
|
103294
103352
|
}
|
|
103295
103353
|
return function(source, options) {
|
|
103296
103354
|
options = options || {};
|
|
@@ -126704,7 +126762,7 @@ var require_definition2 = __commonJS3({
|
|
|
126704
126762
|
exports.assertObjectType = assertObjectType;
|
|
126705
126763
|
exports.isInterfaceType = isInterfaceType12;
|
|
126706
126764
|
exports.assertInterfaceType = assertInterfaceType;
|
|
126707
|
-
exports.isUnionType =
|
|
126765
|
+
exports.isUnionType = isUnionType13;
|
|
126708
126766
|
exports.assertUnionType = assertUnionType;
|
|
126709
126767
|
exports.isEnumType = isEnumType9;
|
|
126710
126768
|
exports.assertEnumType = assertEnumType;
|
|
@@ -126722,7 +126780,7 @@ var require_definition2 = __commonJS3({
|
|
|
126722
126780
|
exports.assertLeafType = assertLeafType;
|
|
126723
126781
|
exports.isCompositeType = isCompositeType;
|
|
126724
126782
|
exports.assertCompositeType = assertCompositeType;
|
|
126725
|
-
exports.isAbstractType =
|
|
126783
|
+
exports.isAbstractType = isAbstractType2;
|
|
126726
126784
|
exports.assertAbstractType = assertAbstractType;
|
|
126727
126785
|
exports.GraphQLList = GraphQLList6;
|
|
126728
126786
|
exports.GraphQLNonNull = GraphQLNonNull6;
|
|
@@ -126777,7 +126835,7 @@ var require_definition2 = __commonJS3({
|
|
|
126777
126835
|
return Constructor;
|
|
126778
126836
|
}
|
|
126779
126837
|
function isType(type) {
|
|
126780
|
-
return isScalarType12(type) || isObjectType11(type) || isInterfaceType12(type) ||
|
|
126838
|
+
return isScalarType12(type) || isObjectType11(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType9(type) || isInputObjectType7(type) || isListType8(type) || isNonNullType10(type);
|
|
126781
126839
|
}
|
|
126782
126840
|
function assertType(type) {
|
|
126783
126841
|
if (!isType(type)) {
|
|
@@ -126812,11 +126870,11 @@ var require_definition2 = __commonJS3({
|
|
|
126812
126870
|
}
|
|
126813
126871
|
return type;
|
|
126814
126872
|
}
|
|
126815
|
-
function
|
|
126873
|
+
function isUnionType13(type) {
|
|
126816
126874
|
return (0, _instanceOf.default)(type, GraphQLUnionType3);
|
|
126817
126875
|
}
|
|
126818
126876
|
function assertUnionType(type) {
|
|
126819
|
-
if (!
|
|
126877
|
+
if (!isUnionType13(type)) {
|
|
126820
126878
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Union type."));
|
|
126821
126879
|
}
|
|
126822
126880
|
return type;
|
|
@@ -126867,7 +126925,7 @@ var require_definition2 = __commonJS3({
|
|
|
126867
126925
|
return type;
|
|
126868
126926
|
}
|
|
126869
126927
|
function isOutputType(type) {
|
|
126870
|
-
return isScalarType12(type) || isObjectType11(type) || isInterfaceType12(type) ||
|
|
126928
|
+
return isScalarType12(type) || isObjectType11(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType9(type) || isWrappingType(type) && isOutputType(type.ofType);
|
|
126871
126929
|
}
|
|
126872
126930
|
function assertOutputType(type) {
|
|
126873
126931
|
if (!isOutputType(type)) {
|
|
@@ -126885,7 +126943,7 @@ var require_definition2 = __commonJS3({
|
|
|
126885
126943
|
return type;
|
|
126886
126944
|
}
|
|
126887
126945
|
function isCompositeType(type) {
|
|
126888
|
-
return isObjectType11(type) || isInterfaceType12(type) ||
|
|
126946
|
+
return isObjectType11(type) || isInterfaceType12(type) || isUnionType13(type);
|
|
126889
126947
|
}
|
|
126890
126948
|
function assertCompositeType(type) {
|
|
126891
126949
|
if (!isCompositeType(type)) {
|
|
@@ -126893,11 +126951,11 @@ var require_definition2 = __commonJS3({
|
|
|
126893
126951
|
}
|
|
126894
126952
|
return type;
|
|
126895
126953
|
}
|
|
126896
|
-
function
|
|
126897
|
-
return isInterfaceType12(type) ||
|
|
126954
|
+
function isAbstractType2(type) {
|
|
126955
|
+
return isInterfaceType12(type) || isUnionType13(type);
|
|
126898
126956
|
}
|
|
126899
126957
|
function assertAbstractType(type) {
|
|
126900
|
-
if (!
|
|
126958
|
+
if (!isAbstractType2(type)) {
|
|
126901
126959
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL abstract type."));
|
|
126902
126960
|
}
|
|
126903
126961
|
return type;
|
|
@@ -126964,7 +127022,7 @@ var require_definition2 = __commonJS3({
|
|
|
126964
127022
|
}
|
|
126965
127023
|
}
|
|
126966
127024
|
function isNamedType4(type) {
|
|
126967
|
-
return isScalarType12(type) || isObjectType11(type) || isInterfaceType12(type) ||
|
|
127025
|
+
return isScalarType12(type) || isObjectType11(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType9(type) || isInputObjectType7(type);
|
|
126968
127026
|
}
|
|
126969
127027
|
function assertNamedType(type) {
|
|
126970
127028
|
if (!isNamedType4(type)) {
|
|
@@ -180400,6 +180458,18 @@ function deepEquals2(objA, objB, map = /* @__PURE__ */ new WeakMap()) {
|
|
|
180400
180458
|
}
|
|
180401
180459
|
return true;
|
|
180402
180460
|
}
|
|
180461
|
+
function getFieldsForType2(selection2, __typename) {
|
|
180462
|
+
let targetSelection = selection2.fields || {};
|
|
180463
|
+
if (selection2.abstractFields && __typename) {
|
|
180464
|
+
const mappedType = selection2.abstractFields.typeMap[__typename];
|
|
180465
|
+
if (mappedType) {
|
|
180466
|
+
targetSelection = selection2.abstractFields.fields[mappedType];
|
|
180467
|
+
} else if (selection2.abstractFields.fields[__typename]) {
|
|
180468
|
+
targetSelection = selection2.abstractFields.fields[__typename];
|
|
180469
|
+
}
|
|
180470
|
+
}
|
|
180471
|
+
return targetSelection;
|
|
180472
|
+
}
|
|
180403
180473
|
var GarbageCollector2 = class {
|
|
180404
180474
|
cache;
|
|
180405
180475
|
lifetimes = /* @__PURE__ */ new Map();
|
|
@@ -180617,23 +180687,32 @@ var List3 = class {
|
|
|
180617
180687
|
let insertData = data2;
|
|
180618
180688
|
if (this.connection) {
|
|
180619
180689
|
insertSelection = {
|
|
180620
|
-
|
|
180621
|
-
|
|
180622
|
-
|
|
180623
|
-
|
|
180624
|
-
|
|
180625
|
-
keyRaw: "edges",
|
|
180626
|
-
type: "ConnectionEdge",
|
|
180627
|
-
update: where === "first" ? "prepend" : "append",
|
|
180690
|
+
fields: {
|
|
180691
|
+
newEntry: {
|
|
180692
|
+
keyRaw: this.key,
|
|
180693
|
+
type: "Connection",
|
|
180694
|
+
selection: {
|
|
180628
180695
|
fields: {
|
|
180629
|
-
|
|
180630
|
-
|
|
180631
|
-
|
|
180632
|
-
|
|
180633
|
-
|
|
180634
|
-
|
|
180635
|
-
|
|
180636
|
-
|
|
180696
|
+
edges: {
|
|
180697
|
+
keyRaw: "edges",
|
|
180698
|
+
type: "ConnectionEdge",
|
|
180699
|
+
update: where === "first" ? "prepend" : "append",
|
|
180700
|
+
selection: {
|
|
180701
|
+
fields: {
|
|
180702
|
+
node: {
|
|
180703
|
+
type: listType,
|
|
180704
|
+
keyRaw: "node",
|
|
180705
|
+
selection: {
|
|
180706
|
+
...selection2,
|
|
180707
|
+
fields: {
|
|
180708
|
+
...selection2.fields,
|
|
180709
|
+
__typename: {
|
|
180710
|
+
keyRaw: "__typename",
|
|
180711
|
+
type: "String"
|
|
180712
|
+
}
|
|
180713
|
+
}
|
|
180714
|
+
}
|
|
180715
|
+
}
|
|
180637
180716
|
}
|
|
180638
180717
|
}
|
|
180639
180718
|
}
|
|
@@ -180649,15 +180728,20 @@ var List3 = class {
|
|
|
180649
180728
|
};
|
|
180650
180729
|
} else {
|
|
180651
180730
|
insertSelection = {
|
|
180652
|
-
|
|
180653
|
-
|
|
180654
|
-
|
|
180655
|
-
|
|
180656
|
-
|
|
180657
|
-
|
|
180658
|
-
|
|
180659
|
-
|
|
180660
|
-
|
|
180731
|
+
fields: {
|
|
180732
|
+
newEntries: {
|
|
180733
|
+
keyRaw: this.key,
|
|
180734
|
+
type: listType,
|
|
180735
|
+
update: where === "first" ? "prepend" : "append",
|
|
180736
|
+
selection: {
|
|
180737
|
+
...selection2,
|
|
180738
|
+
fields: {
|
|
180739
|
+
...selection2.fields,
|
|
180740
|
+
__typename: {
|
|
180741
|
+
keyRaw: "__typename",
|
|
180742
|
+
type: "String"
|
|
180743
|
+
}
|
|
180744
|
+
}
|
|
180661
180745
|
}
|
|
180662
180746
|
}
|
|
180663
180747
|
}
|
|
@@ -180717,7 +180801,7 @@ var List3 = class {
|
|
|
180717
180801
|
const subscribers = this.cache._internal_unstable.subscriptions.get(this.recordID, this.key);
|
|
180718
180802
|
this.cache._internal_unstable.subscriptions.remove(
|
|
180719
180803
|
targetID,
|
|
180720
|
-
this.connection ? this.selection.edges.
|
|
180804
|
+
this.connection ? this.selection.fields.edges.selection : this.selection,
|
|
180721
180805
|
subscribers,
|
|
180722
180806
|
variables
|
|
180723
180807
|
);
|
|
@@ -181202,18 +181286,20 @@ var InMemorySubscriptions2 = class {
|
|
|
181202
181286
|
variables,
|
|
181203
181287
|
parentType
|
|
181204
181288
|
}) {
|
|
181205
|
-
|
|
181206
|
-
|
|
181289
|
+
const __typename = this.cache._internal_unstable.storage.get(parent, "__typename").value;
|
|
181290
|
+
let targetSelection = getFieldsForType2(selection2, __typename);
|
|
181291
|
+
for (const fieldSelection of Object.values(targetSelection || {})) {
|
|
181292
|
+
const { keyRaw, selection: innerSelection, type } = fieldSelection;
|
|
181207
181293
|
const key = evaluateKey2(keyRaw, variables);
|
|
181208
181294
|
this.addFieldSubscription({
|
|
181209
181295
|
id: parent,
|
|
181210
181296
|
key,
|
|
181211
|
-
|
|
181297
|
+
field: fieldSelection,
|
|
181212
181298
|
spec,
|
|
181213
181299
|
parentType: parentType || spec.rootType,
|
|
181214
181300
|
variables
|
|
181215
181301
|
});
|
|
181216
|
-
if (
|
|
181302
|
+
if (innerSelection) {
|
|
181217
181303
|
const { value: linkedRecord } = this.cache._internal_unstable.storage.get(
|
|
181218
181304
|
parent,
|
|
181219
181305
|
key
|
|
@@ -181226,7 +181312,7 @@ var InMemorySubscriptions2 = class {
|
|
|
181226
181312
|
this.add({
|
|
181227
181313
|
parent: child,
|
|
181228
181314
|
spec,
|
|
181229
|
-
selection:
|
|
181315
|
+
selection: innerSelection,
|
|
181230
181316
|
variables,
|
|
181231
181317
|
parentType: type
|
|
181232
181318
|
});
|
|
@@ -181237,7 +181323,7 @@ var InMemorySubscriptions2 = class {
|
|
|
181237
181323
|
addFieldSubscription({
|
|
181238
181324
|
id: id2,
|
|
181239
181325
|
key,
|
|
181240
|
-
|
|
181326
|
+
field,
|
|
181241
181327
|
spec,
|
|
181242
181328
|
parentType,
|
|
181243
181329
|
variables
|
|
@@ -181264,8 +181350,8 @@ var InMemorySubscriptions2 = class {
|
|
|
181264
181350
|
const counts = this.referenceCounts[id2][key];
|
|
181265
181351
|
counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
|
|
181266
181352
|
this.cache._internal_unstable.lifetimes.resetLifetime(id2, key);
|
|
181267
|
-
const {
|
|
181268
|
-
if (
|
|
181353
|
+
const { selection: selection2, list, filters } = field;
|
|
181354
|
+
if (selection2 && list) {
|
|
181269
181355
|
this.cache._internal_unstable.lists.add({
|
|
181270
181356
|
name: list.name,
|
|
181271
181357
|
connection: list.connection,
|
|
@@ -181273,7 +181359,7 @@ var InMemorySubscriptions2 = class {
|
|
|
181273
181359
|
recordType: this.cache._internal_unstable.storage.get(id2, "__typename")?.value || parentType,
|
|
181274
181360
|
listType: list.type,
|
|
181275
181361
|
key,
|
|
181276
|
-
selection:
|
|
181362
|
+
selection: selection2,
|
|
181277
181363
|
filters: Object.entries(filters || {}).reduce((acc, [key2, { kind, value: value2 }]) => {
|
|
181278
181364
|
return {
|
|
181279
181365
|
...acc,
|
|
@@ -181290,20 +181376,21 @@ var InMemorySubscriptions2 = class {
|
|
|
181290
181376
|
subscribers,
|
|
181291
181377
|
parentType
|
|
181292
181378
|
}) {
|
|
181293
|
-
|
|
181294
|
-
|
|
181379
|
+
let targetSelection = getFieldsForType2(selection2, parentType);
|
|
181380
|
+
for (const fieldSelection of Object.values(targetSelection)) {
|
|
181381
|
+
const { type: linkedType, keyRaw, selection: innerSelection } = fieldSelection;
|
|
181295
181382
|
const key = evaluateKey2(keyRaw, variables);
|
|
181296
181383
|
for (const spec of subscribers) {
|
|
181297
181384
|
this.addFieldSubscription({
|
|
181298
181385
|
id: parent,
|
|
181299
181386
|
key,
|
|
181300
|
-
|
|
181387
|
+
field: fieldSelection,
|
|
181301
181388
|
spec,
|
|
181302
181389
|
parentType,
|
|
181303
181390
|
variables
|
|
181304
181391
|
});
|
|
181305
181392
|
}
|
|
181306
|
-
if (
|
|
181393
|
+
if (innerSelection) {
|
|
181307
181394
|
const { value: link } = this.cache._internal_unstable.storage.get(parent, key);
|
|
181308
181395
|
const children = !Array.isArray(link) ? [link] : flattenList2(link);
|
|
181309
181396
|
for (const linkedRecord of children) {
|
|
@@ -181312,7 +181399,7 @@ var InMemorySubscriptions2 = class {
|
|
|
181312
181399
|
}
|
|
181313
181400
|
this.addMany({
|
|
181314
181401
|
parent: linkedRecord,
|
|
181315
|
-
selection:
|
|
181402
|
+
selection: innerSelection,
|
|
181316
181403
|
variables,
|
|
181317
181404
|
subscribers,
|
|
181318
181405
|
parentType: linkedType
|
|
@@ -181324,22 +181411,20 @@ var InMemorySubscriptions2 = class {
|
|
|
181324
181411
|
get(id2, field) {
|
|
181325
181412
|
return this.subscribers[id2]?.[field] || [];
|
|
181326
181413
|
}
|
|
181327
|
-
remove(id2,
|
|
181414
|
+
remove(id2, selection2, targets, variables, visited = []) {
|
|
181328
181415
|
visited.push(id2);
|
|
181329
181416
|
const linkedIDs = [];
|
|
181330
|
-
for (const
|
|
181331
|
-
const key = evaluateKey2(
|
|
181417
|
+
for (const fieldSelection of Object.values(selection2.fields || {})) {
|
|
181418
|
+
const key = evaluateKey2(fieldSelection.keyRaw, variables);
|
|
181332
181419
|
this.removeSubscribers(id2, key, targets);
|
|
181333
|
-
if (!
|
|
181420
|
+
if (!fieldSelection.selection?.fields) {
|
|
181334
181421
|
continue;
|
|
181335
181422
|
}
|
|
181336
|
-
if (selection2.list) {
|
|
181337
|
-
}
|
|
181338
181423
|
const { value: previousValue } = this.cache._internal_unstable.storage.get(id2, key);
|
|
181339
181424
|
const links = !Array.isArray(previousValue) ? [previousValue] : flattenList2(previousValue);
|
|
181340
181425
|
for (const link of links) {
|
|
181341
181426
|
if (link !== null) {
|
|
181342
|
-
linkedIDs.push([link,
|
|
181427
|
+
linkedIDs.push([link, fieldSelection.selection || {}]);
|
|
181343
181428
|
}
|
|
181344
181429
|
}
|
|
181345
181430
|
}
|
|
@@ -181515,8 +181600,9 @@ var CacheInternal2 = class {
|
|
|
181515
181600
|
if (this._disabled) {
|
|
181516
181601
|
return [];
|
|
181517
181602
|
}
|
|
181603
|
+
let targetSelection = getFieldsForType2(selection2, data2["__typename"]);
|
|
181518
181604
|
for (const [field, value2] of Object.entries(data2)) {
|
|
181519
|
-
if (!selection2 || !
|
|
181605
|
+
if (!selection2 || !targetSelection[field]) {
|
|
181520
181606
|
throw new Error(
|
|
181521
181607
|
"Could not find field listing in selection for " + field + " @ " + JSON.stringify(selection2)
|
|
181522
181608
|
);
|
|
@@ -181524,11 +181610,11 @@ var CacheInternal2 = class {
|
|
|
181524
181610
|
let {
|
|
181525
181611
|
type: linkedType,
|
|
181526
181612
|
keyRaw,
|
|
181527
|
-
|
|
181613
|
+
selection: fieldSelection,
|
|
181528
181614
|
operations,
|
|
181529
181615
|
abstract: isAbstract,
|
|
181530
181616
|
update
|
|
181531
|
-
} =
|
|
181617
|
+
} = targetSelection[field];
|
|
181532
181618
|
const key = evaluateKey2(keyRaw, variables);
|
|
181533
181619
|
const currentSubscribers = this.subscriptions.get(parent, key);
|
|
181534
181620
|
const { value: previousValue, displayLayers } = this.storage.get(parent, key);
|
|
@@ -181536,7 +181622,7 @@ var CacheInternal2 = class {
|
|
|
181536
181622
|
if (displayLayer) {
|
|
181537
181623
|
this.lifetimes.resetLifetime(parent, key);
|
|
181538
181624
|
}
|
|
181539
|
-
if (!
|
|
181625
|
+
if (!fieldSelection) {
|
|
181540
181626
|
let newValue = value2;
|
|
181541
181627
|
if (Array.isArray(value2) && applyUpdates && update) {
|
|
181542
181628
|
if (update === "append") {
|
|
@@ -181556,7 +181642,7 @@ var CacheInternal2 = class {
|
|
|
181556
181642
|
}
|
|
181557
181643
|
const previousLinks = flattenList2([previousValue]);
|
|
181558
181644
|
for (const link of previousLinks) {
|
|
181559
|
-
this.subscriptions.remove(link,
|
|
181645
|
+
this.subscriptions.remove(link, fieldSelection, currentSubscribers, variables);
|
|
181560
181646
|
}
|
|
181561
181647
|
layer.writeLink(parent, key, null);
|
|
181562
181648
|
toNotify.push(...currentSubscribers);
|
|
@@ -181582,14 +181668,14 @@ var CacheInternal2 = class {
|
|
|
181582
181668
|
if (previousValue && typeof previousValue === "string") {
|
|
181583
181669
|
this.subscriptions.remove(
|
|
181584
181670
|
previousValue,
|
|
181585
|
-
|
|
181671
|
+
fieldSelection,
|
|
181586
181672
|
currentSubscribers,
|
|
181587
181673
|
variables
|
|
181588
181674
|
);
|
|
181589
181675
|
}
|
|
181590
181676
|
this.subscriptions.addMany({
|
|
181591
181677
|
parent: linkedID,
|
|
181592
|
-
selection:
|
|
181678
|
+
selection: fieldSelection,
|
|
181593
181679
|
subscribers: currentSubscribers,
|
|
181594
181680
|
variables,
|
|
181595
181681
|
parentType: linkedType
|
|
@@ -181599,14 +181685,14 @@ var CacheInternal2 = class {
|
|
|
181599
181685
|
if (linkedID) {
|
|
181600
181686
|
this.writeSelection({
|
|
181601
181687
|
root,
|
|
181602
|
-
selection:
|
|
181688
|
+
selection: fieldSelection,
|
|
181603
181689
|
parent: linkedID,
|
|
181604
181690
|
data: value2,
|
|
181605
181691
|
variables,
|
|
181606
181692
|
toNotify,
|
|
181607
181693
|
applyUpdates,
|
|
181608
181694
|
layer,
|
|
181609
|
-
forceNotify
|
|
181695
|
+
forceNotify
|
|
181610
181696
|
});
|
|
181611
181697
|
}
|
|
181612
181698
|
} else if (Array.isArray(value2) && (typeof previousValue === "undefined" || Array.isArray(previousValue))) {
|
|
@@ -181635,7 +181721,7 @@ var CacheInternal2 = class {
|
|
|
181635
181721
|
key,
|
|
181636
181722
|
linkedType,
|
|
181637
181723
|
variables,
|
|
181638
|
-
fields,
|
|
181724
|
+
fields: fieldSelection,
|
|
181639
181725
|
layer,
|
|
181640
181726
|
forceNotify
|
|
181641
181727
|
});
|
|
@@ -181685,7 +181771,7 @@ var CacheInternal2 = class {
|
|
|
181685
181771
|
if (linkedIDs.includes(lostID) || !lostID) {
|
|
181686
181772
|
continue;
|
|
181687
181773
|
}
|
|
181688
|
-
this.subscriptions.remove(lostID,
|
|
181774
|
+
this.subscriptions.remove(lostID, fieldSelection, currentSubscribers, variables);
|
|
181689
181775
|
}
|
|
181690
181776
|
if (contentChanged || oldIDs.length === 0 && newIDs.length === 0) {
|
|
181691
181777
|
layer.writeLink(parent, key, linkedIDs);
|
|
@@ -181696,7 +181782,7 @@ var CacheInternal2 = class {
|
|
|
181696
181782
|
}
|
|
181697
181783
|
this.subscriptions.addMany({
|
|
181698
181784
|
parent: id2,
|
|
181699
|
-
selection:
|
|
181785
|
+
selection: fieldSelection,
|
|
181700
181786
|
subscribers: currentSubscribers,
|
|
181701
181787
|
variables,
|
|
181702
181788
|
parentType: linkedType
|
|
@@ -181721,9 +181807,14 @@ var CacheInternal2 = class {
|
|
|
181721
181807
|
}
|
|
181722
181808
|
const targets = Array.isArray(value2) ? value2 : [value2];
|
|
181723
181809
|
for (const target of targets) {
|
|
181724
|
-
if (operation.action === "insert" && target instanceof Object &&
|
|
181725
|
-
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(
|
|
181726
|
-
|
|
181810
|
+
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
181811
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(
|
|
181812
|
+
fieldSelection,
|
|
181813
|
+
target,
|
|
181814
|
+
variables,
|
|
181815
|
+
operation.position || "last"
|
|
181816
|
+
);
|
|
181817
|
+
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
181727
181818
|
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
|
|
181728
181819
|
} else if (operation.action === "delete" && operation.type) {
|
|
181729
181820
|
if (typeof target !== "string") {
|
|
@@ -181734,8 +181825,13 @@ var CacheInternal2 = class {
|
|
|
181734
181825
|
continue;
|
|
181735
181826
|
}
|
|
181736
181827
|
this.cache.delete(targetID);
|
|
181737
|
-
} else if (operation.action === "toggle" && target instanceof Object &&
|
|
181738
|
-
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(
|
|
181828
|
+
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
181829
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(
|
|
181830
|
+
fieldSelection,
|
|
181831
|
+
target,
|
|
181832
|
+
variables,
|
|
181833
|
+
operation.position || "last"
|
|
181834
|
+
);
|
|
181739
181835
|
}
|
|
181740
181836
|
}
|
|
181741
181837
|
}
|
|
@@ -181755,9 +181851,12 @@ var CacheInternal2 = class {
|
|
|
181755
181851
|
let hasData = false;
|
|
181756
181852
|
let partial = false;
|
|
181757
181853
|
let cascadeNull = false;
|
|
181758
|
-
|
|
181759
|
-
|
|
181760
|
-
|
|
181854
|
+
const typename = this.storage.get(parent, "__typename").value;
|
|
181855
|
+
let targetSelection = getFieldsForType2(selection2, typename);
|
|
181856
|
+
for (const [
|
|
181857
|
+
attributeName,
|
|
181858
|
+
{ type, keyRaw, selection: fieldSelection, nullable, list }
|
|
181859
|
+
] of Object.entries(targetSelection)) {
|
|
181761
181860
|
const key = evaluateKey2(keyRaw, variables);
|
|
181762
181861
|
const { value: value2 } = this.storage.get(parent, key);
|
|
181763
181862
|
let nextStep = stepsFromConnection;
|
|
@@ -181780,7 +181879,7 @@ var CacheInternal2 = class {
|
|
|
181780
181879
|
if (typeof value2 !== "undefined") {
|
|
181781
181880
|
hasData = true;
|
|
181782
181881
|
}
|
|
181783
|
-
} else if (!
|
|
181882
|
+
} else if (!fieldSelection) {
|
|
181784
181883
|
const fnUnmarshal = this.config?.scalars?.[type]?.unmarshal;
|
|
181785
181884
|
if (fnUnmarshal) {
|
|
181786
181885
|
target[attributeName] = fnUnmarshal(value2);
|
|
@@ -181790,7 +181889,7 @@ var CacheInternal2 = class {
|
|
|
181790
181889
|
hasData = true;
|
|
181791
181890
|
} else if (Array.isArray(value2)) {
|
|
181792
181891
|
const listValue = this.hydrateNestedList({
|
|
181793
|
-
fields,
|
|
181892
|
+
fields: fieldSelection,
|
|
181794
181893
|
variables,
|
|
181795
181894
|
linkedList: value2,
|
|
181796
181895
|
stepsFromConnection: nextStep
|
|
@@ -181805,7 +181904,7 @@ var CacheInternal2 = class {
|
|
|
181805
181904
|
} else {
|
|
181806
181905
|
const objectFields = this.getSelection({
|
|
181807
181906
|
parent: value2,
|
|
181808
|
-
selection:
|
|
181907
|
+
selection: fieldSelection,
|
|
181809
181908
|
variables,
|
|
181810
181909
|
stepsFromConnection: nextStep
|
|
181811
181910
|
});
|
|
@@ -183106,7 +183205,18 @@ var recast13 = __toESM(require_main4(), 1);
|
|
|
183106
183205
|
// src/plugin/extractLoadFunction.ts
|
|
183107
183206
|
var graphql20 = __toESM(require_graphql5(), 1);
|
|
183108
183207
|
var import_vite = require("vite");
|
|
183109
|
-
|
|
183208
|
+
|
|
183209
|
+
// src/plugin/naming.ts
|
|
183210
|
+
var query_variable_fn = (name2) => {
|
|
183211
|
+
return `_${name2}Variables`;
|
|
183212
|
+
};
|
|
183213
|
+
var houdini_load_fn = "_houdini_load";
|
|
183214
|
+
var houdini_before_load_fn = "_houdini_beforeLoad";
|
|
183215
|
+
var houdini_after_load_fn = "_houdini_afterLoad";
|
|
183216
|
+
var houdini_on_error_fn = "_houdini_onError";
|
|
183217
|
+
|
|
183218
|
+
// src/plugin/extractLoadFunction.ts
|
|
183219
|
+
async function extract_load_function(config3, filepath, mockArtifacts) {
|
|
183110
183220
|
const nil = {
|
|
183111
183221
|
houdini_load: [],
|
|
183112
183222
|
exports: []
|
|
@@ -183126,7 +183236,7 @@ async function extract_load_function(config2, filepath, mockArtifacts) {
|
|
|
183126
183236
|
if (!parsed) {
|
|
183127
183237
|
return nil;
|
|
183128
183238
|
}
|
|
183129
|
-
const { exports, load } = await processScript(
|
|
183239
|
+
const { exports, load } = await processScript(config3, filepath, parsed, mockArtifacts);
|
|
183130
183240
|
return {
|
|
183131
183241
|
exports,
|
|
183132
183242
|
houdini_load: load.map(
|
|
@@ -183134,7 +183244,7 @@ async function extract_load_function(config2, filepath, mockArtifacts) {
|
|
|
183134
183244
|
)
|
|
183135
183245
|
};
|
|
183136
183246
|
}
|
|
183137
|
-
async function processScript(
|
|
183247
|
+
async function processScript(config3, filepath, program, mockArtifacts) {
|
|
183138
183248
|
const exports = [];
|
|
183139
183249
|
const globalImports = {};
|
|
183140
183250
|
let houdiniLoad = null;
|
|
@@ -183147,16 +183257,16 @@ async function processScript(config2, filepath, program, mockArtifacts) {
|
|
|
183147
183257
|
for (const specifier of statement.specifiers ?? []) {
|
|
183148
183258
|
let name2 = specifier.local?.name || "";
|
|
183149
183259
|
let query = "";
|
|
183150
|
-
const store_prefix = plugin_config(
|
|
183260
|
+
const store_prefix = plugin_config(config3).globalStorePrefix;
|
|
183151
183261
|
if (store_prefix && name2.startsWith(store_prefix)) {
|
|
183152
183262
|
query = name2.substring(store_prefix.length);
|
|
183153
|
-
} else if (name2.endsWith(store_suffix(
|
|
183154
|
-
query = name2.substring(0, name2.length - store_suffix(
|
|
183263
|
+
} else if (name2.endsWith(store_suffix(config3))) {
|
|
183264
|
+
query = name2.substring(0, name2.length - store_suffix(config3).length);
|
|
183155
183265
|
} else if (source.startsWith("$houdini/" + stores_directory_name()) && specifier.type === "ImportDefaultSpecifier") {
|
|
183156
183266
|
query = source.substring(`$houdini/${stores_directory_name()}`.length - 1);
|
|
183157
183267
|
}
|
|
183158
183268
|
if (query) {
|
|
183159
|
-
const artifact = mockArtifacts?.[query] || (await import(path_exports.importPath(path_exports.join(
|
|
183269
|
+
const artifact = mockArtifacts?.[query] || (await import(path_exports.importPath(path_exports.join(config3.artifactDirectory, query + ".js")))).default;
|
|
183160
183270
|
globalImports[name2] = artifact.raw;
|
|
183161
183271
|
}
|
|
183162
183272
|
}
|
|
@@ -183164,7 +183274,7 @@ async function processScript(config2, filepath, program, mockArtifacts) {
|
|
|
183164
183274
|
} else if (statement.type === "ExportNamedDeclaration") {
|
|
183165
183275
|
if (statement.declaration?.type === "VariableDeclaration" && statement.declaration.declarations.length === 1 && statement.declaration.declarations[0].type === "VariableDeclarator" && statement.declaration.declarations[0].id.type === "Identifier") {
|
|
183166
183276
|
exports.push(statement.declaration.declarations[0].id.name);
|
|
183167
|
-
if (statement.declaration.declarations[0].id.name ===
|
|
183277
|
+
if (statement.declaration.declarations[0].id.name === houdini_load_fn && statement.declaration.declarations[0].init) {
|
|
183168
183278
|
houdiniLoad = statement.declaration.declarations[0].init;
|
|
183169
183279
|
}
|
|
183170
183280
|
} else if (statement.declaration?.type === "FunctionDeclaration" && statement.declaration.id?.type === "Identifier") {
|
|
@@ -183197,12 +183307,14 @@ async function processScript(config2, filepath, program, mockArtifacts) {
|
|
|
183197
183307
|
load.push(result);
|
|
183198
183308
|
if (!result) {
|
|
183199
183309
|
throw new Error(
|
|
183200
|
-
|
|
183310
|
+
`Could not find query for computing ${houdini_load_fn}: ` + element.name + ". filepath: " + filepath
|
|
183201
183311
|
);
|
|
183202
183312
|
}
|
|
183203
183313
|
} else if (element.type === "TaggedTemplateExpression") {
|
|
183204
183314
|
if (element.tag.type !== "Identifier" || element.tag.name !== "graphql") {
|
|
183205
|
-
throw new Error(
|
|
183315
|
+
throw new Error(
|
|
183316
|
+
`only graphql template tags can be passed to ${houdini_load_fn}`
|
|
183317
|
+
);
|
|
183206
183318
|
}
|
|
183207
183319
|
load.push(element.quasi.quasis[0].value.raw);
|
|
183208
183320
|
}
|
|
@@ -183219,7 +183331,7 @@ function identifyQueryReference(imports, statement) {
|
|
|
183219
183331
|
return null;
|
|
183220
183332
|
}
|
|
183221
183333
|
const local = declaration.id.name;
|
|
183222
|
-
if (local ===
|
|
183334
|
+
if (local === houdini_load_fn) {
|
|
183223
183335
|
return null;
|
|
183224
183336
|
}
|
|
183225
183337
|
const value2 = declaration.init;
|
|
@@ -183234,7 +183346,7 @@ function identifyQueryReference(imports, statement) {
|
|
|
183234
183346
|
}
|
|
183235
183347
|
if (value2.type === "TaggedTemplateExpression") {
|
|
183236
183348
|
if (value2.tag.type !== "Identifier" || value2.tag.name !== "graphql") {
|
|
183237
|
-
throw new Error(
|
|
183349
|
+
throw new Error(`only graphql template tags can be passed to ${houdini_load_fn}`);
|
|
183238
183350
|
}
|
|
183239
183351
|
return { local, query: value2.quasi.quasis[0].value.raw };
|
|
183240
183352
|
}
|
|
@@ -183242,17 +183354,17 @@ function identifyQueryReference(imports, statement) {
|
|
|
183242
183354
|
}
|
|
183243
183355
|
|
|
183244
183356
|
// src/plugin/kit.ts
|
|
183245
|
-
function is_route(
|
|
183357
|
+
function is_route(config3, framework, filepath) {
|
|
183246
183358
|
if (framework === "svelte") {
|
|
183247
183359
|
return false;
|
|
183248
183360
|
}
|
|
183249
|
-
if (!filepath.startsWith(
|
|
183361
|
+
if (!filepath.startsWith(config3.routesDir)) {
|
|
183250
183362
|
return false;
|
|
183251
183363
|
}
|
|
183252
183364
|
return ["+layout.svelte", "+page.svelte"].includes(path_exports.parse(filepath).base);
|
|
183253
183365
|
}
|
|
183254
|
-
function route_data_path(
|
|
183255
|
-
return resolve_relative(
|
|
183366
|
+
function route_data_path(config3, filename) {
|
|
183367
|
+
return resolve_relative(config3, filename).replace(".svelte", ".js");
|
|
183256
183368
|
}
|
|
183257
183369
|
function is_route_script(framework, filename) {
|
|
183258
183370
|
return is_page_script(framework, filename) || is_layout_script(framework, filename);
|
|
@@ -183263,14 +183375,14 @@ function is_page_script(framework, filename) {
|
|
|
183263
183375
|
function is_layout_script(framework, filename) {
|
|
183264
183376
|
return framework === "kit" && (filename.endsWith("+layout.js") || filename.endsWith("+layout.ts"));
|
|
183265
183377
|
}
|
|
183266
|
-
function is_root_layout(
|
|
183267
|
-
return resolve_relative(
|
|
183378
|
+
function is_root_layout(config3, filename) {
|
|
183379
|
+
return resolve_relative(config3, filename).replace(config3.projectRoot, "") === path_exports.sep + path_exports.join("src", "routes", "+layout.svelte");
|
|
183268
183380
|
}
|
|
183269
|
-
function is_root_layout_server(
|
|
183270
|
-
return resolve_relative(
|
|
183381
|
+
function is_root_layout_server(config3, filename) {
|
|
183382
|
+
return resolve_relative(config3, filename).replace(config3.projectRoot, "").replace(".ts", ".js") === path_exports.sep + path_exports.join("src", "routes", "+layout.server.js");
|
|
183271
183383
|
}
|
|
183272
|
-
function is_root_layout_script(
|
|
183273
|
-
return resolve_relative(
|
|
183384
|
+
function is_root_layout_script(config3, filename) {
|
|
183385
|
+
return resolve_relative(config3, filename).replace(config3.projectRoot, "").replace(".ts", ".js") === path_exports.sep + path_exports.join("src", "routes", "+layout.js");
|
|
183274
183386
|
}
|
|
183275
183387
|
function is_layout_component(framework, filename) {
|
|
183276
183388
|
return framework === "kit" && filename.endsWith("+layout.svelte");
|
|
@@ -183278,43 +183390,44 @@ function is_layout_component(framework, filename) {
|
|
|
183278
183390
|
function is_layout(framework, filename) {
|
|
183279
183391
|
return is_layout_script(framework, filename) || is_layout_component(framework, filename);
|
|
183280
183392
|
}
|
|
183281
|
-
function is_component(
|
|
183282
|
-
return framework === "svelte" || filename.endsWith(".svelte") && !is_route_script(framework, filename) && !is_route(
|
|
183393
|
+
function is_component(config3, framework, filename) {
|
|
183394
|
+
return framework === "svelte" || filename.endsWith(".svelte") && !is_route_script(framework, filename) && !is_route(config3, framework, filename);
|
|
183283
183395
|
}
|
|
183284
|
-
function page_query_path(
|
|
183396
|
+
function page_query_path(config3, filename) {
|
|
183285
183397
|
return path_exports.join(
|
|
183286
|
-
path_exports.dirname(resolve_relative(
|
|
183287
|
-
plugin_config(
|
|
183398
|
+
path_exports.dirname(resolve_relative(config3, filename)),
|
|
183399
|
+
plugin_config(config3).pageQueryFilename
|
|
183288
183400
|
);
|
|
183289
183401
|
}
|
|
183290
|
-
function layout_query_path(
|
|
183402
|
+
function layout_query_path(config3, filename) {
|
|
183291
183403
|
return path_exports.join(
|
|
183292
|
-
path_exports.dirname(resolve_relative(
|
|
183293
|
-
plugin_config(
|
|
183404
|
+
path_exports.dirname(resolve_relative(config3, filename)),
|
|
183405
|
+
plugin_config(config3).layoutQueryFilename
|
|
183294
183406
|
);
|
|
183295
183407
|
}
|
|
183296
|
-
function resolve_relative(
|
|
183408
|
+
function resolve_relative(config3, filename) {
|
|
183297
183409
|
const match = filename.match("^((../)+)src/routes");
|
|
183298
183410
|
if (match) {
|
|
183299
|
-
filename = path_exports.join(
|
|
183411
|
+
filename = path_exports.join(config3.projectRoot, filename.substring(match[1].length));
|
|
183300
183412
|
}
|
|
183301
183413
|
return filename;
|
|
183302
183414
|
}
|
|
183303
|
-
function route_page_path(
|
|
183304
|
-
return resolve_relative(
|
|
183415
|
+
function route_page_path(config3, filename) {
|
|
183416
|
+
return resolve_relative(config3, filename).replace(".js", ".svelte").replace(".ts", ".svelte");
|
|
183305
183417
|
}
|
|
183306
183418
|
function stores_directory_name() {
|
|
183307
183419
|
return "stores";
|
|
183308
183420
|
}
|
|
183309
|
-
function store_import_path({ config:
|
|
183421
|
+
function store_import_path({ config: config3, name: name2 }) {
|
|
183310
183422
|
return `$houdini/plugins/houdini-svelte/${stores_directory_name()}/${name2}`;
|
|
183311
183423
|
}
|
|
183312
|
-
function store_suffix(
|
|
183424
|
+
function store_suffix(config3) {
|
|
183313
183425
|
return "Store";
|
|
183314
183426
|
}
|
|
183315
|
-
function plugin_config(
|
|
183316
|
-
const cfg =
|
|
183427
|
+
function plugin_config(config3) {
|
|
183428
|
+
const cfg = config3.pluginConfig("houdini-svelte");
|
|
183317
183429
|
return {
|
|
183430
|
+
client: "./src/client",
|
|
183318
183431
|
globalStorePrefix: "GQL_",
|
|
183319
183432
|
pageQueryFilename: "+page.gql",
|
|
183320
183433
|
layoutQueryFilename: "+layout.gql",
|
|
@@ -183410,6 +183523,37 @@ async function kit_init(page2) {
|
|
|
183410
183523
|
);
|
|
183411
183524
|
}
|
|
183412
183525
|
|
|
183526
|
+
// ../../node_modules/.pnpm/@kitql+helper@0.5.0/node_modules/@kitql/helper/index.mjs
|
|
183527
|
+
var config2 = {
|
|
183528
|
+
reset: {
|
|
183529
|
+
node: `\x1B[37m\x1B[0m`,
|
|
183530
|
+
browser: ""
|
|
183531
|
+
},
|
|
183532
|
+
green: {
|
|
183533
|
+
node: `\x1B[32m`,
|
|
183534
|
+
browser: "color: green"
|
|
183535
|
+
},
|
|
183536
|
+
magneta: {
|
|
183537
|
+
node: `\x1B[35m`,
|
|
183538
|
+
browser: "color: #ff00ff"
|
|
183539
|
+
},
|
|
183540
|
+
red: {
|
|
183541
|
+
node: `\x1B[31m`,
|
|
183542
|
+
browser: "color: red"
|
|
183543
|
+
},
|
|
183544
|
+
cyan: {
|
|
183545
|
+
node: `\x1B[36m`,
|
|
183546
|
+
browser: "color: cyan"
|
|
183547
|
+
},
|
|
183548
|
+
yellow: {
|
|
183549
|
+
node: `\x1B[33m`,
|
|
183550
|
+
browser: "color: yellow"
|
|
183551
|
+
}
|
|
183552
|
+
};
|
|
183553
|
+
function logYellow(str) {
|
|
183554
|
+
return `${config2.yellow.node}${str}${config2.reset.node}`;
|
|
183555
|
+
}
|
|
183556
|
+
|
|
183413
183557
|
// src/plugin/transforms/kit/load.ts
|
|
183414
183558
|
var graphql28 = __toESM(require_graphql5(), 1);
|
|
183415
183559
|
var recast15 = __toESM(require_main4(), 1);
|
|
@@ -183417,8 +183561,8 @@ var recast15 = __toESM(require_main4(), 1);
|
|
|
183417
183561
|
// src/plugin/transforms/query.ts
|
|
183418
183562
|
var recast14 = __toESM(require_main4(), 1);
|
|
183419
183563
|
var AST14 = recast14.types.builders;
|
|
183420
|
-
async function QueryProcessor(
|
|
183421
|
-
if (!is_component(
|
|
183564
|
+
async function QueryProcessor(config3, page2) {
|
|
183565
|
+
if (!is_component(config3, page2.framework, page2.filepath)) {
|
|
183422
183566
|
return;
|
|
183423
183567
|
}
|
|
183424
183568
|
const store_id = (name2) => {
|
|
@@ -183461,7 +183605,7 @@ async function QueryProcessor(config2, page2) {
|
|
|
183461
183605
|
script: page2.script,
|
|
183462
183606
|
config: page2.config,
|
|
183463
183607
|
import: [`${query.name}Store`],
|
|
183464
|
-
sourceModule: store_import_path({ config:
|
|
183608
|
+
sourceModule: store_import_path({ config: config3, name: query.name })
|
|
183465
183609
|
}).ids[0];
|
|
183466
183610
|
page2.script.body.splice(
|
|
183467
183611
|
find_insert_index(page2.script),
|
|
@@ -183475,6 +183619,14 @@ async function QueryProcessor(config2, page2) {
|
|
|
183475
183619
|
...queries.flatMap((query) => {
|
|
183476
183620
|
const variable_fn = query_variable_fn(query.name);
|
|
183477
183621
|
const has_variables = find_exported_fn(page2.script.body, variable_fn);
|
|
183622
|
+
if (query.variables && has_variables === null) {
|
|
183623
|
+
formatErrors({
|
|
183624
|
+
filepath: page2.filepath,
|
|
183625
|
+
message: `Could not find required variable function: ${logYellow(
|
|
183626
|
+
variable_fn
|
|
183627
|
+
)}. maybe its not exported? `
|
|
183628
|
+
});
|
|
183629
|
+
}
|
|
183478
183630
|
return [
|
|
183479
183631
|
AST14.labeledStatement(
|
|
183480
183632
|
AST14.identifier("$"),
|
|
@@ -183570,9 +183722,7 @@ async function find_inline_queries(page2, parsed, store_id) {
|
|
|
183570
183722
|
return false;
|
|
183571
183723
|
}
|
|
183572
183724
|
return !queryOperation.directives?.find(
|
|
183573
|
-
(directive) => directive.name.value === page2.config.
|
|
183574
|
-
(arg) => arg.name.value === "load" && arg.value.kind === "BooleanValue" && !arg.value.value
|
|
183575
|
-
)
|
|
183725
|
+
(directive) => directive.name.value === page2.config.manualLoadDirective
|
|
183576
183726
|
);
|
|
183577
183727
|
},
|
|
183578
183728
|
dependency: page2.watch_file,
|
|
@@ -183594,9 +183744,6 @@ async function find_inline_queries(page2, parsed, store_id) {
|
|
|
183594
183744
|
};
|
|
183595
183745
|
});
|
|
183596
183746
|
}
|
|
183597
|
-
function query_variable_fn(name2) {
|
|
183598
|
-
return `${name2}Variables`;
|
|
183599
|
-
}
|
|
183600
183747
|
var local_input_id = (name2) => AST14.identifier(`_${name2}_Input`);
|
|
183601
183748
|
|
|
183602
183749
|
// src/plugin/transforms/kit/load.ts
|
|
@@ -183628,7 +183775,7 @@ async function kit_load_generator(page2) {
|
|
|
183628
183775
|
houdini_load_queries.push({
|
|
183629
183776
|
name: target.name.value,
|
|
183630
183777
|
variables: operation_requires_variables(target),
|
|
183631
|
-
store_id: AST15.memberExpression(AST15.identifier(
|
|
183778
|
+
store_id: AST15.memberExpression(AST15.identifier(houdini_load_fn), AST15.literal(i3))
|
|
183632
183779
|
});
|
|
183633
183780
|
}
|
|
183634
183781
|
if (script) {
|
|
@@ -183681,7 +183828,9 @@ function add_load({
|
|
|
183681
183828
|
if (!page_info.exports.includes(variable_fn) && query.variables) {
|
|
183682
183829
|
formatErrors({
|
|
183683
183830
|
filepath: page2.filepath,
|
|
183684
|
-
message: `Could not find required variable function: ${
|
|
183831
|
+
message: `Could not find required variable function: ${logYellow(
|
|
183832
|
+
variable_fn
|
|
183833
|
+
)}. maybe its not exported? `
|
|
183685
183834
|
});
|
|
183686
183835
|
invalid = true;
|
|
183687
183836
|
}
|
|
@@ -183701,9 +183850,9 @@ function add_load({
|
|
|
183701
183850
|
import: ["getCurrentConfig"],
|
|
183702
183851
|
sourceModule: "$houdini/runtime/lib/config"
|
|
183703
183852
|
});
|
|
183704
|
-
let before_load = page_info.exports.includes(
|
|
183705
|
-
let after_load = page_info.exports.includes(
|
|
183706
|
-
let on_error = page_info.exports.includes(
|
|
183853
|
+
let before_load = page_info.exports.includes(houdini_before_load_fn);
|
|
183854
|
+
let after_load = page_info.exports.includes(houdini_after_load_fn);
|
|
183855
|
+
let on_error = page_info.exports.includes(houdini_on_error_fn);
|
|
183707
183856
|
const request_context = AST15.identifier("houdini_context");
|
|
183708
183857
|
const promise_list = AST15.identifier("promises");
|
|
183709
183858
|
const return_value = AST15.memberExpression(request_context, AST15.identifier("returnValue"));
|
|
@@ -183865,7 +184014,7 @@ function add_load({
|
|
|
183865
184014
|
),
|
|
183866
184015
|
AST15.objectProperty(
|
|
183867
184016
|
AST15.literal("hookFn"),
|
|
183868
|
-
AST15.identifier(
|
|
184017
|
+
AST15.identifier(houdini_on_error_fn)
|
|
183869
184018
|
),
|
|
183870
184019
|
AST15.objectProperty(
|
|
183871
184020
|
AST15.literal("error"),
|
|
@@ -183883,14 +184032,14 @@ function add_load({
|
|
|
183883
184032
|
);
|
|
183884
184033
|
if (before_load) {
|
|
183885
184034
|
if (before_load) {
|
|
183886
|
-
preload_fn.body.body.splice(1, 0, load_hook_statements("
|
|
184035
|
+
preload_fn.body.body.splice(1, 0, load_hook_statements("before", ...args));
|
|
183887
184036
|
}
|
|
183888
184037
|
}
|
|
183889
184038
|
if (after_load) {
|
|
183890
184039
|
preload_fn.body.body.splice(
|
|
183891
184040
|
preload_fn.body.body.length - 1,
|
|
183892
184041
|
0,
|
|
183893
|
-
load_hook_statements("
|
|
184042
|
+
load_hook_statements("after", ...args)
|
|
183894
184043
|
);
|
|
183895
184044
|
}
|
|
183896
184045
|
}
|
|
@@ -183925,12 +184074,14 @@ function load_hook_statements(name2, request_context, input_id, result_id) {
|
|
|
183925
184074
|
AST15.memberExpression(request_context, AST15.identifier("invokeLoadHook")),
|
|
183926
184075
|
[
|
|
183927
184076
|
AST15.objectExpression([
|
|
184077
|
+
AST15.objectProperty(AST15.literal("variant"), AST15.stringLiteral(name2)),
|
|
183928
184078
|
AST15.objectProperty(
|
|
183929
|
-
AST15.literal("
|
|
183930
|
-
AST15.
|
|
184079
|
+
AST15.literal("hookFn"),
|
|
184080
|
+
AST15.identifier(
|
|
184081
|
+
name2 === "before" ? houdini_before_load_fn : houdini_after_load_fn
|
|
184082
|
+
)
|
|
183931
184083
|
),
|
|
183932
|
-
|
|
183933
|
-
...name2 === "afterLoad" ? [
|
|
184084
|
+
...name2 === "after" ? [
|
|
183934
184085
|
AST15.objectProperty(AST15.literal("input"), input_id),
|
|
183935
184086
|
AST15.objectProperty(AST15.literal("data"), result_id)
|
|
183936
184087
|
] : []
|
|
@@ -184060,7 +184211,7 @@ function modify_load(page2, cb) {
|
|
|
184060
184211
|
}
|
|
184061
184212
|
|
|
184062
184213
|
// src/plugin/transforms/kit/index.ts
|
|
184063
|
-
async function SvelteKitProcessor(
|
|
184214
|
+
async function SvelteKitProcessor(config3, page2) {
|
|
184064
184215
|
if (page2.framework !== "kit") {
|
|
184065
184216
|
return;
|
|
184066
184217
|
}
|
|
@@ -184183,8 +184334,8 @@ function walk2(ast, { enter, leave }) {
|
|
|
184183
184334
|
// src/plugin/transforms/reactive.ts
|
|
184184
184335
|
var recast17 = __toESM(require_main4(), 1);
|
|
184185
184336
|
var AST17 = recast17.types.builders;
|
|
184186
|
-
async function ReactiveProcessor(
|
|
184187
|
-
if (!is_component(
|
|
184337
|
+
async function ReactiveProcessor(config3, page2) {
|
|
184338
|
+
if (!is_component(config3, page2.framework, page2.filepath) && !is_route(config3, page2.framework, page2.filepath)) {
|
|
184188
184339
|
return;
|
|
184189
184340
|
}
|
|
184190
184341
|
const magicFunctions = ["query", "graphql", "fragment", "paginatedFragment", "paginatedQuery"];
|
|
@@ -184246,12 +184397,12 @@ function filterTaggedTemplate(expr) {
|
|
|
184246
184397
|
}
|
|
184247
184398
|
|
|
184248
184399
|
// src/plugin/transforms/tags.ts
|
|
184249
|
-
async function GraphQLTagProcessor(
|
|
184250
|
-
await find_graphql(
|
|
184400
|
+
async function GraphQLTagProcessor(config3, page2) {
|
|
184401
|
+
await find_graphql(config3, page2.script, {
|
|
184251
184402
|
dependency: page2.watch_file,
|
|
184252
184403
|
tag(tag2) {
|
|
184253
184404
|
const { node: node2, parsedDocument } = tag2;
|
|
184254
|
-
const operation =
|
|
184405
|
+
const operation = config3.extractDefinition(parsedDocument);
|
|
184255
184406
|
node2.replaceWith(store_import({ page: page2, artifact: { name: operation.name.value } }).id);
|
|
184256
184407
|
}
|
|
184257
184408
|
});
|
|
@@ -184308,10 +184459,10 @@ var replace_between = (origin, startIndex, endIndex, insertion) => origin.substr
|
|
|
184308
184459
|
function houdiniPreprocessor(extraConfig) {
|
|
184309
184460
|
return {
|
|
184310
184461
|
async markup({ content, filename }) {
|
|
184311
|
-
const
|
|
184462
|
+
const config3 = await getConfig(extraConfig);
|
|
184312
184463
|
const page2 = {
|
|
184313
184464
|
content,
|
|
184314
|
-
config:
|
|
184465
|
+
config: config3,
|
|
184315
184466
|
filepath: filename,
|
|
184316
184467
|
watch_file: () => {
|
|
184317
184468
|
}
|