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.
@@ -3637,25 +3637,25 @@ var require_definition2 = __commonJS({
3637
3637
  return arr && arr.length > 0 ? arr : void 0;
3638
3638
  }
3639
3639
  var GraphQLScalarType = /* @__PURE__ */ function() {
3640
- function GraphQLScalarType2(config2) {
3640
+ function GraphQLScalarType2(config3) {
3641
3641
  var _config$parseValue, _config$serialize, _config$parseLiteral;
3642
- var parseValue = (_config$parseValue = config2.parseValue) !== null && _config$parseValue !== void 0 ? _config$parseValue : _identityFunc.default;
3643
- this.name = config2.name;
3644
- this.description = config2.description;
3645
- this.specifiedByUrl = config2.specifiedByUrl;
3646
- this.serialize = (_config$serialize = config2.serialize) !== null && _config$serialize !== void 0 ? _config$serialize : _identityFunc.default;
3642
+ var parseValue = (_config$parseValue = config3.parseValue) !== null && _config$parseValue !== void 0 ? _config$parseValue : _identityFunc.default;
3643
+ this.name = config3.name;
3644
+ this.description = config3.description;
3645
+ this.specifiedByUrl = config3.specifiedByUrl;
3646
+ this.serialize = (_config$serialize = config3.serialize) !== null && _config$serialize !== void 0 ? _config$serialize : _identityFunc.default;
3647
3647
  this.parseValue = parseValue;
3648
- this.parseLiteral = (_config$parseLiteral = config2.parseLiteral) !== null && _config$parseLiteral !== void 0 ? _config$parseLiteral : function(node2, variables) {
3648
+ this.parseLiteral = (_config$parseLiteral = config3.parseLiteral) !== null && _config$parseLiteral !== void 0 ? _config$parseLiteral : function(node2, variables) {
3649
3649
  return parseValue((0, _valueFromASTUntyped.valueFromASTUntyped)(node2, variables));
3650
3650
  };
3651
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
3652
- this.astNode = config2.astNode;
3653
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
3654
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
3655
- config2.specifiedByUrl == null || typeof config2.specifiedByUrl === "string" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide "specifiedByUrl" as a string, ') + "but got: ".concat((0, _inspect.default)(config2.specifiedByUrl), "."));
3656
- config2.serialize == null || typeof config2.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.'));
3657
- if (config2.parseLiteral) {
3658
- typeof config2.parseValue === "function" && typeof config2.parseLiteral === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide both "parseValue" and "parseLiteral" functions.'));
3651
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
3652
+ this.astNode = config3.astNode;
3653
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
3654
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
3655
+ 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), "."));
3656
+ 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.'));
3657
+ if (config3.parseLiteral) {
3658
+ typeof config3.parseValue === "function" && typeof config3.parseLiteral === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide both "parseValue" and "parseLiteral" functions.'));
3659
3659
  }
3660
3660
  }
3661
3661
  var _proto = GraphQLScalarType2.prototype;
@@ -3690,17 +3690,17 @@ var require_definition2 = __commonJS({
3690
3690
  exports.GraphQLScalarType = GraphQLScalarType;
3691
3691
  (0, _defineInspect.default)(GraphQLScalarType);
3692
3692
  var GraphQLObjectType = /* @__PURE__ */ function() {
3693
- function GraphQLObjectType2(config2) {
3694
- this.name = config2.name;
3695
- this.description = config2.description;
3696
- this.isTypeOf = config2.isTypeOf;
3697
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
3698
- this.astNode = config2.astNode;
3699
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
3700
- this._fields = defineFieldMap.bind(void 0, config2);
3701
- this._interfaces = defineInterfaces.bind(void 0, config2);
3702
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
3703
- config2.isTypeOf == null || typeof config2.isTypeOf === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide "isTypeOf" as a function, ') + "but got: ".concat((0, _inspect.default)(config2.isTypeOf), "."));
3693
+ function GraphQLObjectType2(config3) {
3694
+ this.name = config3.name;
3695
+ this.description = config3.description;
3696
+ this.isTypeOf = config3.isTypeOf;
3697
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
3698
+ this.astNode = config3.astNode;
3699
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
3700
+ this._fields = defineFieldMap.bind(void 0, config3);
3701
+ this._interfaces = defineInterfaces.bind(void 0, config3);
3702
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
3703
+ 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), "."));
3704
3704
  }
3705
3705
  var _proto2 = GraphQLObjectType2.prototype;
3706
3706
  _proto2.getFields = function getFields() {
@@ -3743,22 +3743,22 @@ var require_definition2 = __commonJS({
3743
3743
  }();
3744
3744
  exports.GraphQLObjectType = GraphQLObjectType;
3745
3745
  (0, _defineInspect.default)(GraphQLObjectType);
3746
- function defineInterfaces(config2) {
3746
+ function defineInterfaces(config3) {
3747
3747
  var _resolveThunk;
3748
- var interfaces = (_resolveThunk = resolveThunk(config2.interfaces)) !== null && _resolveThunk !== void 0 ? _resolveThunk : [];
3749
- Array.isArray(interfaces) || (0, _devAssert.default)(0, "".concat(config2.name, " interfaces must be an Array or a function which returns an Array."));
3748
+ var interfaces = (_resolveThunk = resolveThunk(config3.interfaces)) !== null && _resolveThunk !== void 0 ? _resolveThunk : [];
3749
+ Array.isArray(interfaces) || (0, _devAssert.default)(0, "".concat(config3.name, " interfaces must be an Array or a function which returns an Array."));
3750
3750
  return interfaces;
3751
3751
  }
3752
- function defineFieldMap(config2) {
3753
- var fieldMap = resolveThunk(config2.fields);
3754
- isPlainObj(fieldMap) || (0, _devAssert.default)(0, "".concat(config2.name, " fields must be an object with field names as keys or a function which returns such an object."));
3752
+ function defineFieldMap(config3) {
3753
+ var fieldMap = resolveThunk(config3.fields);
3754
+ 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."));
3755
3755
  return (0, _mapValue.default)(fieldMap, function(fieldConfig, fieldName) {
3756
3756
  var _fieldConfig$args;
3757
- isPlainObj(fieldConfig) || (0, _devAssert.default)(0, "".concat(config2.name, ".").concat(fieldName, " field config must be an object."));
3758
- !("isDeprecated" in fieldConfig) || (0, _devAssert.default)(0, "".concat(config2.name, ".").concat(fieldName, ' should provide "deprecationReason" instead of "isDeprecated".'));
3759
- fieldConfig.resolve == null || typeof fieldConfig.resolve === "function" || (0, _devAssert.default)(0, "".concat(config2.name, ".").concat(fieldName, " field resolver must be a function if ") + "provided, but got: ".concat((0, _inspect.default)(fieldConfig.resolve), "."));
3757
+ isPlainObj(fieldConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, " field config must be an object."));
3758
+ !("isDeprecated" in fieldConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, ' should provide "deprecationReason" instead of "isDeprecated".'));
3759
+ 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), "."));
3760
3760
  var argsConfig = (_fieldConfig$args = fieldConfig.args) !== null && _fieldConfig$args !== void 0 ? _fieldConfig$args : {};
3761
- isPlainObj(argsConfig) || (0, _devAssert.default)(0, "".concat(config2.name, ".").concat(fieldName, " args must be an object with argument names as keys."));
3761
+ isPlainObj(argsConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, " args must be an object with argument names as keys."));
3762
3762
  var args = (0, _objectEntries.default)(argsConfig).map(function(_ref) {
3763
3763
  var argName = _ref[0], argConfig = _ref[1];
3764
3764
  return {
@@ -3820,17 +3820,17 @@ var require_definition2 = __commonJS({
3820
3820
  return isNonNullType(arg.type) && arg.defaultValue === void 0;
3821
3821
  }
3822
3822
  var GraphQLInterfaceType = /* @__PURE__ */ function() {
3823
- function GraphQLInterfaceType2(config2) {
3824
- this.name = config2.name;
3825
- this.description = config2.description;
3826
- this.resolveType = config2.resolveType;
3827
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
3828
- this.astNode = config2.astNode;
3829
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
3830
- this._fields = defineFieldMap.bind(void 0, config2);
3831
- this._interfaces = defineInterfaces.bind(void 0, config2);
3832
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
3833
- config2.resolveType == null || typeof config2.resolveType === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide "resolveType" as a function, ') + "but got: ".concat((0, _inspect.default)(config2.resolveType), "."));
3823
+ function GraphQLInterfaceType2(config3) {
3824
+ this.name = config3.name;
3825
+ this.description = config3.description;
3826
+ this.resolveType = config3.resolveType;
3827
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
3828
+ this.astNode = config3.astNode;
3829
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
3830
+ this._fields = defineFieldMap.bind(void 0, config3);
3831
+ this._interfaces = defineInterfaces.bind(void 0, config3);
3832
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
3833
+ 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), "."));
3834
3834
  }
3835
3835
  var _proto3 = GraphQLInterfaceType2.prototype;
3836
3836
  _proto3.getFields = function getFields() {
@@ -3875,16 +3875,16 @@ var require_definition2 = __commonJS({
3875
3875
  exports.GraphQLInterfaceType = GraphQLInterfaceType;
3876
3876
  (0, _defineInspect.default)(GraphQLInterfaceType);
3877
3877
  var GraphQLUnionType = /* @__PURE__ */ function() {
3878
- function GraphQLUnionType2(config2) {
3879
- this.name = config2.name;
3880
- this.description = config2.description;
3881
- this.resolveType = config2.resolveType;
3882
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
3883
- this.astNode = config2.astNode;
3884
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
3885
- this._types = defineTypes.bind(void 0, config2);
3886
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
3887
- config2.resolveType == null || typeof config2.resolveType === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide "resolveType" as a function, ') + "but got: ".concat((0, _inspect.default)(config2.resolveType), "."));
3878
+ function GraphQLUnionType2(config3) {
3879
+ this.name = config3.name;
3880
+ this.description = config3.description;
3881
+ this.resolveType = config3.resolveType;
3882
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
3883
+ this.astNode = config3.astNode;
3884
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
3885
+ this._types = defineTypes.bind(void 0, config3);
3886
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
3887
+ 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), "."));
3888
3888
  }
3889
3889
  var _proto4 = GraphQLUnionType2.prototype;
3890
3890
  _proto4.getTypes = function getTypes() {
@@ -3921,26 +3921,26 @@ var require_definition2 = __commonJS({
3921
3921
  }();
3922
3922
  exports.GraphQLUnionType = GraphQLUnionType;
3923
3923
  (0, _defineInspect.default)(GraphQLUnionType);
3924
- function defineTypes(config2) {
3925
- var types11 = resolveThunk(config2.types);
3926
- Array.isArray(types11) || (0, _devAssert.default)(0, "Must provide Array of types or a function which returns such an array for Union ".concat(config2.name, "."));
3924
+ function defineTypes(config3) {
3925
+ var types11 = resolveThunk(config3.types);
3926
+ 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, "."));
3927
3927
  return types11;
3928
3928
  }
3929
3929
  var GraphQLEnumType = /* @__PURE__ */ function() {
3930
- function GraphQLEnumType2(config2) {
3931
- this.name = config2.name;
3932
- this.description = config2.description;
3933
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
3934
- this.astNode = config2.astNode;
3935
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
3936
- this._values = defineEnumValues(this.name, config2.values);
3930
+ function GraphQLEnumType2(config3) {
3931
+ this.name = config3.name;
3932
+ this.description = config3.description;
3933
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
3934
+ this.astNode = config3.astNode;
3935
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
3936
+ this._values = defineEnumValues(this.name, config3.values);
3937
3937
  this._valueLookup = new Map(this._values.map(function(enumValue) {
3938
3938
  return [enumValue.value, enumValue];
3939
3939
  }));
3940
3940
  this._nameLookup = (0, _keyMap.default)(this._values, function(value2) {
3941
3941
  return value2.name;
3942
3942
  });
3943
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
3943
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
3944
3944
  }
3945
3945
  var _proto5 = GraphQLEnumType2.prototype;
3946
3946
  _proto5.getValues = function getValues() {
@@ -4042,14 +4042,14 @@ var require_definition2 = __commonJS({
4042
4042
  });
4043
4043
  }
4044
4044
  var GraphQLInputObjectType = /* @__PURE__ */ function() {
4045
- function GraphQLInputObjectType2(config2) {
4046
- this.name = config2.name;
4047
- this.description = config2.description;
4048
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
4049
- this.astNode = config2.astNode;
4050
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
4051
- this._fields = defineInputFieldMap.bind(void 0, config2);
4052
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
4045
+ function GraphQLInputObjectType2(config3) {
4046
+ this.name = config3.name;
4047
+ this.description = config3.description;
4048
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
4049
+ this.astNode = config3.astNode;
4050
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
4051
+ this._fields = defineInputFieldMap.bind(void 0, config3);
4052
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
4053
4053
  }
4054
4054
  var _proto6 = GraphQLInputObjectType2.prototype;
4055
4055
  _proto6.getFields = function getFields() {
@@ -4095,11 +4095,11 @@ var require_definition2 = __commonJS({
4095
4095
  }();
4096
4096
  exports.GraphQLInputObjectType = GraphQLInputObjectType;
4097
4097
  (0, _defineInspect.default)(GraphQLInputObjectType);
4098
- function defineInputFieldMap(config2) {
4099
- var fieldMap = resolveThunk(config2.fields);
4100
- isPlainObj(fieldMap) || (0, _devAssert.default)(0, "".concat(config2.name, " fields must be an object with field names as keys or a function which returns such an object."));
4098
+ function defineInputFieldMap(config3) {
4099
+ var fieldMap = resolveThunk(config3.fields);
4100
+ 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."));
4101
4101
  return (0, _mapValue.default)(fieldMap, function(fieldConfig, fieldName) {
4102
- !("resolve" in fieldConfig) || (0, _devAssert.default)(0, "".concat(config2.name, ".").concat(fieldName, " field has a resolve property, but Input Types cannot define resolvers."));
4102
+ !("resolve" in fieldConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, " field has a resolve property, but Input Types cannot define resolvers."));
4103
4103
  return {
4104
4104
  name: fieldName,
4105
4105
  description: fieldConfig.description,
@@ -5296,18 +5296,18 @@ var require_directives2 = __commonJS({
5296
5296
  return directive;
5297
5297
  }
5298
5298
  var GraphQLDirective = /* @__PURE__ */ function() {
5299
- function GraphQLDirective2(config2) {
5299
+ function GraphQLDirective2(config3) {
5300
5300
  var _config$isRepeatable, _config$args;
5301
- this.name = config2.name;
5302
- this.description = config2.description;
5303
- this.locations = config2.locations;
5304
- this.isRepeatable = (_config$isRepeatable = config2.isRepeatable) !== null && _config$isRepeatable !== void 0 ? _config$isRepeatable : false;
5305
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
5306
- this.astNode = config2.astNode;
5307
- config2.name || (0, _devAssert.default)(0, "Directive must be named.");
5308
- Array.isArray(config2.locations) || (0, _devAssert.default)(0, "@".concat(config2.name, " locations must be an Array."));
5309
- var args = (_config$args = config2.args) !== null && _config$args !== void 0 ? _config$args : {};
5310
- (0, _isObjectLike.default)(args) && !Array.isArray(args) || (0, _devAssert.default)(0, "@".concat(config2.name, " args must be an object with argument names as keys."));
5301
+ this.name = config3.name;
5302
+ this.description = config3.description;
5303
+ this.locations = config3.locations;
5304
+ this.isRepeatable = (_config$isRepeatable = config3.isRepeatable) !== null && _config$isRepeatable !== void 0 ? _config$isRepeatable : false;
5305
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
5306
+ this.astNode = config3.astNode;
5307
+ config3.name || (0, _devAssert.default)(0, "Directive must be named.");
5308
+ Array.isArray(config3.locations) || (0, _devAssert.default)(0, "@".concat(config3.name, " locations must be an Array."));
5309
+ var args = (_config$args = config3.args) !== null && _config$args !== void 0 ? _config$args : {};
5310
+ (0, _isObjectLike.default)(args) && !Array.isArray(args) || (0, _devAssert.default)(0, "@".concat(config3.name, " args must be an object with argument names as keys."));
5311
5311
  this.args = (0, _objectEntries.default)(args).map(function(_ref) {
5312
5312
  var argName = _ref[0], argConfig = _ref[1];
5313
5313
  return {
@@ -5463,23 +5463,23 @@ var require_schema2 = __commonJS({
5463
5463
  return schema;
5464
5464
  }
5465
5465
  var GraphQLSchema = /* @__PURE__ */ function() {
5466
- function GraphQLSchema2(config2) {
5466
+ function GraphQLSchema2(config3) {
5467
5467
  var _config$directives;
5468
- this.__validationErrors = config2.assumeValid === true ? [] : void 0;
5469
- (0, _isObjectLike.default)(config2) || (0, _devAssert.default)(0, "Must provide configuration object.");
5470
- !config2.types || Array.isArray(config2.types) || (0, _devAssert.default)(0, '"types" must be Array if provided but got: '.concat((0, _inspect.default)(config2.types), "."));
5471
- !config2.directives || Array.isArray(config2.directives) || (0, _devAssert.default)(0, '"directives" must be Array if provided but got: ' + "".concat((0, _inspect.default)(config2.directives), "."));
5472
- this.description = config2.description;
5473
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
5474
- this.astNode = config2.astNode;
5475
- this.extensionASTNodes = config2.extensionASTNodes;
5476
- this._queryType = config2.query;
5477
- this._mutationType = config2.mutation;
5478
- this._subscriptionType = config2.subscription;
5479
- this._directives = (_config$directives = config2.directives) !== null && _config$directives !== void 0 ? _config$directives : _directives.specifiedDirectives;
5480
- var allReferencedTypes = new Set(config2.types);
5481
- if (config2.types != null) {
5482
- for (var _i2 = 0, _config$types2 = config2.types; _i2 < _config$types2.length; _i2++) {
5468
+ this.__validationErrors = config3.assumeValid === true ? [] : void 0;
5469
+ (0, _isObjectLike.default)(config3) || (0, _devAssert.default)(0, "Must provide configuration object.");
5470
+ !config3.types || Array.isArray(config3.types) || (0, _devAssert.default)(0, '"types" must be Array if provided but got: '.concat((0, _inspect.default)(config3.types), "."));
5471
+ !config3.directives || Array.isArray(config3.directives) || (0, _devAssert.default)(0, '"directives" must be Array if provided but got: ' + "".concat((0, _inspect.default)(config3.directives), "."));
5472
+ this.description = config3.description;
5473
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
5474
+ this.astNode = config3.astNode;
5475
+ this.extensionASTNodes = config3.extensionASTNodes;
5476
+ this._queryType = config3.query;
5477
+ this._mutationType = config3.mutation;
5478
+ this._subscriptionType = config3.subscription;
5479
+ this._directives = (_config$directives = config3.directives) !== null && _config$directives !== void 0 ? _config$directives : _directives.specifiedDirectives;
5480
+ var allReferencedTypes = new Set(config3.types);
5481
+ if (config3.types != null) {
5482
+ for (var _i2 = 0, _config$types2 = config3.types; _i2 < _config$types2.length; _i2++) {
5483
5483
  var type = _config$types2[_i2];
5484
5484
  allReferencedTypes.delete(type);
5485
5485
  collectReferencedTypes(type, allReferencedTypes);
@@ -11805,9 +11805,9 @@ var require_extendSchema2 = __commonJS({
11805
11805
  return typeMap[type.name];
11806
11806
  }
11807
11807
  function replaceDirective(directive) {
11808
- var config2 = directive.toConfig();
11809
- return new _directives.GraphQLDirective(_objectSpread(_objectSpread({}, config2), {}, {
11810
- args: (0, _mapValue.default)(config2.args, extendArg)
11808
+ var config3 = directive.toConfig();
11809
+ return new _directives.GraphQLDirective(_objectSpread(_objectSpread({}, config3), {}, {
11810
+ args: (0, _mapValue.default)(config3.args, extendArg)
11811
11811
  }));
11812
11812
  }
11813
11813
  function extendNamedType(type) {
@@ -11836,80 +11836,80 @@ var require_extendSchema2 = __commonJS({
11836
11836
  }
11837
11837
  function extendInputObjectType(type) {
11838
11838
  var _typeExtensionsMap$co;
11839
- var config2 = type.toConfig();
11840
- var extensions = (_typeExtensionsMap$co = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co !== void 0 ? _typeExtensionsMap$co : [];
11841
- return new _definition.GraphQLInputObjectType(_objectSpread(_objectSpread({}, config2), {}, {
11839
+ var config3 = type.toConfig();
11840
+ var extensions = (_typeExtensionsMap$co = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co !== void 0 ? _typeExtensionsMap$co : [];
11841
+ return new _definition.GraphQLInputObjectType(_objectSpread(_objectSpread({}, config3), {}, {
11842
11842
  fields: function fields() {
11843
- return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config2.fields, function(field) {
11843
+ return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config3.fields, function(field) {
11844
11844
  return _objectSpread(_objectSpread({}, field), {}, {
11845
11845
  type: replaceType(field.type)
11846
11846
  });
11847
11847
  })), buildInputFieldMap(extensions));
11848
11848
  },
11849
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
11849
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
11850
11850
  }));
11851
11851
  }
11852
11852
  function extendEnumType(type) {
11853
11853
  var _typeExtensionsMap$ty;
11854
- var config2 = type.toConfig();
11854
+ var config3 = type.toConfig();
11855
11855
  var extensions = (_typeExtensionsMap$ty = typeExtensionsMap[type.name]) !== null && _typeExtensionsMap$ty !== void 0 ? _typeExtensionsMap$ty : [];
11856
- return new _definition.GraphQLEnumType(_objectSpread(_objectSpread({}, config2), {}, {
11857
- values: _objectSpread(_objectSpread({}, config2.values), buildEnumValueMap(extensions)),
11858
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
11856
+ return new _definition.GraphQLEnumType(_objectSpread(_objectSpread({}, config3), {}, {
11857
+ values: _objectSpread(_objectSpread({}, config3.values), buildEnumValueMap(extensions)),
11858
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
11859
11859
  }));
11860
11860
  }
11861
11861
  function extendScalarType(type) {
11862
11862
  var _typeExtensionsMap$co2;
11863
- var config2 = type.toConfig();
11864
- var extensions = (_typeExtensionsMap$co2 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co2 !== void 0 ? _typeExtensionsMap$co2 : [];
11865
- var specifiedByUrl = config2.specifiedByUrl;
11863
+ var config3 = type.toConfig();
11864
+ var extensions = (_typeExtensionsMap$co2 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co2 !== void 0 ? _typeExtensionsMap$co2 : [];
11865
+ var specifiedByUrl = config3.specifiedByUrl;
11866
11866
  for (var _i8 = 0; _i8 < extensions.length; _i8++) {
11867
11867
  var _getSpecifiedByUrl;
11868
11868
  var extensionNode = extensions[_i8];
11869
11869
  specifiedByUrl = (_getSpecifiedByUrl = getSpecifiedByUrl(extensionNode)) !== null && _getSpecifiedByUrl !== void 0 ? _getSpecifiedByUrl : specifiedByUrl;
11870
11870
  }
11871
- return new _definition.GraphQLScalarType(_objectSpread(_objectSpread({}, config2), {}, {
11871
+ return new _definition.GraphQLScalarType(_objectSpread(_objectSpread({}, config3), {}, {
11872
11872
  specifiedByUrl,
11873
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
11873
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
11874
11874
  }));
11875
11875
  }
11876
11876
  function extendObjectType(type) {
11877
11877
  var _typeExtensionsMap$co3;
11878
- var config2 = type.toConfig();
11879
- var extensions = (_typeExtensionsMap$co3 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co3 !== void 0 ? _typeExtensionsMap$co3 : [];
11880
- return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config2), {}, {
11878
+ var config3 = type.toConfig();
11879
+ var extensions = (_typeExtensionsMap$co3 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co3 !== void 0 ? _typeExtensionsMap$co3 : [];
11880
+ return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config3), {}, {
11881
11881
  interfaces: function interfaces() {
11882
11882
  return [].concat(type.getInterfaces().map(replaceNamedType), buildInterfaces(extensions));
11883
11883
  },
11884
11884
  fields: function fields() {
11885
- return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config2.fields, extendField)), buildFieldMap(extensions));
11885
+ return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config3.fields, extendField)), buildFieldMap(extensions));
11886
11886
  },
11887
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
11887
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
11888
11888
  }));
11889
11889
  }
11890
11890
  function extendInterfaceType(type) {
11891
11891
  var _typeExtensionsMap$co4;
11892
- var config2 = type.toConfig();
11893
- var extensions = (_typeExtensionsMap$co4 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co4 !== void 0 ? _typeExtensionsMap$co4 : [];
11894
- return new _definition.GraphQLInterfaceType(_objectSpread(_objectSpread({}, config2), {}, {
11892
+ var config3 = type.toConfig();
11893
+ var extensions = (_typeExtensionsMap$co4 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co4 !== void 0 ? _typeExtensionsMap$co4 : [];
11894
+ return new _definition.GraphQLInterfaceType(_objectSpread(_objectSpread({}, config3), {}, {
11895
11895
  interfaces: function interfaces() {
11896
11896
  return [].concat(type.getInterfaces().map(replaceNamedType), buildInterfaces(extensions));
11897
11897
  },
11898
11898
  fields: function fields() {
11899
- return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config2.fields, extendField)), buildFieldMap(extensions));
11899
+ return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config3.fields, extendField)), buildFieldMap(extensions));
11900
11900
  },
11901
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
11901
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
11902
11902
  }));
11903
11903
  }
11904
11904
  function extendUnionType(type) {
11905
11905
  var _typeExtensionsMap$co5;
11906
- var config2 = type.toConfig();
11907
- var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
11908
- return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config2), {}, {
11906
+ var config3 = type.toConfig();
11907
+ var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
11908
+ return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config3), {}, {
11909
11909
  types: function types11() {
11910
11910
  return [].concat(type.getTypes().map(replaceNamedType), buildUnionTypes(extensions));
11911
11911
  },
11912
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
11912
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
11913
11913
  }));
11914
11914
  }
11915
11915
  function extendField(field) {
@@ -12226,24 +12226,24 @@ var require_buildASTSchema2 = __commonJS({
12226
12226
  extensionASTNodes: [],
12227
12227
  assumeValid: false
12228
12228
  };
12229
- var config2 = (0, _extendSchema.extendSchemaImpl)(emptySchemaConfig, documentAST, options);
12230
- if (config2.astNode == null) {
12231
- for (var _i2 = 0, _config$types2 = config2.types; _i2 < _config$types2.length; _i2++) {
12229
+ var config3 = (0, _extendSchema.extendSchemaImpl)(emptySchemaConfig, documentAST, options);
12230
+ if (config3.astNode == null) {
12231
+ for (var _i2 = 0, _config$types2 = config3.types; _i2 < _config$types2.length; _i2++) {
12232
12232
  var type = _config$types2[_i2];
12233
12233
  switch (type.name) {
12234
12234
  case "Query":
12235
- config2.query = type;
12235
+ config3.query = type;
12236
12236
  break;
12237
12237
  case "Mutation":
12238
- config2.mutation = type;
12238
+ config3.mutation = type;
12239
12239
  break;
12240
12240
  case "Subscription":
12241
- config2.subscription = type;
12241
+ config3.subscription = type;
12242
12242
  break;
12243
12243
  }
12244
12244
  }
12245
12245
  }
12246
- var directives = config2.directives;
12246
+ var directives = config3.directives;
12247
12247
  var _loop = function _loop2(_i42) {
12248
12248
  var stdDirective = _directives.specifiedDirectives[_i42];
12249
12249
  if (directives.every(function(directive) {
@@ -12255,7 +12255,7 @@ var require_buildASTSchema2 = __commonJS({
12255
12255
  for (var _i4 = 0; _i4 < _directives.specifiedDirectives.length; _i4++) {
12256
12256
  _loop(_i4);
12257
12257
  }
12258
- return new _schema.GraphQLSchema(config2);
12258
+ return new _schema.GraphQLSchema(config3);
12259
12259
  }
12260
12260
  function buildSchema(source, options) {
12261
12261
  var document = (0, _parser.parse)(source, {
@@ -12357,12 +12357,12 @@ var require_lexicographicSortSchema2 = __commonJS({
12357
12357
  return maybeType && replaceNamedType(maybeType);
12358
12358
  }
12359
12359
  function sortDirective(directive) {
12360
- var config2 = directive.toConfig();
12361
- return new _directives.GraphQLDirective(_objectSpread(_objectSpread({}, config2), {}, {
12362
- locations: sortBy(config2.locations, function(x4) {
12360
+ var config3 = directive.toConfig();
12361
+ return new _directives.GraphQLDirective(_objectSpread(_objectSpread({}, config3), {}, {
12362
+ locations: sortBy(config3.locations, function(x4) {
12363
12363
  return x4;
12364
12364
  }),
12365
- args: sortArgs(config2.args)
12365
+ args: sortArgs(config3.args)
12366
12366
  }));
12367
12367
  }
12368
12368
  function sortArgs(args) {
@@ -12395,13 +12395,13 @@ var require_lexicographicSortSchema2 = __commonJS({
12395
12395
  return type;
12396
12396
  }
12397
12397
  if ((0, _definition.isObjectType)(type)) {
12398
- var config2 = type.toConfig();
12399
- return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config2), {}, {
12398
+ var config3 = type.toConfig();
12399
+ return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config3), {}, {
12400
12400
  interfaces: function interfaces() {
12401
- return sortTypes(config2.interfaces);
12401
+ return sortTypes(config3.interfaces);
12402
12402
  },
12403
12403
  fields: function fields() {
12404
- return sortFields(config2.fields);
12404
+ return sortFields(config3.fields);
12405
12405
  }
12406
12406
  }));
12407
12407
  }
@@ -26499,13 +26499,13 @@ var require_esprima6 = __commonJS({
26499
26499
  return Reader2;
26500
26500
  }();
26501
26501
  var Tokenizer = function() {
26502
- function Tokenizer2(code, config2) {
26502
+ function Tokenizer2(code, config3) {
26503
26503
  this.errorHandler = new error_handler_1.ErrorHandler();
26504
- this.errorHandler.tolerant = config2 ? typeof config2.tolerant === "boolean" && config2.tolerant : false;
26504
+ this.errorHandler.tolerant = config3 ? typeof config3.tolerant === "boolean" && config3.tolerant : false;
26505
26505
  this.scanner = new scanner_1.Scanner(code, this.errorHandler);
26506
- this.scanner.trackComment = config2 ? typeof config2.comment === "boolean" && config2.comment : false;
26507
- this.trackRange = config2 ? typeof config2.range === "boolean" && config2.range : false;
26508
- this.trackLoc = config2 ? typeof config2.loc === "boolean" && config2.loc : false;
26506
+ this.scanner.trackComment = config3 ? typeof config3.comment === "boolean" && config3.comment : false;
26507
+ this.trackRange = config3 ? typeof config3.range === "boolean" && config3.range : false;
26508
+ this.trackLoc = config3 ? typeof config3.loc === "boolean" && config3.loc : false;
26509
26509
  this.buffer = [];
26510
26510
  this.reader = new Reader();
26511
26511
  }
@@ -28673,11 +28673,11 @@ var require_printer5 = __commonJS({
28673
28673
  return this.code;
28674
28674
  };
28675
28675
  var emptyPrintResult = new PrintResult("");
28676
- var Printer = function Printer2(config2) {
28676
+ var Printer = function Printer2(config3) {
28677
28677
  assert_1.default.ok(this instanceof Printer2);
28678
- var explicitTabWidth = config2 && config2.tabWidth;
28679
- config2 = options_1.normalize(config2);
28680
- config2.sourceFileName = null;
28678
+ var explicitTabWidth = config3 && config3.tabWidth;
28679
+ config3 = options_1.normalize(config3);
28680
+ config3.sourceFileName = null;
28681
28681
  function makePrintFunctionWith(options, overrides) {
28682
28682
  options = Object.assign({}, options, overrides);
28683
28683
  return function(path3) {
@@ -28692,19 +28692,19 @@ var require_printer5 = __commonJS({
28692
28692
  includeComments: false
28693
28693
  }));
28694
28694
  }
28695
- var oldTabWidth = config2.tabWidth;
28695
+ var oldTabWidth = config3.tabWidth;
28696
28696
  if (!explicitTabWidth) {
28697
28697
  var loc = path3.getNode().loc;
28698
28698
  if (loc && loc.lines && loc.lines.guessTabWidth) {
28699
- config2.tabWidth = loc.lines.guessTabWidth();
28699
+ config3.tabWidth = loc.lines.guessTabWidth();
28700
28700
  }
28701
28701
  }
28702
28702
  var reprinter = patcher_1.getReprinter(path3);
28703
- var lines = reprinter ? reprinter(print2) : genericPrint(path3, config2, options, makePrintFunctionWith(options, {
28703
+ var lines = reprinter ? reprinter(print2) : genericPrint(path3, config3, options, makePrintFunctionWith(options, {
28704
28704
  includeComments: true,
28705
28705
  avoidRootParens: false
28706
28706
  }));
28707
- config2.tabWidth = oldTabWidth;
28707
+ config3.tabWidth = oldTabWidth;
28708
28708
  return lines;
28709
28709
  }
28710
28710
  this.print = function(ast) {
@@ -28715,7 +28715,7 @@ var require_printer5 = __commonJS({
28715
28715
  includeComments: true,
28716
28716
  avoidRootParens: false
28717
28717
  });
28718
- return new PrintResult(lines.toString(config2), util.composeSourceMaps(config2.inputSourceMap, lines.getSourceMap(config2.sourceMapName, config2.sourceRoot)));
28718
+ return new PrintResult(lines.toString(config3), util.composeSourceMaps(config3.inputSourceMap, lines.getSourceMap(config3.sourceMapName, config3.sourceRoot)));
28719
28719
  };
28720
28720
  this.printGenerically = function(ast) {
28721
28721
  if (!ast) {
@@ -28723,26 +28723,26 @@ var require_printer5 = __commonJS({
28723
28723
  }
28724
28724
  function printGenerically(path4) {
28725
28725
  return comments_1.printComments(path4, function(path5) {
28726
- return genericPrint(path5, config2, {
28726
+ return genericPrint(path5, config3, {
28727
28727
  includeComments: true,
28728
28728
  avoidRootParens: false
28729
28729
  }, printGenerically);
28730
28730
  });
28731
28731
  }
28732
28732
  var path3 = fast_path_1.default.from(ast);
28733
- var oldReuseWhitespace = config2.reuseWhitespace;
28734
- config2.reuseWhitespace = false;
28735
- var pr = new PrintResult(printGenerically(path3).toString(config2));
28736
- config2.reuseWhitespace = oldReuseWhitespace;
28733
+ var oldReuseWhitespace = config3.reuseWhitespace;
28734
+ config3.reuseWhitespace = false;
28735
+ var pr = new PrintResult(printGenerically(path3).toString(config3));
28736
+ config3.reuseWhitespace = oldReuseWhitespace;
28737
28737
  return pr;
28738
28738
  };
28739
28739
  };
28740
28740
  exports.Printer = Printer;
28741
- function genericPrint(path3, config2, options, printPath) {
28741
+ function genericPrint(path3, config3, options, printPath) {
28742
28742
  assert_1.default.ok(path3 instanceof fast_path_1.default);
28743
28743
  var node2 = path3.getValue();
28744
28744
  var parts = [];
28745
- var linesWithoutParens = genericPrintNoParens(path3, config2, printPath);
28745
+ var linesWithoutParens = genericPrintNoParens(path3, config3, printPath);
28746
28746
  if (!node2 || linesWithoutParens.isEmpty()) {
28747
28747
  return linesWithoutParens;
28748
28748
  }
@@ -30808,10 +30808,10 @@ var require_main5 = __commonJS({
30808
30808
  }
30809
30809
  });
30810
30810
 
30811
- // ../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.547_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/runtime/control.js
30811
+ // ../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.577_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/runtime/control.js
30812
30812
  var HttpError, Redirect, ValidationError;
30813
30813
  var init_control = __esm({
30814
- "../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.547_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/runtime/control.js"() {
30814
+ "../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.577_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/runtime/control.js"() {
30815
30815
  HttpError = class {
30816
30816
  constructor(status, body) {
30817
30817
  this.status = status;
@@ -30842,7 +30842,7 @@ var init_control = __esm({
30842
30842
  }
30843
30843
  });
30844
30844
 
30845
- // ../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.547_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/exports/index.js
30845
+ // ../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.577_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/exports/index.js
30846
30846
  var exports_exports = {};
30847
30847
  __export(exports_exports, {
30848
30848
  error: () => error2,
@@ -30851,10 +30851,13 @@ __export(exports_exports, {
30851
30851
  redirect: () => redirect
30852
30852
  });
30853
30853
  function error2(status, message) {
30854
+ if ((!__SVELTEKIT_BROWSER__ || __SVELTEKIT_DEV__) && (isNaN(status) || status < 400 || status > 599)) {
30855
+ throw new Error(`HTTP error status codes must be between 400 and 599 \u2014 ${status} is invalid`);
30856
+ }
30854
30857
  return new HttpError(status, message);
30855
30858
  }
30856
30859
  function redirect(status, location) {
30857
- if (isNaN(status) || status < 300 || status > 308) {
30860
+ if ((!__SVELTEKIT_BROWSER__ || __SVELTEKIT_DEV__) && (isNaN(status) || status < 300 || status > 308)) {
30858
30861
  throw new Error("Invalid status code");
30859
30862
  }
30860
30863
  return new Redirect(status, location);
@@ -30873,7 +30876,7 @@ function invalid(status, data2) {
30873
30876
  return new ValidationError(status, data2);
30874
30877
  }
30875
30878
  var init_exports = __esm({
30876
- "../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.547_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/exports/index.js"() {
30879
+ "../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.577_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/exports/index.js"() {
30877
30880
  init_control();
30878
30881
  }
30879
30882
  });
@@ -34454,25 +34457,25 @@ var require_definition = __commonJS2({
34454
34457
  return arr && arr.length > 0 ? arr : void 0;
34455
34458
  }
34456
34459
  var GraphQLScalarType4 = /* @__PURE__ */ function() {
34457
- function GraphQLScalarType5(config2) {
34460
+ function GraphQLScalarType5(config3) {
34458
34461
  var _config$parseValue, _config$serialize, _config$parseLiteral;
34459
- var parseValue = (_config$parseValue = config2.parseValue) !== null && _config$parseValue !== void 0 ? _config$parseValue : _identityFunc.default;
34460
- this.name = config2.name;
34461
- this.description = config2.description;
34462
- this.specifiedByUrl = config2.specifiedByUrl;
34463
- this.serialize = (_config$serialize = config2.serialize) !== null && _config$serialize !== void 0 ? _config$serialize : _identityFunc.default;
34462
+ var parseValue = (_config$parseValue = config3.parseValue) !== null && _config$parseValue !== void 0 ? _config$parseValue : _identityFunc.default;
34463
+ this.name = config3.name;
34464
+ this.description = config3.description;
34465
+ this.specifiedByUrl = config3.specifiedByUrl;
34466
+ this.serialize = (_config$serialize = config3.serialize) !== null && _config$serialize !== void 0 ? _config$serialize : _identityFunc.default;
34464
34467
  this.parseValue = parseValue;
34465
- this.parseLiteral = (_config$parseLiteral = config2.parseLiteral) !== null && _config$parseLiteral !== void 0 ? _config$parseLiteral : function(node2, variables) {
34468
+ this.parseLiteral = (_config$parseLiteral = config3.parseLiteral) !== null && _config$parseLiteral !== void 0 ? _config$parseLiteral : function(node2, variables) {
34466
34469
  return parseValue((0, _valueFromASTUntyped.valueFromASTUntyped)(node2, variables));
34467
34470
  };
34468
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
34469
- this.astNode = config2.astNode;
34470
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
34471
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34472
- config2.specifiedByUrl == null || typeof config2.specifiedByUrl === "string" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide "specifiedByUrl" as a string, ') + "but got: ".concat((0, _inspect.default)(config2.specifiedByUrl), "."));
34473
- config2.serialize == null || typeof config2.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.'));
34474
- if (config2.parseLiteral) {
34475
- typeof config2.parseValue === "function" && typeof config2.parseLiteral === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide both "parseValue" and "parseLiteral" functions.'));
34471
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
34472
+ this.astNode = config3.astNode;
34473
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
34474
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34475
+ 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), "."));
34476
+ 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.'));
34477
+ if (config3.parseLiteral) {
34478
+ typeof config3.parseValue === "function" && typeof config3.parseLiteral === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide both "parseValue" and "parseLiteral" functions.'));
34476
34479
  }
34477
34480
  }
34478
34481
  var _proto = GraphQLScalarType5.prototype;
@@ -34507,17 +34510,17 @@ var require_definition = __commonJS2({
34507
34510
  exports.GraphQLScalarType = GraphQLScalarType4;
34508
34511
  (0, _defineInspect.default)(GraphQLScalarType4);
34509
34512
  var GraphQLObjectType5 = /* @__PURE__ */ function() {
34510
- function GraphQLObjectType6(config2) {
34511
- this.name = config2.name;
34512
- this.description = config2.description;
34513
- this.isTypeOf = config2.isTypeOf;
34514
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
34515
- this.astNode = config2.astNode;
34516
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
34517
- this._fields = defineFieldMap.bind(void 0, config2);
34518
- this._interfaces = defineInterfaces.bind(void 0, config2);
34519
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34520
- config2.isTypeOf == null || typeof config2.isTypeOf === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide "isTypeOf" as a function, ') + "but got: ".concat((0, _inspect.default)(config2.isTypeOf), "."));
34513
+ function GraphQLObjectType6(config3) {
34514
+ this.name = config3.name;
34515
+ this.description = config3.description;
34516
+ this.isTypeOf = config3.isTypeOf;
34517
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
34518
+ this.astNode = config3.astNode;
34519
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
34520
+ this._fields = defineFieldMap.bind(void 0, config3);
34521
+ this._interfaces = defineInterfaces.bind(void 0, config3);
34522
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34523
+ 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), "."));
34521
34524
  }
34522
34525
  var _proto2 = GraphQLObjectType6.prototype;
34523
34526
  _proto2.getFields = function getFields() {
@@ -34560,22 +34563,22 @@ var require_definition = __commonJS2({
34560
34563
  }();
34561
34564
  exports.GraphQLObjectType = GraphQLObjectType5;
34562
34565
  (0, _defineInspect.default)(GraphQLObjectType5);
34563
- function defineInterfaces(config2) {
34566
+ function defineInterfaces(config3) {
34564
34567
  var _resolveThunk;
34565
- var interfaces = (_resolveThunk = resolveThunk(config2.interfaces)) !== null && _resolveThunk !== void 0 ? _resolveThunk : [];
34566
- Array.isArray(interfaces) || (0, _devAssert.default)(0, "".concat(config2.name, " interfaces must be an Array or a function which returns an Array."));
34568
+ var interfaces = (_resolveThunk = resolveThunk(config3.interfaces)) !== null && _resolveThunk !== void 0 ? _resolveThunk : [];
34569
+ Array.isArray(interfaces) || (0, _devAssert.default)(0, "".concat(config3.name, " interfaces must be an Array or a function which returns an Array."));
34567
34570
  return interfaces;
34568
34571
  }
34569
- function defineFieldMap(config2) {
34570
- var fieldMap = resolveThunk(config2.fields);
34571
- isPlainObj(fieldMap) || (0, _devAssert.default)(0, "".concat(config2.name, " fields must be an object with field names as keys or a function which returns such an object."));
34572
+ function defineFieldMap(config3) {
34573
+ var fieldMap = resolveThunk(config3.fields);
34574
+ 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."));
34572
34575
  return (0, _mapValue.default)(fieldMap, function(fieldConfig, fieldName) {
34573
34576
  var _fieldConfig$args;
34574
- isPlainObj(fieldConfig) || (0, _devAssert.default)(0, "".concat(config2.name, ".").concat(fieldName, " field config must be an object."));
34575
- !("isDeprecated" in fieldConfig) || (0, _devAssert.default)(0, "".concat(config2.name, ".").concat(fieldName, ' should provide "deprecationReason" instead of "isDeprecated".'));
34576
- fieldConfig.resolve == null || typeof fieldConfig.resolve === "function" || (0, _devAssert.default)(0, "".concat(config2.name, ".").concat(fieldName, " field resolver must be a function if ") + "provided, but got: ".concat((0, _inspect.default)(fieldConfig.resolve), "."));
34577
+ isPlainObj(fieldConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, " field config must be an object."));
34578
+ !("isDeprecated" in fieldConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, ' should provide "deprecationReason" instead of "isDeprecated".'));
34579
+ 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), "."));
34577
34580
  var argsConfig = (_fieldConfig$args = fieldConfig.args) !== null && _fieldConfig$args !== void 0 ? _fieldConfig$args : {};
34578
- isPlainObj(argsConfig) || (0, _devAssert.default)(0, "".concat(config2.name, ".").concat(fieldName, " args must be an object with argument names as keys."));
34581
+ isPlainObj(argsConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, " args must be an object with argument names as keys."));
34579
34582
  var args = (0, _objectEntries.default)(argsConfig).map(function(_ref) {
34580
34583
  var argName = _ref[0], argConfig = _ref[1];
34581
34584
  return {
@@ -34637,17 +34640,17 @@ var require_definition = __commonJS2({
34637
34640
  return isNonNullType6(arg.type) && arg.defaultValue === void 0;
34638
34641
  }
34639
34642
  var GraphQLInterfaceType5 = /* @__PURE__ */ function() {
34640
- function GraphQLInterfaceType6(config2) {
34641
- this.name = config2.name;
34642
- this.description = config2.description;
34643
- this.resolveType = config2.resolveType;
34644
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
34645
- this.astNode = config2.astNode;
34646
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
34647
- this._fields = defineFieldMap.bind(void 0, config2);
34648
- this._interfaces = defineInterfaces.bind(void 0, config2);
34649
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34650
- config2.resolveType == null || typeof config2.resolveType === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide "resolveType" as a function, ') + "but got: ".concat((0, _inspect.default)(config2.resolveType), "."));
34643
+ function GraphQLInterfaceType6(config3) {
34644
+ this.name = config3.name;
34645
+ this.description = config3.description;
34646
+ this.resolveType = config3.resolveType;
34647
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
34648
+ this.astNode = config3.astNode;
34649
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
34650
+ this._fields = defineFieldMap.bind(void 0, config3);
34651
+ this._interfaces = defineInterfaces.bind(void 0, config3);
34652
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34653
+ 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), "."));
34651
34654
  }
34652
34655
  var _proto3 = GraphQLInterfaceType6.prototype;
34653
34656
  _proto3.getFields = function getFields() {
@@ -34692,16 +34695,16 @@ var require_definition = __commonJS2({
34692
34695
  exports.GraphQLInterfaceType = GraphQLInterfaceType5;
34693
34696
  (0, _defineInspect.default)(GraphQLInterfaceType5);
34694
34697
  var GraphQLUnionType3 = /* @__PURE__ */ function() {
34695
- function GraphQLUnionType4(config2) {
34696
- this.name = config2.name;
34697
- this.description = config2.description;
34698
- this.resolveType = config2.resolveType;
34699
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
34700
- this.astNode = config2.astNode;
34701
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
34702
- this._types = defineTypes.bind(void 0, config2);
34703
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34704
- config2.resolveType == null || typeof config2.resolveType === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide "resolveType" as a function, ') + "but got: ".concat((0, _inspect.default)(config2.resolveType), "."));
34698
+ function GraphQLUnionType4(config3) {
34699
+ this.name = config3.name;
34700
+ this.description = config3.description;
34701
+ this.resolveType = config3.resolveType;
34702
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
34703
+ this.astNode = config3.astNode;
34704
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
34705
+ this._types = defineTypes.bind(void 0, config3);
34706
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34707
+ 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), "."));
34705
34708
  }
34706
34709
  var _proto4 = GraphQLUnionType4.prototype;
34707
34710
  _proto4.getTypes = function getTypes() {
@@ -34738,26 +34741,26 @@ var require_definition = __commonJS2({
34738
34741
  }();
34739
34742
  exports.GraphQLUnionType = GraphQLUnionType3;
34740
34743
  (0, _defineInspect.default)(GraphQLUnionType3);
34741
- function defineTypes(config2) {
34742
- var types42 = resolveThunk(config2.types);
34743
- Array.isArray(types42) || (0, _devAssert.default)(0, "Must provide Array of types or a function which returns such an array for Union ".concat(config2.name, "."));
34744
+ function defineTypes(config3) {
34745
+ var types42 = resolveThunk(config3.types);
34746
+ 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, "."));
34744
34747
  return types42;
34745
34748
  }
34746
34749
  var GraphQLEnumType4 = /* @__PURE__ */ function() {
34747
- function GraphQLEnumType5(config2) {
34748
- this.name = config2.name;
34749
- this.description = config2.description;
34750
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
34751
- this.astNode = config2.astNode;
34752
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
34753
- this._values = defineEnumValues(this.name, config2.values);
34750
+ function GraphQLEnumType5(config3) {
34751
+ this.name = config3.name;
34752
+ this.description = config3.description;
34753
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
34754
+ this.astNode = config3.astNode;
34755
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
34756
+ this._values = defineEnumValues(this.name, config3.values);
34754
34757
  this._valueLookup = new Map(this._values.map(function(enumValue) {
34755
34758
  return [enumValue.value, enumValue];
34756
34759
  }));
34757
34760
  this._nameLookup = (0, _keyMap.default)(this._values, function(value2) {
34758
34761
  return value2.name;
34759
34762
  });
34760
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34763
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34761
34764
  }
34762
34765
  var _proto5 = GraphQLEnumType5.prototype;
34763
34766
  _proto5.getValues = function getValues() {
@@ -34859,14 +34862,14 @@ var require_definition = __commonJS2({
34859
34862
  });
34860
34863
  }
34861
34864
  var GraphQLInputObjectType4 = /* @__PURE__ */ function() {
34862
- function GraphQLInputObjectType5(config2) {
34863
- this.name = config2.name;
34864
- this.description = config2.description;
34865
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
34866
- this.astNode = config2.astNode;
34867
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
34868
- this._fields = defineInputFieldMap.bind(void 0, config2);
34869
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34865
+ function GraphQLInputObjectType5(config3) {
34866
+ this.name = config3.name;
34867
+ this.description = config3.description;
34868
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
34869
+ this.astNode = config3.astNode;
34870
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
34871
+ this._fields = defineInputFieldMap.bind(void 0, config3);
34872
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34870
34873
  }
34871
34874
  var _proto6 = GraphQLInputObjectType5.prototype;
34872
34875
  _proto6.getFields = function getFields() {
@@ -34912,11 +34915,11 @@ var require_definition = __commonJS2({
34912
34915
  }();
34913
34916
  exports.GraphQLInputObjectType = GraphQLInputObjectType4;
34914
34917
  (0, _defineInspect.default)(GraphQLInputObjectType4);
34915
- function defineInputFieldMap(config2) {
34916
- var fieldMap = resolveThunk(config2.fields);
34917
- isPlainObj(fieldMap) || (0, _devAssert.default)(0, "".concat(config2.name, " fields must be an object with field names as keys or a function which returns such an object."));
34918
+ function defineInputFieldMap(config3) {
34919
+ var fieldMap = resolveThunk(config3.fields);
34920
+ 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."));
34918
34921
  return (0, _mapValue.default)(fieldMap, function(fieldConfig, fieldName) {
34919
- !("resolve" in fieldConfig) || (0, _devAssert.default)(0, "".concat(config2.name, ".").concat(fieldName, " field has a resolve property, but Input Types cannot define resolvers."));
34922
+ !("resolve" in fieldConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, " field has a resolve property, but Input Types cannot define resolvers."));
34920
34923
  return {
34921
34924
  name: fieldName,
34922
34925
  description: fieldConfig.description,
@@ -36095,18 +36098,18 @@ var require_directives = __commonJS2({
36095
36098
  return directive;
36096
36099
  }
36097
36100
  var GraphQLDirective2 = /* @__PURE__ */ function() {
36098
- function GraphQLDirective3(config2) {
36101
+ function GraphQLDirective3(config3) {
36099
36102
  var _config$isRepeatable, _config$args;
36100
- this.name = config2.name;
36101
- this.description = config2.description;
36102
- this.locations = config2.locations;
36103
- this.isRepeatable = (_config$isRepeatable = config2.isRepeatable) !== null && _config$isRepeatable !== void 0 ? _config$isRepeatable : false;
36104
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
36105
- this.astNode = config2.astNode;
36106
- config2.name || (0, _devAssert.default)(0, "Directive must be named.");
36107
- Array.isArray(config2.locations) || (0, _devAssert.default)(0, "@".concat(config2.name, " locations must be an Array."));
36108
- var args = (_config$args = config2.args) !== null && _config$args !== void 0 ? _config$args : {};
36109
- (0, _isObjectLike.default)(args) && !Array.isArray(args) || (0, _devAssert.default)(0, "@".concat(config2.name, " args must be an object with argument names as keys."));
36103
+ this.name = config3.name;
36104
+ this.description = config3.description;
36105
+ this.locations = config3.locations;
36106
+ this.isRepeatable = (_config$isRepeatable = config3.isRepeatable) !== null && _config$isRepeatable !== void 0 ? _config$isRepeatable : false;
36107
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
36108
+ this.astNode = config3.astNode;
36109
+ config3.name || (0, _devAssert.default)(0, "Directive must be named.");
36110
+ Array.isArray(config3.locations) || (0, _devAssert.default)(0, "@".concat(config3.name, " locations must be an Array."));
36111
+ var args = (_config$args = config3.args) !== null && _config$args !== void 0 ? _config$args : {};
36112
+ (0, _isObjectLike.default)(args) && !Array.isArray(args) || (0, _devAssert.default)(0, "@".concat(config3.name, " args must be an object with argument names as keys."));
36110
36113
  this.args = (0, _objectEntries.default)(args).map(function(_ref) {
36111
36114
  var argName = _ref[0], argConfig = _ref[1];
36112
36115
  return {
@@ -36260,23 +36263,23 @@ var require_schema = __commonJS2({
36260
36263
  return schema;
36261
36264
  }
36262
36265
  var GraphQLSchema2 = /* @__PURE__ */ function() {
36263
- function GraphQLSchema3(config2) {
36266
+ function GraphQLSchema3(config3) {
36264
36267
  var _config$directives;
36265
- this.__validationErrors = config2.assumeValid === true ? [] : void 0;
36266
- (0, _isObjectLike.default)(config2) || (0, _devAssert.default)(0, "Must provide configuration object.");
36267
- !config2.types || Array.isArray(config2.types) || (0, _devAssert.default)(0, '"types" must be Array if provided but got: '.concat((0, _inspect.default)(config2.types), "."));
36268
- !config2.directives || Array.isArray(config2.directives) || (0, _devAssert.default)(0, '"directives" must be Array if provided but got: ' + "".concat((0, _inspect.default)(config2.directives), "."));
36269
- this.description = config2.description;
36270
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
36271
- this.astNode = config2.astNode;
36272
- this.extensionASTNodes = config2.extensionASTNodes;
36273
- this._queryType = config2.query;
36274
- this._mutationType = config2.mutation;
36275
- this._subscriptionType = config2.subscription;
36276
- this._directives = (_config$directives = config2.directives) !== null && _config$directives !== void 0 ? _config$directives : _directives.specifiedDirectives;
36277
- var allReferencedTypes = new Set(config2.types);
36278
- if (config2.types != null) {
36279
- for (var _i2 = 0, _config$types2 = config2.types; _i2 < _config$types2.length; _i2++) {
36268
+ this.__validationErrors = config3.assumeValid === true ? [] : void 0;
36269
+ (0, _isObjectLike.default)(config3) || (0, _devAssert.default)(0, "Must provide configuration object.");
36270
+ !config3.types || Array.isArray(config3.types) || (0, _devAssert.default)(0, '"types" must be Array if provided but got: '.concat((0, _inspect.default)(config3.types), "."));
36271
+ !config3.directives || Array.isArray(config3.directives) || (0, _devAssert.default)(0, '"directives" must be Array if provided but got: ' + "".concat((0, _inspect.default)(config3.directives), "."));
36272
+ this.description = config3.description;
36273
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
36274
+ this.astNode = config3.astNode;
36275
+ this.extensionASTNodes = config3.extensionASTNodes;
36276
+ this._queryType = config3.query;
36277
+ this._mutationType = config3.mutation;
36278
+ this._subscriptionType = config3.subscription;
36279
+ this._directives = (_config$directives = config3.directives) !== null && _config$directives !== void 0 ? _config$directives : _directives.specifiedDirectives;
36280
+ var allReferencedTypes = new Set(config3.types);
36281
+ if (config3.types != null) {
36282
+ for (var _i2 = 0, _config$types2 = config3.types; _i2 < _config$types2.length; _i2++) {
36280
36283
  var type = _config$types2[_i2];
36281
36284
  allReferencedTypes.delete(type);
36282
36285
  collectReferencedTypes(type, allReferencedTypes);
@@ -42466,9 +42469,9 @@ var require_extendSchema = __commonJS2({
42466
42469
  return typeMap[type.name];
42467
42470
  }
42468
42471
  function replaceDirective(directive) {
42469
- var config2 = directive.toConfig();
42470
- return new _directives.GraphQLDirective(_objectSpread(_objectSpread({}, config2), {}, {
42471
- args: (0, _mapValue.default)(config2.args, extendArg)
42472
+ var config3 = directive.toConfig();
42473
+ return new _directives.GraphQLDirective(_objectSpread(_objectSpread({}, config3), {}, {
42474
+ args: (0, _mapValue.default)(config3.args, extendArg)
42472
42475
  }));
42473
42476
  }
42474
42477
  function extendNamedType(type) {
@@ -42497,80 +42500,80 @@ var require_extendSchema = __commonJS2({
42497
42500
  }
42498
42501
  function extendInputObjectType(type) {
42499
42502
  var _typeExtensionsMap$co;
42500
- var config2 = type.toConfig();
42501
- var extensions = (_typeExtensionsMap$co = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co !== void 0 ? _typeExtensionsMap$co : [];
42502
- return new _definition.GraphQLInputObjectType(_objectSpread(_objectSpread({}, config2), {}, {
42503
+ var config3 = type.toConfig();
42504
+ var extensions = (_typeExtensionsMap$co = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co !== void 0 ? _typeExtensionsMap$co : [];
42505
+ return new _definition.GraphQLInputObjectType(_objectSpread(_objectSpread({}, config3), {}, {
42503
42506
  fields: function fields() {
42504
- return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config2.fields, function(field) {
42507
+ return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config3.fields, function(field) {
42505
42508
  return _objectSpread(_objectSpread({}, field), {}, {
42506
42509
  type: replaceType(field.type)
42507
42510
  });
42508
42511
  })), buildInputFieldMap(extensions));
42509
42512
  },
42510
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
42513
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
42511
42514
  }));
42512
42515
  }
42513
42516
  function extendEnumType(type) {
42514
42517
  var _typeExtensionsMap$ty;
42515
- var config2 = type.toConfig();
42518
+ var config3 = type.toConfig();
42516
42519
  var extensions = (_typeExtensionsMap$ty = typeExtensionsMap[type.name]) !== null && _typeExtensionsMap$ty !== void 0 ? _typeExtensionsMap$ty : [];
42517
- return new _definition.GraphQLEnumType(_objectSpread(_objectSpread({}, config2), {}, {
42518
- values: _objectSpread(_objectSpread({}, config2.values), buildEnumValueMap(extensions)),
42519
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
42520
+ return new _definition.GraphQLEnumType(_objectSpread(_objectSpread({}, config3), {}, {
42521
+ values: _objectSpread(_objectSpread({}, config3.values), buildEnumValueMap(extensions)),
42522
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
42520
42523
  }));
42521
42524
  }
42522
42525
  function extendScalarType(type) {
42523
42526
  var _typeExtensionsMap$co2;
42524
- var config2 = type.toConfig();
42525
- var extensions = (_typeExtensionsMap$co2 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co2 !== void 0 ? _typeExtensionsMap$co2 : [];
42526
- var specifiedByUrl = config2.specifiedByUrl;
42527
+ var config3 = type.toConfig();
42528
+ var extensions = (_typeExtensionsMap$co2 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co2 !== void 0 ? _typeExtensionsMap$co2 : [];
42529
+ var specifiedByUrl = config3.specifiedByUrl;
42527
42530
  for (var _i8 = 0; _i8 < extensions.length; _i8++) {
42528
42531
  var _getSpecifiedByUrl;
42529
42532
  var extensionNode = extensions[_i8];
42530
42533
  specifiedByUrl = (_getSpecifiedByUrl = getSpecifiedByUrl(extensionNode)) !== null && _getSpecifiedByUrl !== void 0 ? _getSpecifiedByUrl : specifiedByUrl;
42531
42534
  }
42532
- return new _definition.GraphQLScalarType(_objectSpread(_objectSpread({}, config2), {}, {
42535
+ return new _definition.GraphQLScalarType(_objectSpread(_objectSpread({}, config3), {}, {
42533
42536
  specifiedByUrl,
42534
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
42537
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
42535
42538
  }));
42536
42539
  }
42537
42540
  function extendObjectType(type) {
42538
42541
  var _typeExtensionsMap$co3;
42539
- var config2 = type.toConfig();
42540
- var extensions = (_typeExtensionsMap$co3 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co3 !== void 0 ? _typeExtensionsMap$co3 : [];
42541
- return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config2), {}, {
42542
+ var config3 = type.toConfig();
42543
+ var extensions = (_typeExtensionsMap$co3 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co3 !== void 0 ? _typeExtensionsMap$co3 : [];
42544
+ return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config3), {}, {
42542
42545
  interfaces: function interfaces() {
42543
42546
  return [].concat(type.getInterfaces().map(replaceNamedType), buildInterfaces(extensions));
42544
42547
  },
42545
42548
  fields: function fields() {
42546
- return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config2.fields, extendField)), buildFieldMap(extensions));
42549
+ return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config3.fields, extendField)), buildFieldMap(extensions));
42547
42550
  },
42548
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
42551
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
42549
42552
  }));
42550
42553
  }
42551
42554
  function extendInterfaceType(type) {
42552
42555
  var _typeExtensionsMap$co4;
42553
- var config2 = type.toConfig();
42554
- var extensions = (_typeExtensionsMap$co4 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co4 !== void 0 ? _typeExtensionsMap$co4 : [];
42555
- return new _definition.GraphQLInterfaceType(_objectSpread(_objectSpread({}, config2), {}, {
42556
+ var config3 = type.toConfig();
42557
+ var extensions = (_typeExtensionsMap$co4 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co4 !== void 0 ? _typeExtensionsMap$co4 : [];
42558
+ return new _definition.GraphQLInterfaceType(_objectSpread(_objectSpread({}, config3), {}, {
42556
42559
  interfaces: function interfaces() {
42557
42560
  return [].concat(type.getInterfaces().map(replaceNamedType), buildInterfaces(extensions));
42558
42561
  },
42559
42562
  fields: function fields() {
42560
- return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config2.fields, extendField)), buildFieldMap(extensions));
42563
+ return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config3.fields, extendField)), buildFieldMap(extensions));
42561
42564
  },
42562
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
42565
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
42563
42566
  }));
42564
42567
  }
42565
42568
  function extendUnionType(type) {
42566
42569
  var _typeExtensionsMap$co5;
42567
- var config2 = type.toConfig();
42568
- var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
42569
- return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config2), {}, {
42570
+ var config3 = type.toConfig();
42571
+ var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
42572
+ return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config3), {}, {
42570
42573
  types: function types42() {
42571
42574
  return [].concat(type.getTypes().map(replaceNamedType), buildUnionTypes(extensions));
42572
42575
  },
42573
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
42576
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
42574
42577
  }));
42575
42578
  }
42576
42579
  function extendField(field) {
@@ -42885,24 +42888,24 @@ var require_buildASTSchema = __commonJS2({
42885
42888
  extensionASTNodes: [],
42886
42889
  assumeValid: false
42887
42890
  };
42888
- var config2 = (0, _extendSchema.extendSchemaImpl)(emptySchemaConfig, documentAST, options);
42889
- if (config2.astNode == null) {
42890
- for (var _i2 = 0, _config$types2 = config2.types; _i2 < _config$types2.length; _i2++) {
42891
+ var config3 = (0, _extendSchema.extendSchemaImpl)(emptySchemaConfig, documentAST, options);
42892
+ if (config3.astNode == null) {
42893
+ for (var _i2 = 0, _config$types2 = config3.types; _i2 < _config$types2.length; _i2++) {
42891
42894
  var type = _config$types2[_i2];
42892
42895
  switch (type.name) {
42893
42896
  case "Query":
42894
- config2.query = type;
42897
+ config3.query = type;
42895
42898
  break;
42896
42899
  case "Mutation":
42897
- config2.mutation = type;
42900
+ config3.mutation = type;
42898
42901
  break;
42899
42902
  case "Subscription":
42900
- config2.subscription = type;
42903
+ config3.subscription = type;
42901
42904
  break;
42902
42905
  }
42903
42906
  }
42904
42907
  }
42905
- var directives = config2.directives;
42908
+ var directives = config3.directives;
42906
42909
  var _loop = function _loop2(_i42) {
42907
42910
  var stdDirective = _directives.specifiedDirectives[_i42];
42908
42911
  if (directives.every(function(directive) {
@@ -42914,7 +42917,7 @@ var require_buildASTSchema = __commonJS2({
42914
42917
  for (var _i4 = 0; _i4 < _directives.specifiedDirectives.length; _i4++) {
42915
42918
  _loop(_i4);
42916
42919
  }
42917
- return new _schema.GraphQLSchema(config2);
42920
+ return new _schema.GraphQLSchema(config3);
42918
42921
  }
42919
42922
  function buildSchema3(source, options) {
42920
42923
  var document = (0, _parser.parse)(source, {
@@ -43014,12 +43017,12 @@ var require_lexicographicSortSchema = __commonJS2({
43014
43017
  return maybeType && replaceNamedType(maybeType);
43015
43018
  }
43016
43019
  function sortDirective(directive) {
43017
- var config2 = directive.toConfig();
43018
- return new _directives.GraphQLDirective(_objectSpread(_objectSpread({}, config2), {}, {
43019
- locations: sortBy(config2.locations, function(x22) {
43020
+ var config3 = directive.toConfig();
43021
+ return new _directives.GraphQLDirective(_objectSpread(_objectSpread({}, config3), {}, {
43022
+ locations: sortBy(config3.locations, function(x22) {
43020
43023
  return x22;
43021
43024
  }),
43022
- args: sortArgs(config2.args)
43025
+ args: sortArgs(config3.args)
43023
43026
  }));
43024
43027
  }
43025
43028
  function sortArgs(args) {
@@ -43052,13 +43055,13 @@ var require_lexicographicSortSchema = __commonJS2({
43052
43055
  return type;
43053
43056
  }
43054
43057
  if ((0, _definition.isObjectType)(type)) {
43055
- var config2 = type.toConfig();
43056
- return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config2), {}, {
43058
+ var config3 = type.toConfig();
43059
+ return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config3), {}, {
43057
43060
  interfaces: function interfaces() {
43058
- return sortTypes(config2.interfaces);
43061
+ return sortTypes(config3.interfaces);
43059
43062
  },
43060
43063
  fields: function fields() {
43061
- return sortFields(config2.fields);
43064
+ return sortFields(config3.fields);
43062
43065
  }
43063
43066
  }));
43064
43067
  }
@@ -83863,13 +83866,13 @@ var require_esprima2 = __commonJS2({
83863
83866
  return Reader2;
83864
83867
  }();
83865
83868
  var Tokenizer = function() {
83866
- function Tokenizer2(code, config2) {
83869
+ function Tokenizer2(code, config3) {
83867
83870
  this.errorHandler = new error_handler_1.ErrorHandler();
83868
- this.errorHandler.tolerant = config2 ? typeof config2.tolerant === "boolean" && config2.tolerant : false;
83871
+ this.errorHandler.tolerant = config3 ? typeof config3.tolerant === "boolean" && config3.tolerant : false;
83869
83872
  this.scanner = new scanner_1.Scanner(code, this.errorHandler);
83870
- this.scanner.trackComment = config2 ? typeof config2.comment === "boolean" && config2.comment : false;
83871
- this.trackRange = config2 ? typeof config2.range === "boolean" && config2.range : false;
83872
- this.trackLoc = config2 ? typeof config2.loc === "boolean" && config2.loc : false;
83873
+ this.scanner.trackComment = config3 ? typeof config3.comment === "boolean" && config3.comment : false;
83874
+ this.trackRange = config3 ? typeof config3.range === "boolean" && config3.range : false;
83875
+ this.trackLoc = config3 ? typeof config3.loc === "boolean" && config3.loc : false;
83873
83876
  this.buffer = [];
83874
83877
  this.reader = new Reader();
83875
83878
  }
@@ -86019,11 +86022,11 @@ var require_printer2 = __commonJS2({
86019
86022
  return this.code;
86020
86023
  };
86021
86024
  var emptyPrintResult = new PrintResult("");
86022
- var Printer = function Printer2(config2) {
86025
+ var Printer = function Printer2(config3) {
86023
86026
  assert_1.default.ok(this instanceof Printer2);
86024
- var explicitTabWidth = config2 && config2.tabWidth;
86025
- config2 = options_1.normalize(config2);
86026
- config2.sourceFileName = null;
86027
+ var explicitTabWidth = config3 && config3.tabWidth;
86028
+ config3 = options_1.normalize(config3);
86029
+ config3.sourceFileName = null;
86027
86030
  function makePrintFunctionWith(options, overrides) {
86028
86031
  options = Object.assign({}, options, overrides);
86029
86032
  return function(path22) {
@@ -86038,19 +86041,19 @@ var require_printer2 = __commonJS2({
86038
86041
  includeComments: false
86039
86042
  }));
86040
86043
  }
86041
- var oldTabWidth = config2.tabWidth;
86044
+ var oldTabWidth = config3.tabWidth;
86042
86045
  if (!explicitTabWidth) {
86043
86046
  var loc = path22.getNode().loc;
86044
86047
  if (loc && loc.lines && loc.lines.guessTabWidth) {
86045
- config2.tabWidth = loc.lines.guessTabWidth();
86048
+ config3.tabWidth = loc.lines.guessTabWidth();
86046
86049
  }
86047
86050
  }
86048
86051
  var reprinter = patcher_1.getReprinter(path22);
86049
- var lines = reprinter ? reprinter(print5) : genericPrint(path22, config2, options, makePrintFunctionWith(options, {
86052
+ var lines = reprinter ? reprinter(print5) : genericPrint(path22, config3, options, makePrintFunctionWith(options, {
86050
86053
  includeComments: true,
86051
86054
  avoidRootParens: false
86052
86055
  }));
86053
- config2.tabWidth = oldTabWidth;
86056
+ config3.tabWidth = oldTabWidth;
86054
86057
  return lines;
86055
86058
  }
86056
86059
  this.print = function(ast) {
@@ -86061,7 +86064,7 @@ var require_printer2 = __commonJS2({
86061
86064
  includeComments: true,
86062
86065
  avoidRootParens: false
86063
86066
  });
86064
- return new PrintResult(lines.toString(config2), util.composeSourceMaps(config2.inputSourceMap, lines.getSourceMap(config2.sourceMapName, config2.sourceRoot)));
86067
+ return new PrintResult(lines.toString(config3), util.composeSourceMaps(config3.inputSourceMap, lines.getSourceMap(config3.sourceMapName, config3.sourceRoot)));
86065
86068
  };
86066
86069
  this.printGenerically = function(ast) {
86067
86070
  if (!ast) {
@@ -86069,26 +86072,26 @@ var require_printer2 = __commonJS2({
86069
86072
  }
86070
86073
  function printGenerically(path3) {
86071
86074
  return comments_1.printComments(path3, function(path4) {
86072
- return genericPrint(path4, config2, {
86075
+ return genericPrint(path4, config3, {
86073
86076
  includeComments: true,
86074
86077
  avoidRootParens: false
86075
86078
  }, printGenerically);
86076
86079
  });
86077
86080
  }
86078
86081
  var path22 = fast_path_1.default.from(ast);
86079
- var oldReuseWhitespace = config2.reuseWhitespace;
86080
- config2.reuseWhitespace = false;
86081
- var pr = new PrintResult(printGenerically(path22).toString(config2));
86082
- config2.reuseWhitespace = oldReuseWhitespace;
86082
+ var oldReuseWhitespace = config3.reuseWhitespace;
86083
+ config3.reuseWhitespace = false;
86084
+ var pr = new PrintResult(printGenerically(path22).toString(config3));
86085
+ config3.reuseWhitespace = oldReuseWhitespace;
86083
86086
  return pr;
86084
86087
  };
86085
86088
  };
86086
86089
  exports.Printer = Printer;
86087
- function genericPrint(path22, config2, options, printPath) {
86090
+ function genericPrint(path22, config3, options, printPath) {
86088
86091
  assert_1.default.ok(path22 instanceof fast_path_1.default);
86089
86092
  var node2 = path22.getValue();
86090
86093
  var parts = [];
86091
- var linesWithoutParens = genericPrintNoParens(path22, config2, printPath);
86094
+ var linesWithoutParens = genericPrintNoParens(path22, config3, printPath);
86092
86095
  if (!node2 || linesWithoutParens.isEmpty()) {
86093
86096
  return linesWithoutParens;
86094
86097
  }
@@ -88151,9 +88154,9 @@ var require_main2 = __commonJS2({
88151
88154
  }
88152
88155
  }
88153
88156
  });
88154
- async function runPipeline(config2, pipeline22, target) {
88157
+ async function runPipeline(config3, pipeline22, target) {
88155
88158
  for (const transform of pipeline22) {
88156
- await transform?.(config2, target);
88159
+ await transform?.(config3, target);
88157
88160
  }
88158
88161
  }
88159
88162
  var import_graphql16 = __toESM2(require_graphql2(), 1);
@@ -88497,6 +88500,18 @@ function deepEquals(objA, objB, map = /* @__PURE__ */ new WeakMap()) {
88497
88500
  }
88498
88501
  return true;
88499
88502
  }
88503
+ function getFieldsForType(selection, __typename) {
88504
+ let targetSelection = selection.fields || {};
88505
+ if (selection.abstractFields && __typename) {
88506
+ const mappedType = selection.abstractFields.typeMap[__typename];
88507
+ if (mappedType) {
88508
+ targetSelection = selection.abstractFields.fields[mappedType];
88509
+ } else if (selection.abstractFields.fields[__typename]) {
88510
+ targetSelection = selection.abstractFields.fields[__typename];
88511
+ }
88512
+ }
88513
+ return targetSelection;
88514
+ }
88500
88515
  var GarbageCollector = class {
88501
88516
  cache;
88502
88517
  lifetimes = /* @__PURE__ */ new Map();
@@ -88714,23 +88729,32 @@ var List = class {
88714
88729
  let insertData = data2;
88715
88730
  if (this.connection) {
88716
88731
  insertSelection = {
88717
- newEntry: {
88718
- keyRaw: this.key,
88719
- type: "Connection",
88720
- fields: {
88721
- edges: {
88722
- keyRaw: "edges",
88723
- type: "ConnectionEdge",
88724
- update: where === "first" ? "prepend" : "append",
88732
+ fields: {
88733
+ newEntry: {
88734
+ keyRaw: this.key,
88735
+ type: "Connection",
88736
+ selection: {
88725
88737
  fields: {
88726
- node: {
88727
- type: listType,
88728
- keyRaw: "node",
88729
- fields: {
88730
- ...selection,
88731
- __typename: {
88732
- keyRaw: "__typename",
88733
- type: "String"
88738
+ edges: {
88739
+ keyRaw: "edges",
88740
+ type: "ConnectionEdge",
88741
+ update: where === "first" ? "prepend" : "append",
88742
+ selection: {
88743
+ fields: {
88744
+ node: {
88745
+ type: listType,
88746
+ keyRaw: "node",
88747
+ selection: {
88748
+ ...selection,
88749
+ fields: {
88750
+ ...selection.fields,
88751
+ __typename: {
88752
+ keyRaw: "__typename",
88753
+ type: "String"
88754
+ }
88755
+ }
88756
+ }
88757
+ }
88734
88758
  }
88735
88759
  }
88736
88760
  }
@@ -88746,15 +88770,20 @@ var List = class {
88746
88770
  };
88747
88771
  } else {
88748
88772
  insertSelection = {
88749
- newEntries: {
88750
- keyRaw: this.key,
88751
- type: listType,
88752
- update: where === "first" ? "prepend" : "append",
88753
- fields: {
88754
- ...selection,
88755
- __typename: {
88756
- keyRaw: "__typename",
88757
- type: "String"
88773
+ fields: {
88774
+ newEntries: {
88775
+ keyRaw: this.key,
88776
+ type: listType,
88777
+ update: where === "first" ? "prepend" : "append",
88778
+ selection: {
88779
+ ...selection,
88780
+ fields: {
88781
+ ...selection.fields,
88782
+ __typename: {
88783
+ keyRaw: "__typename",
88784
+ type: "String"
88785
+ }
88786
+ }
88758
88787
  }
88759
88788
  }
88760
88789
  }
@@ -88814,7 +88843,7 @@ var List = class {
88814
88843
  const subscribers = this.cache._internal_unstable.subscriptions.get(this.recordID, this.key);
88815
88844
  this.cache._internal_unstable.subscriptions.remove(
88816
88845
  targetID,
88817
- this.connection ? this.selection.edges.fields : this.selection,
88846
+ this.connection ? this.selection.fields.edges.selection : this.selection,
88818
88847
  subscribers,
88819
88848
  variables
88820
88849
  );
@@ -89299,18 +89328,20 @@ var InMemorySubscriptions = class {
89299
89328
  variables,
89300
89329
  parentType
89301
89330
  }) {
89302
- for (const fieldSelection of Object.values(selection)) {
89303
- const { keyRaw, fields, type } = fieldSelection;
89331
+ const __typename = this.cache._internal_unstable.storage.get(parent, "__typename").value;
89332
+ let targetSelection = getFieldsForType(selection, __typename);
89333
+ for (const fieldSelection of Object.values(targetSelection || {})) {
89334
+ const { keyRaw, selection: innerSelection, type } = fieldSelection;
89304
89335
  const key = evaluateKey(keyRaw, variables);
89305
89336
  this.addFieldSubscription({
89306
89337
  id: parent,
89307
89338
  key,
89308
- selection: fieldSelection,
89339
+ field: fieldSelection,
89309
89340
  spec,
89310
89341
  parentType: parentType || spec.rootType,
89311
89342
  variables
89312
89343
  });
89313
- if (fields) {
89344
+ if (innerSelection) {
89314
89345
  const { value: linkedRecord } = this.cache._internal_unstable.storage.get(
89315
89346
  parent,
89316
89347
  key
@@ -89323,7 +89354,7 @@ var InMemorySubscriptions = class {
89323
89354
  this.add({
89324
89355
  parent: child,
89325
89356
  spec,
89326
- selection: fields,
89357
+ selection: innerSelection,
89327
89358
  variables,
89328
89359
  parentType: type
89329
89360
  });
@@ -89334,7 +89365,7 @@ var InMemorySubscriptions = class {
89334
89365
  addFieldSubscription({
89335
89366
  id: id2,
89336
89367
  key,
89337
- selection,
89368
+ field,
89338
89369
  spec,
89339
89370
  parentType,
89340
89371
  variables
@@ -89361,8 +89392,8 @@ var InMemorySubscriptions = class {
89361
89392
  const counts = this.referenceCounts[id2][key];
89362
89393
  counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
89363
89394
  this.cache._internal_unstable.lifetimes.resetLifetime(id2, key);
89364
- const { fields, list, filters } = selection;
89365
- if (fields && list) {
89395
+ const { selection, list, filters } = field;
89396
+ if (selection && list) {
89366
89397
  this.cache._internal_unstable.lists.add({
89367
89398
  name: list.name,
89368
89399
  connection: list.connection,
@@ -89370,7 +89401,7 @@ var InMemorySubscriptions = class {
89370
89401
  recordType: this.cache._internal_unstable.storage.get(id2, "__typename")?.value || parentType,
89371
89402
  listType: list.type,
89372
89403
  key,
89373
- selection: fields,
89404
+ selection,
89374
89405
  filters: Object.entries(filters || {}).reduce((acc, [key2, { kind, value: value2 }]) => {
89375
89406
  return {
89376
89407
  ...acc,
@@ -89387,20 +89418,21 @@ var InMemorySubscriptions = class {
89387
89418
  subscribers,
89388
89419
  parentType
89389
89420
  }) {
89390
- for (const fieldSelection of Object.values(selection)) {
89391
- const { type: linkedType, keyRaw, fields } = fieldSelection;
89421
+ let targetSelection = getFieldsForType(selection, parentType);
89422
+ for (const fieldSelection of Object.values(targetSelection)) {
89423
+ const { type: linkedType, keyRaw, selection: innerSelection } = fieldSelection;
89392
89424
  const key = evaluateKey(keyRaw, variables);
89393
89425
  for (const spec of subscribers) {
89394
89426
  this.addFieldSubscription({
89395
89427
  id: parent,
89396
89428
  key,
89397
- selection: fieldSelection,
89429
+ field: fieldSelection,
89398
89430
  spec,
89399
89431
  parentType,
89400
89432
  variables
89401
89433
  });
89402
89434
  }
89403
- if (fields) {
89435
+ if (innerSelection) {
89404
89436
  const { value: link } = this.cache._internal_unstable.storage.get(parent, key);
89405
89437
  const children = !Array.isArray(link) ? [link] : flattenList(link);
89406
89438
  for (const linkedRecord of children) {
@@ -89409,7 +89441,7 @@ var InMemorySubscriptions = class {
89409
89441
  }
89410
89442
  this.addMany({
89411
89443
  parent: linkedRecord,
89412
- selection: fields,
89444
+ selection: innerSelection,
89413
89445
  variables,
89414
89446
  subscribers,
89415
89447
  parentType: linkedType
@@ -89421,22 +89453,20 @@ var InMemorySubscriptions = class {
89421
89453
  get(id2, field) {
89422
89454
  return this.subscribers[id2]?.[field] || [];
89423
89455
  }
89424
- remove(id2, fields, targets, variables, visited = []) {
89456
+ remove(id2, selection, targets, variables, visited = []) {
89425
89457
  visited.push(id2);
89426
89458
  const linkedIDs = [];
89427
- for (const selection of Object.values(fields)) {
89428
- const key = evaluateKey(selection.keyRaw, variables);
89459
+ for (const fieldSelection of Object.values(selection.fields || {})) {
89460
+ const key = evaluateKey(fieldSelection.keyRaw, variables);
89429
89461
  this.removeSubscribers(id2, key, targets);
89430
- if (!selection.fields) {
89462
+ if (!fieldSelection.selection?.fields) {
89431
89463
  continue;
89432
89464
  }
89433
- if (selection.list) {
89434
- }
89435
89465
  const { value: previousValue } = this.cache._internal_unstable.storage.get(id2, key);
89436
89466
  const links = !Array.isArray(previousValue) ? [previousValue] : flattenList(previousValue);
89437
89467
  for (const link of links) {
89438
89468
  if (link !== null) {
89439
- linkedIDs.push([link, selection.fields]);
89469
+ linkedIDs.push([link, fieldSelection.selection || {}]);
89440
89470
  }
89441
89471
  }
89442
89472
  }
@@ -89485,7 +89515,7 @@ var InMemorySubscriptions = class {
89485
89515
  };
89486
89516
  var Cache2 = class {
89487
89517
  _internal_unstable;
89488
- constructor(config2) {
89518
+ constructor(config3) {
89489
89519
  this._internal_unstable = new CacheInternal({
89490
89520
  cache: this,
89491
89521
  storage: new InMemoryStorage(),
@@ -89493,8 +89523,8 @@ var Cache2 = class {
89493
89523
  lists: new ListManager(this, rootID),
89494
89524
  lifetimes: new GarbageCollector(this)
89495
89525
  });
89496
- if (config2) {
89497
- this.setConfig(defaultConfigValues(config2));
89526
+ if (config3) {
89527
+ this.setConfig(defaultConfigValues(config3));
89498
89528
  }
89499
89529
  }
89500
89530
  write({
@@ -89559,8 +89589,8 @@ var Cache2 = class {
89559
89589
  this._internal_unstable.lists.removeIDFromAllLists(id2);
89560
89590
  this._internal_unstable.storage.delete(id2);
89561
89591
  }
89562
- setConfig(config2) {
89563
- this._internal_unstable.setConfig(config2);
89592
+ setConfig(config3) {
89593
+ this._internal_unstable.setConfig(config3);
89564
89594
  }
89565
89595
  };
89566
89596
  var CacheInternal = class {
@@ -89595,8 +89625,8 @@ var CacheInternal = class {
89595
89625
  this._disabled = typeof globalThis.window === "undefined";
89596
89626
  }
89597
89627
  }
89598
- setConfig(config2) {
89599
- this.config = config2;
89628
+ setConfig(config3) {
89629
+ this.config = config3;
89600
89630
  }
89601
89631
  writeSelection({
89602
89632
  data: data2,
@@ -89612,8 +89642,9 @@ var CacheInternal = class {
89612
89642
  if (this._disabled) {
89613
89643
  return [];
89614
89644
  }
89645
+ let targetSelection = getFieldsForType(selection, data2["__typename"]);
89615
89646
  for (const [field, value2] of Object.entries(data2)) {
89616
- if (!selection || !selection[field]) {
89647
+ if (!selection || !targetSelection[field]) {
89617
89648
  throw new Error(
89618
89649
  "Could not find field listing in selection for " + field + " @ " + JSON.stringify(selection)
89619
89650
  );
@@ -89621,11 +89652,11 @@ var CacheInternal = class {
89621
89652
  let {
89622
89653
  type: linkedType,
89623
89654
  keyRaw,
89624
- fields,
89655
+ selection: fieldSelection,
89625
89656
  operations,
89626
89657
  abstract: isAbstract,
89627
89658
  update
89628
- } = selection[field];
89659
+ } = targetSelection[field];
89629
89660
  const key = evaluateKey(keyRaw, variables);
89630
89661
  const currentSubscribers = this.subscriptions.get(parent, key);
89631
89662
  const { value: previousValue, displayLayers } = this.storage.get(parent, key);
@@ -89633,7 +89664,7 @@ var CacheInternal = class {
89633
89664
  if (displayLayer) {
89634
89665
  this.lifetimes.resetLifetime(parent, key);
89635
89666
  }
89636
- if (!fields) {
89667
+ if (!fieldSelection) {
89637
89668
  let newValue = value2;
89638
89669
  if (Array.isArray(value2) && applyUpdates && update) {
89639
89670
  if (update === "append") {
@@ -89653,7 +89684,7 @@ var CacheInternal = class {
89653
89684
  }
89654
89685
  const previousLinks = flattenList([previousValue]);
89655
89686
  for (const link of previousLinks) {
89656
- this.subscriptions.remove(link, fields, currentSubscribers, variables);
89687
+ this.subscriptions.remove(link, fieldSelection, currentSubscribers, variables);
89657
89688
  }
89658
89689
  layer.writeLink(parent, key, null);
89659
89690
  toNotify.push(...currentSubscribers);
@@ -89679,14 +89710,14 @@ var CacheInternal = class {
89679
89710
  if (previousValue && typeof previousValue === "string") {
89680
89711
  this.subscriptions.remove(
89681
89712
  previousValue,
89682
- fields,
89713
+ fieldSelection,
89683
89714
  currentSubscribers,
89684
89715
  variables
89685
89716
  );
89686
89717
  }
89687
89718
  this.subscriptions.addMany({
89688
89719
  parent: linkedID,
89689
- selection: fields,
89720
+ selection: fieldSelection,
89690
89721
  subscribers: currentSubscribers,
89691
89722
  variables,
89692
89723
  parentType: linkedType
@@ -89696,14 +89727,14 @@ var CacheInternal = class {
89696
89727
  if (linkedID) {
89697
89728
  this.writeSelection({
89698
89729
  root,
89699
- selection: fields,
89730
+ selection: fieldSelection,
89700
89731
  parent: linkedID,
89701
89732
  data: value2,
89702
89733
  variables,
89703
89734
  toNotify,
89704
89735
  applyUpdates,
89705
89736
  layer,
89706
- forceNotify: true
89737
+ forceNotify
89707
89738
  });
89708
89739
  }
89709
89740
  } else if (Array.isArray(value2) && (typeof previousValue === "undefined" || Array.isArray(previousValue))) {
@@ -89732,7 +89763,7 @@ var CacheInternal = class {
89732
89763
  key,
89733
89764
  linkedType,
89734
89765
  variables,
89735
- fields,
89766
+ fields: fieldSelection,
89736
89767
  layer,
89737
89768
  forceNotify
89738
89769
  });
@@ -89782,7 +89813,7 @@ var CacheInternal = class {
89782
89813
  if (linkedIDs.includes(lostID) || !lostID) {
89783
89814
  continue;
89784
89815
  }
89785
- this.subscriptions.remove(lostID, fields, currentSubscribers, variables);
89816
+ this.subscriptions.remove(lostID, fieldSelection, currentSubscribers, variables);
89786
89817
  }
89787
89818
  if (contentChanged || oldIDs.length === 0 && newIDs.length === 0) {
89788
89819
  layer.writeLink(parent, key, linkedIDs);
@@ -89793,7 +89824,7 @@ var CacheInternal = class {
89793
89824
  }
89794
89825
  this.subscriptions.addMany({
89795
89826
  parent: id2,
89796
- selection: fields,
89827
+ selection: fieldSelection,
89797
89828
  subscribers: currentSubscribers,
89798
89829
  variables,
89799
89830
  parentType: linkedType
@@ -89818,9 +89849,14 @@ var CacheInternal = class {
89818
89849
  }
89819
89850
  const targets = Array.isArray(value2) ? value2 : [value2];
89820
89851
  for (const target of targets) {
89821
- if (operation.action === "insert" && target instanceof Object && fields && operation.list) {
89822
- this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(fields, target, variables, operation.position || "last");
89823
- } else if (operation.action === "remove" && target instanceof Object && fields && operation.list) {
89852
+ if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
89853
+ this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(
89854
+ fieldSelection,
89855
+ target,
89856
+ variables,
89857
+ operation.position || "last"
89858
+ );
89859
+ } else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
89824
89860
  this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
89825
89861
  } else if (operation.action === "delete" && operation.type) {
89826
89862
  if (typeof target !== "string") {
@@ -89831,8 +89867,13 @@ var CacheInternal = class {
89831
89867
  continue;
89832
89868
  }
89833
89869
  this.cache.delete(targetID);
89834
- } else if (operation.action === "toggle" && target instanceof Object && fields && operation.list) {
89835
- this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
89870
+ } else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
89871
+ this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(
89872
+ fieldSelection,
89873
+ target,
89874
+ variables,
89875
+ operation.position || "last"
89876
+ );
89836
89877
  }
89837
89878
  }
89838
89879
  }
@@ -89852,9 +89893,12 @@ var CacheInternal = class {
89852
89893
  let hasData = false;
89853
89894
  let partial = false;
89854
89895
  let cascadeNull = false;
89855
- for (const [attributeName, { type, keyRaw, fields, nullable, list }] of Object.entries(
89856
- selection
89857
- )) {
89896
+ const typename = this.storage.get(parent, "__typename").value;
89897
+ let targetSelection = getFieldsForType(selection, typename);
89898
+ for (const [
89899
+ attributeName,
89900
+ { type, keyRaw, selection: fieldSelection, nullable, list }
89901
+ ] of Object.entries(targetSelection)) {
89858
89902
  const key = evaluateKey(keyRaw, variables);
89859
89903
  const { value: value2 } = this.storage.get(parent, key);
89860
89904
  let nextStep = stepsFromConnection;
@@ -89877,7 +89921,7 @@ var CacheInternal = class {
89877
89921
  if (typeof value2 !== "undefined") {
89878
89922
  hasData = true;
89879
89923
  }
89880
- } else if (!fields) {
89924
+ } else if (!fieldSelection) {
89881
89925
  const fnUnmarshal = this.config?.scalars?.[type]?.unmarshal;
89882
89926
  if (fnUnmarshal) {
89883
89927
  target[attributeName] = fnUnmarshal(value2);
@@ -89887,7 +89931,7 @@ var CacheInternal = class {
89887
89931
  hasData = true;
89888
89932
  } else if (Array.isArray(value2)) {
89889
89933
  const listValue = this.hydrateNestedList({
89890
- fields,
89934
+ fields: fieldSelection,
89891
89935
  variables,
89892
89936
  linkedList: value2,
89893
89937
  stepsFromConnection: nextStep
@@ -89902,7 +89946,7 @@ var CacheInternal = class {
89902
89946
  } else {
89903
89947
  const objectFields = this.getSelection({
89904
89948
  parent: value2,
89905
- selection: fields,
89949
+ selection: fieldSelection,
89906
89950
  variables,
89907
89951
  stepsFromConnection: nextStep
89908
89952
  });
@@ -91145,7 +91189,7 @@ async function asyncWalk(ast, { enter, leave }) {
91145
91189
  return await instance.visit(ast, null);
91146
91190
  }
91147
91191
  var graphql4 = __toESM2(require_graphql2(), 1);
91148
- async function find_graphql(config2, parsedScript, walker) {
91192
+ async function find_graphql(config3, parsedScript, walker) {
91149
91193
  await asyncWalk(parsedScript, {
91150
91194
  async enter(node2, parent) {
91151
91195
  if (node2.type === "TaggedTemplateExpression" && node2.tag.name === "graphql") {
@@ -91155,7 +91199,7 @@ async function find_graphql(config2, parsedScript, walker) {
91155
91199
  if (walker.where && !walker.where(parsedTag)) {
91156
91200
  return;
91157
91201
  }
91158
- const definition = config2.extractDefinition(parsedTag);
91202
+ const definition = config3.extractDefinition(parsedTag);
91159
91203
  const name2 = definition.name?.value;
91160
91204
  if (!name2) {
91161
91205
  throw new Error("Could not find definition name");
@@ -91172,7 +91216,7 @@ async function find_graphql(config2, parsedScript, walker) {
91172
91216
  kind = CompiledSubscriptionKind;
91173
91217
  }
91174
91218
  }
91175
- walker.dependency?.(config2.artifactPath(parsedTag));
91219
+ walker.dependency?.(config3.artifactPath(parsedTag));
91176
91220
  await walker.tag({
91177
91221
  parsedDocument: parsedTag,
91178
91222
  node: {
@@ -97872,7 +97916,7 @@ var require_definition3 = __commonJS3({
97872
97916
  exports.assertObjectType = assertObjectType;
97873
97917
  exports.isInterfaceType = isInterfaceType12;
97874
97918
  exports.assertInterfaceType = assertInterfaceType;
97875
- exports.isUnionType = isUnionType12;
97919
+ exports.isUnionType = isUnionType13;
97876
97920
  exports.assertUnionType = assertUnionType;
97877
97921
  exports.isEnumType = isEnumType9;
97878
97922
  exports.assertEnumType = assertEnumType;
@@ -97890,7 +97934,7 @@ var require_definition3 = __commonJS3({
97890
97934
  exports.assertLeafType = assertLeafType;
97891
97935
  exports.isCompositeType = isCompositeType;
97892
97936
  exports.assertCompositeType = assertCompositeType;
97893
- exports.isAbstractType = isAbstractType;
97937
+ exports.isAbstractType = isAbstractType2;
97894
97938
  exports.assertAbstractType = assertAbstractType;
97895
97939
  exports.GraphQLList = GraphQLList6;
97896
97940
  exports.GraphQLNonNull = GraphQLNonNull6;
@@ -97945,7 +97989,7 @@ var require_definition3 = __commonJS3({
97945
97989
  return Constructor;
97946
97990
  }
97947
97991
  function isType(type) {
97948
- return isScalarType12(type) || isObjectType11(type) || isInterfaceType12(type) || isUnionType12(type) || isEnumType9(type) || isInputObjectType7(type) || isListType8(type) || isNonNullType10(type);
97992
+ return isScalarType12(type) || isObjectType11(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType9(type) || isInputObjectType7(type) || isListType8(type) || isNonNullType10(type);
97949
97993
  }
97950
97994
  function assertType(type) {
97951
97995
  if (!isType(type)) {
@@ -97980,11 +98024,11 @@ var require_definition3 = __commonJS3({
97980
98024
  }
97981
98025
  return type;
97982
98026
  }
97983
- function isUnionType12(type) {
98027
+ function isUnionType13(type) {
97984
98028
  return (0, _instanceOf.default)(type, GraphQLUnionType3);
97985
98029
  }
97986
98030
  function assertUnionType(type) {
97987
- if (!isUnionType12(type)) {
98031
+ if (!isUnionType13(type)) {
97988
98032
  throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Union type."));
97989
98033
  }
97990
98034
  return type;
@@ -98035,7 +98079,7 @@ var require_definition3 = __commonJS3({
98035
98079
  return type;
98036
98080
  }
98037
98081
  function isOutputType(type) {
98038
- return isScalarType12(type) || isObjectType11(type) || isInterfaceType12(type) || isUnionType12(type) || isEnumType9(type) || isWrappingType(type) && isOutputType(type.ofType);
98082
+ return isScalarType12(type) || isObjectType11(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType9(type) || isWrappingType(type) && isOutputType(type.ofType);
98039
98083
  }
98040
98084
  function assertOutputType(type) {
98041
98085
  if (!isOutputType(type)) {
@@ -98053,7 +98097,7 @@ var require_definition3 = __commonJS3({
98053
98097
  return type;
98054
98098
  }
98055
98099
  function isCompositeType(type) {
98056
- return isObjectType11(type) || isInterfaceType12(type) || isUnionType12(type);
98100
+ return isObjectType11(type) || isInterfaceType12(type) || isUnionType13(type);
98057
98101
  }
98058
98102
  function assertCompositeType(type) {
98059
98103
  if (!isCompositeType(type)) {
@@ -98061,11 +98105,11 @@ var require_definition3 = __commonJS3({
98061
98105
  }
98062
98106
  return type;
98063
98107
  }
98064
- function isAbstractType(type) {
98065
- return isInterfaceType12(type) || isUnionType12(type);
98108
+ function isAbstractType2(type) {
98109
+ return isInterfaceType12(type) || isUnionType13(type);
98066
98110
  }
98067
98111
  function assertAbstractType(type) {
98068
- if (!isAbstractType(type)) {
98112
+ if (!isAbstractType2(type)) {
98069
98113
  throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL abstract type."));
98070
98114
  }
98071
98115
  return type;
@@ -98132,7 +98176,7 @@ var require_definition3 = __commonJS3({
98132
98176
  }
98133
98177
  }
98134
98178
  function isNamedType4(type) {
98135
- return isScalarType12(type) || isObjectType11(type) || isInterfaceType12(type) || isUnionType12(type) || isEnumType9(type) || isInputObjectType7(type);
98179
+ return isScalarType12(type) || isObjectType11(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType9(type) || isInputObjectType7(type);
98136
98180
  }
98137
98181
  function assertNamedType(type) {
98138
98182
  if (!isNamedType4(type)) {
@@ -151568,6 +151612,18 @@ function deepEquals2(objA, objB, map = /* @__PURE__ */ new WeakMap()) {
151568
151612
  }
151569
151613
  return true;
151570
151614
  }
151615
+ function getFieldsForType2(selection2, __typename) {
151616
+ let targetSelection = selection2.fields || {};
151617
+ if (selection2.abstractFields && __typename) {
151618
+ const mappedType = selection2.abstractFields.typeMap[__typename];
151619
+ if (mappedType) {
151620
+ targetSelection = selection2.abstractFields.fields[mappedType];
151621
+ } else if (selection2.abstractFields.fields[__typename]) {
151622
+ targetSelection = selection2.abstractFields.fields[__typename];
151623
+ }
151624
+ }
151625
+ return targetSelection;
151626
+ }
151571
151627
  var GarbageCollector2 = class {
151572
151628
  cache;
151573
151629
  lifetimes = /* @__PURE__ */ new Map();
@@ -151785,23 +151841,32 @@ var List2 = class {
151785
151841
  let insertData = data2;
151786
151842
  if (this.connection) {
151787
151843
  insertSelection = {
151788
- newEntry: {
151789
- keyRaw: this.key,
151790
- type: "Connection",
151791
- fields: {
151792
- edges: {
151793
- keyRaw: "edges",
151794
- type: "ConnectionEdge",
151795
- update: where === "first" ? "prepend" : "append",
151844
+ fields: {
151845
+ newEntry: {
151846
+ keyRaw: this.key,
151847
+ type: "Connection",
151848
+ selection: {
151796
151849
  fields: {
151797
- node: {
151798
- type: listType,
151799
- keyRaw: "node",
151800
- fields: {
151801
- ...selection2,
151802
- __typename: {
151803
- keyRaw: "__typename",
151804
- type: "String"
151850
+ edges: {
151851
+ keyRaw: "edges",
151852
+ type: "ConnectionEdge",
151853
+ update: where === "first" ? "prepend" : "append",
151854
+ selection: {
151855
+ fields: {
151856
+ node: {
151857
+ type: listType,
151858
+ keyRaw: "node",
151859
+ selection: {
151860
+ ...selection2,
151861
+ fields: {
151862
+ ...selection2.fields,
151863
+ __typename: {
151864
+ keyRaw: "__typename",
151865
+ type: "String"
151866
+ }
151867
+ }
151868
+ }
151869
+ }
151805
151870
  }
151806
151871
  }
151807
151872
  }
@@ -151817,15 +151882,20 @@ var List2 = class {
151817
151882
  };
151818
151883
  } else {
151819
151884
  insertSelection = {
151820
- newEntries: {
151821
- keyRaw: this.key,
151822
- type: listType,
151823
- update: where === "first" ? "prepend" : "append",
151824
- fields: {
151825
- ...selection2,
151826
- __typename: {
151827
- keyRaw: "__typename",
151828
- type: "String"
151885
+ fields: {
151886
+ newEntries: {
151887
+ keyRaw: this.key,
151888
+ type: listType,
151889
+ update: where === "first" ? "prepend" : "append",
151890
+ selection: {
151891
+ ...selection2,
151892
+ fields: {
151893
+ ...selection2.fields,
151894
+ __typename: {
151895
+ keyRaw: "__typename",
151896
+ type: "String"
151897
+ }
151898
+ }
151829
151899
  }
151830
151900
  }
151831
151901
  }
@@ -151885,7 +151955,7 @@ var List2 = class {
151885
151955
  const subscribers = this.cache._internal_unstable.subscriptions.get(this.recordID, this.key);
151886
151956
  this.cache._internal_unstable.subscriptions.remove(
151887
151957
  targetID,
151888
- this.connection ? this.selection.edges.fields : this.selection,
151958
+ this.connection ? this.selection.fields.edges.selection : this.selection,
151889
151959
  subscribers,
151890
151960
  variables
151891
151961
  );
@@ -152370,18 +152440,20 @@ var InMemorySubscriptions2 = class {
152370
152440
  variables,
152371
152441
  parentType
152372
152442
  }) {
152373
- for (const fieldSelection of Object.values(selection2)) {
152374
- const { keyRaw, fields, type } = fieldSelection;
152443
+ const __typename = this.cache._internal_unstable.storage.get(parent, "__typename").value;
152444
+ let targetSelection = getFieldsForType2(selection2, __typename);
152445
+ for (const fieldSelection of Object.values(targetSelection || {})) {
152446
+ const { keyRaw, selection: innerSelection, type } = fieldSelection;
152375
152447
  const key = evaluateKey2(keyRaw, variables);
152376
152448
  this.addFieldSubscription({
152377
152449
  id: parent,
152378
152450
  key,
152379
- selection: fieldSelection,
152451
+ field: fieldSelection,
152380
152452
  spec,
152381
152453
  parentType: parentType || spec.rootType,
152382
152454
  variables
152383
152455
  });
152384
- if (fields) {
152456
+ if (innerSelection) {
152385
152457
  const { value: linkedRecord } = this.cache._internal_unstable.storage.get(
152386
152458
  parent,
152387
152459
  key
@@ -152394,7 +152466,7 @@ var InMemorySubscriptions2 = class {
152394
152466
  this.add({
152395
152467
  parent: child,
152396
152468
  spec,
152397
- selection: fields,
152469
+ selection: innerSelection,
152398
152470
  variables,
152399
152471
  parentType: type
152400
152472
  });
@@ -152405,7 +152477,7 @@ var InMemorySubscriptions2 = class {
152405
152477
  addFieldSubscription({
152406
152478
  id: id2,
152407
152479
  key,
152408
- selection: selection2,
152480
+ field,
152409
152481
  spec,
152410
152482
  parentType,
152411
152483
  variables
@@ -152432,8 +152504,8 @@ var InMemorySubscriptions2 = class {
152432
152504
  const counts = this.referenceCounts[id2][key];
152433
152505
  counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
152434
152506
  this.cache._internal_unstable.lifetimes.resetLifetime(id2, key);
152435
- const { fields, list, filters } = selection2;
152436
- if (fields && list) {
152507
+ const { selection: selection2, list, filters } = field;
152508
+ if (selection2 && list) {
152437
152509
  this.cache._internal_unstable.lists.add({
152438
152510
  name: list.name,
152439
152511
  connection: list.connection,
@@ -152441,7 +152513,7 @@ var InMemorySubscriptions2 = class {
152441
152513
  recordType: this.cache._internal_unstable.storage.get(id2, "__typename")?.value || parentType,
152442
152514
  listType: list.type,
152443
152515
  key,
152444
- selection: fields,
152516
+ selection: selection2,
152445
152517
  filters: Object.entries(filters || {}).reduce((acc, [key2, { kind, value: value2 }]) => {
152446
152518
  return {
152447
152519
  ...acc,
@@ -152458,20 +152530,21 @@ var InMemorySubscriptions2 = class {
152458
152530
  subscribers,
152459
152531
  parentType
152460
152532
  }) {
152461
- for (const fieldSelection of Object.values(selection2)) {
152462
- const { type: linkedType, keyRaw, fields } = fieldSelection;
152533
+ let targetSelection = getFieldsForType2(selection2, parentType);
152534
+ for (const fieldSelection of Object.values(targetSelection)) {
152535
+ const { type: linkedType, keyRaw, selection: innerSelection } = fieldSelection;
152463
152536
  const key = evaluateKey2(keyRaw, variables);
152464
152537
  for (const spec of subscribers) {
152465
152538
  this.addFieldSubscription({
152466
152539
  id: parent,
152467
152540
  key,
152468
- selection: fieldSelection,
152541
+ field: fieldSelection,
152469
152542
  spec,
152470
152543
  parentType,
152471
152544
  variables
152472
152545
  });
152473
152546
  }
152474
- if (fields) {
152547
+ if (innerSelection) {
152475
152548
  const { value: link } = this.cache._internal_unstable.storage.get(parent, key);
152476
152549
  const children = !Array.isArray(link) ? [link] : flattenList2(link);
152477
152550
  for (const linkedRecord of children) {
@@ -152480,7 +152553,7 @@ var InMemorySubscriptions2 = class {
152480
152553
  }
152481
152554
  this.addMany({
152482
152555
  parent: linkedRecord,
152483
- selection: fields,
152556
+ selection: innerSelection,
152484
152557
  variables,
152485
152558
  subscribers,
152486
152559
  parentType: linkedType
@@ -152492,22 +152565,20 @@ var InMemorySubscriptions2 = class {
152492
152565
  get(id2, field) {
152493
152566
  return this.subscribers[id2]?.[field] || [];
152494
152567
  }
152495
- remove(id2, fields, targets, variables, visited = []) {
152568
+ remove(id2, selection2, targets, variables, visited = []) {
152496
152569
  visited.push(id2);
152497
152570
  const linkedIDs = [];
152498
- for (const selection2 of Object.values(fields)) {
152499
- const key = evaluateKey2(selection2.keyRaw, variables);
152571
+ for (const fieldSelection of Object.values(selection2.fields || {})) {
152572
+ const key = evaluateKey2(fieldSelection.keyRaw, variables);
152500
152573
  this.removeSubscribers(id2, key, targets);
152501
- if (!selection2.fields) {
152574
+ if (!fieldSelection.selection?.fields) {
152502
152575
  continue;
152503
152576
  }
152504
- if (selection2.list) {
152505
- }
152506
152577
  const { value: previousValue } = this.cache._internal_unstable.storage.get(id2, key);
152507
152578
  const links = !Array.isArray(previousValue) ? [previousValue] : flattenList2(previousValue);
152508
152579
  for (const link of links) {
152509
152580
  if (link !== null) {
152510
- linkedIDs.push([link, selection2.fields]);
152581
+ linkedIDs.push([link, fieldSelection.selection || {}]);
152511
152582
  }
152512
152583
  }
152513
152584
  }
@@ -152683,8 +152754,9 @@ var CacheInternal2 = class {
152683
152754
  if (this._disabled) {
152684
152755
  return [];
152685
152756
  }
152757
+ let targetSelection = getFieldsForType2(selection2, data2["__typename"]);
152686
152758
  for (const [field, value2] of Object.entries(data2)) {
152687
- if (!selection2 || !selection2[field]) {
152759
+ if (!selection2 || !targetSelection[field]) {
152688
152760
  throw new Error(
152689
152761
  "Could not find field listing in selection for " + field + " @ " + JSON.stringify(selection2)
152690
152762
  );
@@ -152692,11 +152764,11 @@ var CacheInternal2 = class {
152692
152764
  let {
152693
152765
  type: linkedType,
152694
152766
  keyRaw,
152695
- fields,
152767
+ selection: fieldSelection,
152696
152768
  operations,
152697
152769
  abstract: isAbstract,
152698
152770
  update
152699
- } = selection2[field];
152771
+ } = targetSelection[field];
152700
152772
  const key = evaluateKey2(keyRaw, variables);
152701
152773
  const currentSubscribers = this.subscriptions.get(parent, key);
152702
152774
  const { value: previousValue, displayLayers } = this.storage.get(parent, key);
@@ -152704,7 +152776,7 @@ var CacheInternal2 = class {
152704
152776
  if (displayLayer) {
152705
152777
  this.lifetimes.resetLifetime(parent, key);
152706
152778
  }
152707
- if (!fields) {
152779
+ if (!fieldSelection) {
152708
152780
  let newValue = value2;
152709
152781
  if (Array.isArray(value2) && applyUpdates && update) {
152710
152782
  if (update === "append") {
@@ -152724,7 +152796,7 @@ var CacheInternal2 = class {
152724
152796
  }
152725
152797
  const previousLinks = flattenList2([previousValue]);
152726
152798
  for (const link of previousLinks) {
152727
- this.subscriptions.remove(link, fields, currentSubscribers, variables);
152799
+ this.subscriptions.remove(link, fieldSelection, currentSubscribers, variables);
152728
152800
  }
152729
152801
  layer.writeLink(parent, key, null);
152730
152802
  toNotify.push(...currentSubscribers);
@@ -152750,14 +152822,14 @@ var CacheInternal2 = class {
152750
152822
  if (previousValue && typeof previousValue === "string") {
152751
152823
  this.subscriptions.remove(
152752
152824
  previousValue,
152753
- fields,
152825
+ fieldSelection,
152754
152826
  currentSubscribers,
152755
152827
  variables
152756
152828
  );
152757
152829
  }
152758
152830
  this.subscriptions.addMany({
152759
152831
  parent: linkedID,
152760
- selection: fields,
152832
+ selection: fieldSelection,
152761
152833
  subscribers: currentSubscribers,
152762
152834
  variables,
152763
152835
  parentType: linkedType
@@ -152767,14 +152839,14 @@ var CacheInternal2 = class {
152767
152839
  if (linkedID) {
152768
152840
  this.writeSelection({
152769
152841
  root,
152770
- selection: fields,
152842
+ selection: fieldSelection,
152771
152843
  parent: linkedID,
152772
152844
  data: value2,
152773
152845
  variables,
152774
152846
  toNotify,
152775
152847
  applyUpdates,
152776
152848
  layer,
152777
- forceNotify: true
152849
+ forceNotify
152778
152850
  });
152779
152851
  }
152780
152852
  } else if (Array.isArray(value2) && (typeof previousValue === "undefined" || Array.isArray(previousValue))) {
@@ -152803,7 +152875,7 @@ var CacheInternal2 = class {
152803
152875
  key,
152804
152876
  linkedType,
152805
152877
  variables,
152806
- fields,
152878
+ fields: fieldSelection,
152807
152879
  layer,
152808
152880
  forceNotify
152809
152881
  });
@@ -152853,7 +152925,7 @@ var CacheInternal2 = class {
152853
152925
  if (linkedIDs.includes(lostID) || !lostID) {
152854
152926
  continue;
152855
152927
  }
152856
- this.subscriptions.remove(lostID, fields, currentSubscribers, variables);
152928
+ this.subscriptions.remove(lostID, fieldSelection, currentSubscribers, variables);
152857
152929
  }
152858
152930
  if (contentChanged || oldIDs.length === 0 && newIDs.length === 0) {
152859
152931
  layer.writeLink(parent, key, linkedIDs);
@@ -152864,7 +152936,7 @@ var CacheInternal2 = class {
152864
152936
  }
152865
152937
  this.subscriptions.addMany({
152866
152938
  parent: id2,
152867
- selection: fields,
152939
+ selection: fieldSelection,
152868
152940
  subscribers: currentSubscribers,
152869
152941
  variables,
152870
152942
  parentType: linkedType
@@ -152889,9 +152961,14 @@ var CacheInternal2 = class {
152889
152961
  }
152890
152962
  const targets = Array.isArray(value2) ? value2 : [value2];
152891
152963
  for (const target of targets) {
152892
- if (operation.action === "insert" && target instanceof Object && fields && operation.list) {
152893
- this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(fields, target, variables, operation.position || "last");
152894
- } else if (operation.action === "remove" && target instanceof Object && fields && operation.list) {
152964
+ if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
152965
+ this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(
152966
+ fieldSelection,
152967
+ target,
152968
+ variables,
152969
+ operation.position || "last"
152970
+ );
152971
+ } else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
152895
152972
  this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
152896
152973
  } else if (operation.action === "delete" && operation.type) {
152897
152974
  if (typeof target !== "string") {
@@ -152902,8 +152979,13 @@ var CacheInternal2 = class {
152902
152979
  continue;
152903
152980
  }
152904
152981
  this.cache.delete(targetID);
152905
- } else if (operation.action === "toggle" && target instanceof Object && fields && operation.list) {
152906
- this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
152982
+ } else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
152983
+ this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(
152984
+ fieldSelection,
152985
+ target,
152986
+ variables,
152987
+ operation.position || "last"
152988
+ );
152907
152989
  }
152908
152990
  }
152909
152991
  }
@@ -152923,9 +153005,12 @@ var CacheInternal2 = class {
152923
153005
  let hasData = false;
152924
153006
  let partial = false;
152925
153007
  let cascadeNull = false;
152926
- for (const [attributeName, { type, keyRaw, fields, nullable, list }] of Object.entries(
152927
- selection2
152928
- )) {
153008
+ const typename = this.storage.get(parent, "__typename").value;
153009
+ let targetSelection = getFieldsForType2(selection2, typename);
153010
+ for (const [
153011
+ attributeName,
153012
+ { type, keyRaw, selection: fieldSelection, nullable, list }
153013
+ ] of Object.entries(targetSelection)) {
152929
153014
  const key = evaluateKey2(keyRaw, variables);
152930
153015
  const { value: value2 } = this.storage.get(parent, key);
152931
153016
  let nextStep = stepsFromConnection;
@@ -152948,7 +153033,7 @@ var CacheInternal2 = class {
152948
153033
  if (typeof value2 !== "undefined") {
152949
153034
  hasData = true;
152950
153035
  }
152951
- } else if (!fields) {
153036
+ } else if (!fieldSelection) {
152952
153037
  const fnUnmarshal = this.config?.scalars?.[type]?.unmarshal;
152953
153038
  if (fnUnmarshal) {
152954
153039
  target[attributeName] = fnUnmarshal(value2);
@@ -152958,7 +153043,7 @@ var CacheInternal2 = class {
152958
153043
  hasData = true;
152959
153044
  } else if (Array.isArray(value2)) {
152960
153045
  const listValue = this.hydrateNestedList({
152961
- fields,
153046
+ fields: fieldSelection,
152962
153047
  variables,
152963
153048
  linkedList: value2,
152964
153049
  stepsFromConnection: nextStep
@@ -152973,7 +153058,7 @@ var CacheInternal2 = class {
152973
153058
  } else {
152974
153059
  const objectFields = this.getSelection({
152975
153060
  parent: value2,
152976
- selection: fields,
153061
+ selection: fieldSelection,
152977
153062
  variables,
152978
153063
  stepsFromConnection: nextStep
152979
153064
  });
@@ -162386,54 +162471,54 @@ function createParseContext(name2) {
162386
162471
  return this[name2]();
162387
162472
  };
162388
162473
  }
162389
- function processConfig(config2) {
162474
+ function processConfig(config3) {
162390
162475
  var parserConfig = {
162391
162476
  context: {},
162392
162477
  scope: {},
162393
162478
  atrule: {},
162394
162479
  pseudo: {}
162395
162480
  };
162396
- if (config2.parseContext) {
162397
- for (var name2 in config2.parseContext) {
162398
- switch (typeof config2.parseContext[name2]) {
162481
+ if (config3.parseContext) {
162482
+ for (var name2 in config3.parseContext) {
162483
+ switch (typeof config3.parseContext[name2]) {
162399
162484
  case "function":
162400
- parserConfig.context[name2] = config2.parseContext[name2];
162485
+ parserConfig.context[name2] = config3.parseContext[name2];
162401
162486
  break;
162402
162487
  case "string":
162403
- parserConfig.context[name2] = createParseContext(config2.parseContext[name2]);
162488
+ parserConfig.context[name2] = createParseContext(config3.parseContext[name2]);
162404
162489
  break;
162405
162490
  }
162406
162491
  }
162407
162492
  }
162408
- if (config2.scope) {
162409
- for (var name2 in config2.scope) {
162410
- parserConfig.scope[name2] = config2.scope[name2];
162493
+ if (config3.scope) {
162494
+ for (var name2 in config3.scope) {
162495
+ parserConfig.scope[name2] = config3.scope[name2];
162411
162496
  }
162412
162497
  }
162413
- if (config2.atrule) {
162414
- for (var name2 in config2.atrule) {
162415
- var atrule2 = config2.atrule[name2];
162498
+ if (config3.atrule) {
162499
+ for (var name2 in config3.atrule) {
162500
+ var atrule2 = config3.atrule[name2];
162416
162501
  if (atrule2.parse) {
162417
162502
  parserConfig.atrule[name2] = atrule2.parse;
162418
162503
  }
162419
162504
  }
162420
162505
  }
162421
- if (config2.pseudo) {
162422
- for (var name2 in config2.pseudo) {
162423
- var pseudo2 = config2.pseudo[name2];
162506
+ if (config3.pseudo) {
162507
+ for (var name2 in config3.pseudo) {
162508
+ var pseudo2 = config3.pseudo[name2];
162424
162509
  if (pseudo2.parse) {
162425
162510
  parserConfig.pseudo[name2] = pseudo2.parse;
162426
162511
  }
162427
162512
  }
162428
162513
  }
162429
- if (config2.node) {
162430
- for (var name2 in config2.node) {
162431
- parserConfig[name2] = config2.node[name2].parse;
162514
+ if (config3.node) {
162515
+ for (var name2 in config3.node) {
162516
+ parserConfig[name2] = config3.node[name2].parse;
162432
162517
  }
162433
162518
  }
162434
162519
  return parserConfig;
162435
162520
  }
162436
- var create = function createParser(config2) {
162521
+ var create = function createParser(config3) {
162437
162522
  var parser2 = {
162438
162523
  scanner: new TokenStream_1(),
162439
162524
  locationMap: new OffsetToLocation_1(),
@@ -162560,9 +162645,9 @@ var create = function createParser(config2) {
162560
162645
  );
162561
162646
  }
162562
162647
  };
162563
- config2 = processConfig(config2 || {});
162564
- for (var key in config2) {
162565
- parser2[key] = config2[key];
162648
+ config3 = processConfig(config3 || {});
162649
+ for (var key in config3) {
162650
+ parser2[key] = config3[key];
162566
162651
  }
162567
162652
  return function(source, options) {
162568
162653
  options = options || {};
@@ -179318,7 +179403,18 @@ function findScriptInnerBounds({
179318
179403
  // src/plugin/extractLoadFunction.ts
179319
179404
  var graphql20 = __toESM(require_graphql4(), 1);
179320
179405
  import { transformWithEsbuild } from "vite";
179321
- async function extract_load_function(config2, filepath, mockArtifacts) {
179406
+
179407
+ // src/plugin/naming.ts
179408
+ var query_variable_fn = (name2) => {
179409
+ return `_${name2}Variables`;
179410
+ };
179411
+ var houdini_load_fn = "_houdini_load";
179412
+ var houdini_before_load_fn = "_houdini_beforeLoad";
179413
+ var houdini_after_load_fn = "_houdini_afterLoad";
179414
+ var houdini_on_error_fn = "_houdini_onError";
179415
+
179416
+ // src/plugin/extractLoadFunction.ts
179417
+ async function extract_load_function(config3, filepath, mockArtifacts) {
179322
179418
  const nil = {
179323
179419
  houdini_load: [],
179324
179420
  exports: []
@@ -179338,7 +179434,7 @@ async function extract_load_function(config2, filepath, mockArtifacts) {
179338
179434
  if (!parsed) {
179339
179435
  return nil;
179340
179436
  }
179341
- const { exports, load } = await processScript(config2, filepath, parsed, mockArtifacts);
179437
+ const { exports, load } = await processScript(config3, filepath, parsed, mockArtifacts);
179342
179438
  return {
179343
179439
  exports,
179344
179440
  houdini_load: load.map(
@@ -179346,7 +179442,7 @@ async function extract_load_function(config2, filepath, mockArtifacts) {
179346
179442
  )
179347
179443
  };
179348
179444
  }
179349
- async function processScript(config2, filepath, program, mockArtifacts) {
179445
+ async function processScript(config3, filepath, program, mockArtifacts) {
179350
179446
  const exports = [];
179351
179447
  const globalImports = {};
179352
179448
  let houdiniLoad = null;
@@ -179359,16 +179455,16 @@ async function processScript(config2, filepath, program, mockArtifacts) {
179359
179455
  for (const specifier of statement.specifiers ?? []) {
179360
179456
  let name2 = specifier.local?.name || "";
179361
179457
  let query = "";
179362
- const store_prefix = plugin_config(config2).globalStorePrefix;
179458
+ const store_prefix = plugin_config(config3).globalStorePrefix;
179363
179459
  if (store_prefix && name2.startsWith(store_prefix)) {
179364
179460
  query = name2.substring(store_prefix.length);
179365
- } else if (name2.endsWith(store_suffix(config2))) {
179366
- query = name2.substring(0, name2.length - store_suffix(config2).length);
179461
+ } else if (name2.endsWith(store_suffix(config3))) {
179462
+ query = name2.substring(0, name2.length - store_suffix(config3).length);
179367
179463
  } else if (source.startsWith("$houdini/" + stores_directory_name()) && specifier.type === "ImportDefaultSpecifier") {
179368
179464
  query = source.substring(`$houdini/${stores_directory_name()}`.length - 1);
179369
179465
  }
179370
179466
  if (query) {
179371
- const artifact = mockArtifacts?.[query] || (await import(path_exports.importPath(path_exports.join(config2.artifactDirectory, query + ".js")))).default;
179467
+ const artifact = mockArtifacts?.[query] || (await import(path_exports.importPath(path_exports.join(config3.artifactDirectory, query + ".js")))).default;
179372
179468
  globalImports[name2] = artifact.raw;
179373
179469
  }
179374
179470
  }
@@ -179376,7 +179472,7 @@ async function processScript(config2, filepath, program, mockArtifacts) {
179376
179472
  } else if (statement.type === "ExportNamedDeclaration") {
179377
179473
  if (statement.declaration?.type === "VariableDeclaration" && statement.declaration.declarations.length === 1 && statement.declaration.declarations[0].type === "VariableDeclarator" && statement.declaration.declarations[0].id.type === "Identifier") {
179378
179474
  exports.push(statement.declaration.declarations[0].id.name);
179379
- if (statement.declaration.declarations[0].id.name === "houdini_load" && statement.declaration.declarations[0].init) {
179475
+ if (statement.declaration.declarations[0].id.name === houdini_load_fn && statement.declaration.declarations[0].init) {
179380
179476
  houdiniLoad = statement.declaration.declarations[0].init;
179381
179477
  }
179382
179478
  } else if (statement.declaration?.type === "FunctionDeclaration" && statement.declaration.id?.type === "Identifier") {
@@ -179409,12 +179505,14 @@ async function processScript(config2, filepath, program, mockArtifacts) {
179409
179505
  load.push(result);
179410
179506
  if (!result) {
179411
179507
  throw new Error(
179412
- "Could not find query for computing houdini_load: " + element.name + ". filepath: " + filepath
179508
+ `Could not find query for computing ${houdini_load_fn}: ` + element.name + ". filepath: " + filepath
179413
179509
  );
179414
179510
  }
179415
179511
  } else if (element.type === "TaggedTemplateExpression") {
179416
179512
  if (element.tag.type !== "Identifier" || element.tag.name !== "graphql") {
179417
- throw new Error("only graphql template tags can be passed to houdini_load");
179513
+ throw new Error(
179514
+ `only graphql template tags can be passed to ${houdini_load_fn}`
179515
+ );
179418
179516
  }
179419
179517
  load.push(element.quasi.quasis[0].value.raw);
179420
179518
  }
@@ -179431,7 +179529,7 @@ function identifyQueryReference(imports, statement) {
179431
179529
  return null;
179432
179530
  }
179433
179531
  const local = declaration.id.name;
179434
- if (local === "houdini_load") {
179532
+ if (local === houdini_load_fn) {
179435
179533
  return null;
179436
179534
  }
179437
179535
  const value2 = declaration.init;
@@ -179446,7 +179544,7 @@ function identifyQueryReference(imports, statement) {
179446
179544
  }
179447
179545
  if (value2.type === "TaggedTemplateExpression") {
179448
179546
  if (value2.tag.type !== "Identifier" || value2.tag.name !== "graphql") {
179449
- throw new Error("only graphql template tags can be passed to houdini_load");
179547
+ throw new Error(`only graphql template tags can be passed to ${houdini_load_fn}`);
179450
179548
  }
179451
179549
  return { local, query: value2.quasi.quasis[0].value.raw };
179452
179550
  }
@@ -179454,17 +179552,17 @@ function identifyQueryReference(imports, statement) {
179454
179552
  }
179455
179553
 
179456
179554
  // src/plugin/kit.ts
179457
- function is_route(config2, framework2, filepath) {
179555
+ function is_route(config3, framework2, filepath) {
179458
179556
  if (framework2 === "svelte") {
179459
179557
  return false;
179460
179558
  }
179461
- if (!filepath.startsWith(config2.routesDir)) {
179559
+ if (!filepath.startsWith(config3.routesDir)) {
179462
179560
  return false;
179463
179561
  }
179464
179562
  return ["+layout.svelte", "+page.svelte"].includes(path_exports.parse(filepath).base);
179465
179563
  }
179466
- function route_data_path(config2, filename) {
179467
- return resolve_relative(config2, filename).replace(".svelte", ".js");
179564
+ function route_data_path(config3, filename) {
179565
+ return resolve_relative(config3, filename).replace(".svelte", ".js");
179468
179566
  }
179469
179567
  function is_route_script(framework2, filename) {
179470
179568
  return is_page_script(framework2, filename) || is_layout_script(framework2, filename);
@@ -179475,14 +179573,14 @@ function is_page_script(framework2, filename) {
179475
179573
  function is_layout_script(framework2, filename) {
179476
179574
  return framework2 === "kit" && (filename.endsWith("+layout.js") || filename.endsWith("+layout.ts"));
179477
179575
  }
179478
- function is_root_layout(config2, filename) {
179479
- return resolve_relative(config2, filename).replace(config2.projectRoot, "") === path_exports.sep + path_exports.join("src", "routes", "+layout.svelte");
179576
+ function is_root_layout(config3, filename) {
179577
+ return resolve_relative(config3, filename).replace(config3.projectRoot, "") === path_exports.sep + path_exports.join("src", "routes", "+layout.svelte");
179480
179578
  }
179481
- function is_root_layout_server(config2, filename) {
179482
- return resolve_relative(config2, filename).replace(config2.projectRoot, "").replace(".ts", ".js") === path_exports.sep + path_exports.join("src", "routes", "+layout.server.js");
179579
+ function is_root_layout_server(config3, filename) {
179580
+ return resolve_relative(config3, filename).replace(config3.projectRoot, "").replace(".ts", ".js") === path_exports.sep + path_exports.join("src", "routes", "+layout.server.js");
179483
179581
  }
179484
- function is_root_layout_script(config2, filename) {
179485
- return resolve_relative(config2, filename).replace(config2.projectRoot, "").replace(".ts", ".js") === path_exports.sep + path_exports.join("src", "routes", "+layout.js");
179582
+ function is_root_layout_script(config3, filename) {
179583
+ return resolve_relative(config3, filename).replace(config3.projectRoot, "").replace(".ts", ".js") === path_exports.sep + path_exports.join("src", "routes", "+layout.js");
179486
179584
  }
179487
179585
  function is_layout_component(framework2, filename) {
179488
179586
  return framework2 === "kit" && filename.endsWith("+layout.svelte");
@@ -179490,29 +179588,29 @@ function is_layout_component(framework2, filename) {
179490
179588
  function is_layout(framework2, filename) {
179491
179589
  return is_layout_script(framework2, filename) || is_layout_component(framework2, filename);
179492
179590
  }
179493
- function is_component(config2, framework2, filename) {
179494
- return framework2 === "svelte" || filename.endsWith(".svelte") && !is_route_script(framework2, filename) && !is_route(config2, framework2, filename);
179591
+ function is_component(config3, framework2, filename) {
179592
+ return framework2 === "svelte" || filename.endsWith(".svelte") && !is_route_script(framework2, filename) && !is_route(config3, framework2, filename);
179495
179593
  }
179496
- function page_query_path(config2, filename) {
179594
+ function page_query_path(config3, filename) {
179497
179595
  return path_exports.join(
179498
- path_exports.dirname(resolve_relative(config2, filename)),
179499
- plugin_config(config2).pageQueryFilename
179596
+ path_exports.dirname(resolve_relative(config3, filename)),
179597
+ plugin_config(config3).pageQueryFilename
179500
179598
  );
179501
179599
  }
179502
- function layout_query_path(config2, filename) {
179600
+ function layout_query_path(config3, filename) {
179503
179601
  return path_exports.join(
179504
- path_exports.dirname(resolve_relative(config2, filename)),
179505
- plugin_config(config2).layoutQueryFilename
179602
+ path_exports.dirname(resolve_relative(config3, filename)),
179603
+ plugin_config(config3).layoutQueryFilename
179506
179604
  );
179507
179605
  }
179508
- function resolve_relative(config2, filename) {
179606
+ function resolve_relative(config3, filename) {
179509
179607
  const match = filename.match("^((../)+)src/routes");
179510
179608
  if (match) {
179511
- filename = path_exports.join(config2.projectRoot, filename.substring(match[1].length));
179609
+ filename = path_exports.join(config3.projectRoot, filename.substring(match[1].length));
179512
179610
  }
179513
179611
  return filename;
179514
179612
  }
179515
- async function walk_routes(config2, framework2, visitor, dirpath = config2.routesDir) {
179613
+ async function walk_routes(config3, framework2, visitor, dirpath = config3.routesDir) {
179516
179614
  let pageExports = [];
179517
179615
  let layoutExports = [];
179518
179616
  let pageQueries = [];
@@ -179521,19 +179619,19 @@ async function walk_routes(config2, framework2, visitor, dirpath = config2.route
179521
179619
  for (const child of await fs_exports.readdir(dirpath)) {
179522
179620
  const childPath = path_exports.join(dirpath, child);
179523
179621
  if ((await fs_exports.stat(childPath)).isDirectory()) {
179524
- await walk_routes(config2, framework2, visitor, childPath);
179622
+ await walk_routes(config3, framework2, visitor, childPath);
179525
179623
  continue;
179526
179624
  }
179527
179625
  if (is_layout_script(framework2, childPath)) {
179528
179626
  validRoute = true;
179529
- const { houdini_load, exports } = await extract_load_function(config2, childPath);
179627
+ const { houdini_load, exports } = await extract_load_function(config3, childPath);
179530
179628
  await visitor.layoutQueries?.(houdini_load ?? [], childPath);
179531
179629
  layoutQueries.push(...houdini_load ?? []);
179532
179630
  await visitor.layoutExports?.(exports, childPath);
179533
179631
  layoutExports.push(...exports);
179534
179632
  } else if (is_page_script(framework2, childPath)) {
179535
179633
  validRoute = true;
179536
- const { houdini_load, exports } = await extract_load_function(config2, childPath);
179634
+ const { houdini_load, exports } = await extract_load_function(config3, childPath);
179537
179635
  await visitor.pageQueries?.(houdini_load ?? [], childPath);
179538
179636
  pageQueries.push(...houdini_load ?? []);
179539
179637
  await visitor.pageExports?.(exports, childPath);
@@ -179548,21 +179646,21 @@ async function walk_routes(config2, framework2, visitor, dirpath = config2.route
179548
179646
  if (!parsed) {
179549
179647
  continue;
179550
179648
  }
179551
- await find_graphql(config2, parsed.script, {
179649
+ await find_graphql(config3, parsed.script, {
179552
179650
  where: (tag2) => {
179553
179651
  try {
179554
- return !!config2.extractQueryDefinition(tag2);
179652
+ return !!config3.extractQueryDefinition(tag2);
179555
179653
  } catch {
179556
179654
  return false;
179557
179655
  }
179558
179656
  },
179559
179657
  tag: async ({ parsedDocument }) => {
179560
- let definition = config2.extractQueryDefinition(parsedDocument);
179658
+ let definition = config3.extractQueryDefinition(parsedDocument);
179561
179659
  await visitor.inlineLayoutQueries?.(definition, childPath);
179562
179660
  layoutQueries.push(definition);
179563
179661
  }
179564
179662
  });
179565
- } else if (is_component(config2, framework2, child)) {
179663
+ } else if (is_component(config3, framework2, child)) {
179566
179664
  validRoute = true;
179567
179665
  const contents = await fs_exports.readFile(childPath);
179568
179666
  if (!contents) {
@@ -179572,41 +179670,41 @@ async function walk_routes(config2, framework2, visitor, dirpath = config2.route
179572
179670
  if (!parsed) {
179573
179671
  continue;
179574
179672
  }
179575
- await find_graphql(config2, parsed.script, {
179673
+ await find_graphql(config3, parsed.script, {
179576
179674
  where: (tag2) => {
179577
179675
  try {
179578
- return !!config2.extractQueryDefinition(tag2);
179676
+ return !!config3.extractQueryDefinition(tag2);
179579
179677
  } catch {
179580
179678
  return false;
179581
179679
  }
179582
179680
  },
179583
179681
  tag: async ({ parsedDocument }) => {
179584
- let definition = config2.extractQueryDefinition(parsedDocument);
179682
+ let definition = config3.extractQueryDefinition(parsedDocument);
179585
179683
  await visitor.inlinePageQueries?.(definition, childPath);
179586
179684
  pageQueries.push(definition);
179587
179685
  }
179588
179686
  });
179589
- } else if (child === plugin_config(config2).layoutQueryFilename) {
179687
+ } else if (child === plugin_config(config3).layoutQueryFilename) {
179590
179688
  validRoute = true;
179591
179689
  const contents = await fs_exports.readFile(childPath);
179592
179690
  if (!contents) {
179593
179691
  continue;
179594
179692
  }
179595
179693
  try {
179596
- const query = config2.extractQueryDefinition(graphql28.parse(contents));
179694
+ const query = config3.extractQueryDefinition(graphql28.parse(contents));
179597
179695
  await visitor.routeLayoutQuery?.(query, childPath);
179598
179696
  layoutQueries.push(query);
179599
179697
  } catch (e3) {
179600
179698
  throw routeQueryError(childPath);
179601
179699
  }
179602
- } else if (child === plugin_config(config2).pageQueryFilename) {
179700
+ } else if (child === plugin_config(config3).pageQueryFilename) {
179603
179701
  validRoute = true;
179604
179702
  const contents = await fs_exports.readFile(childPath);
179605
179703
  if (!contents) {
179606
179704
  continue;
179607
179705
  }
179608
179706
  try {
179609
- const query = config2.extractQueryDefinition(graphql28.parse(contents));
179707
+ const query = config3.extractQueryDefinition(graphql28.parse(contents));
179610
179708
  await visitor.routePageQuery?.(query, childPath);
179611
179709
  pageQueries.push(query);
179612
179710
  } catch (e3) {
@@ -179619,14 +179717,14 @@ async function walk_routes(config2, framework2, visitor, dirpath = config2.route
179619
179717
  if (visitor.route && validRoute) {
179620
179718
  const relative_path_regex = /src(.*)/;
179621
179719
  const svelteTypeFilePath = path_exports.join(
179622
- config2.projectRoot,
179720
+ config3.projectRoot,
179623
179721
  ".svelte-kit",
179624
179722
  "types",
179625
179723
  dirpath.match(relative_path_regex)?.[0] ?? "",
179626
179724
  "$types.d.ts"
179627
179725
  );
179628
179726
  if (!fs_exports.existsSync(svelteTypeFilePath)) {
179629
- throw Error(`SvelteKit types do not exist at route: ${svelteTypeFilePath}`);
179727
+ return;
179630
179728
  }
179631
179729
  await visitor.route(
179632
179730
  {
@@ -179645,8 +179743,8 @@ var routeQueryError = (filepath) => ({
179645
179743
  filepath,
179646
179744
  message: "route query error"
179647
179745
  });
179648
- function route_page_path(config2, filename) {
179649
- return resolve_relative(config2, filename).replace(".js", ".svelte").replace(".ts", ".svelte");
179746
+ function route_page_path(config3, filename) {
179747
+ return resolve_relative(config3, filename).replace(".js", ".svelte").replace(".ts", ".svelte");
179650
179748
  }
179651
179749
  function stores_directory_name() {
179652
179750
  return "stores";
@@ -179654,24 +179752,25 @@ function stores_directory_name() {
179654
179752
  function stores_directory(plugin_root) {
179655
179753
  return path_exports.join(plugin_root, stores_directory_name());
179656
179754
  }
179657
- function type_route_dir(config2) {
179658
- return path_exports.join(config2.typeRootDir, "src", "routes");
179755
+ function type_route_dir(config3) {
179756
+ return path_exports.join(config3.typeRootDir, "src", "routes");
179659
179757
  }
179660
- function store_import_path({ config: config2, name: name2 }) {
179758
+ function store_import_path({ config: config3, name: name2 }) {
179661
179759
  return `$houdini/plugins/houdini-svelte/${stores_directory_name()}/${name2}`;
179662
179760
  }
179663
- function store_suffix(config2) {
179761
+ function store_suffix(config3) {
179664
179762
  return "Store";
179665
179763
  }
179666
- function store_name({ config: config2, name: name2 }) {
179667
- return name2 + store_suffix(config2);
179764
+ function store_name({ config: config3, name: name2 }) {
179765
+ return name2 + store_suffix(config3);
179668
179766
  }
179669
- function global_store_name({ config: config2, name: name2 }) {
179670
- return plugin_config(config2).globalStorePrefix + name2;
179767
+ function global_store_name({ config: config3, name: name2 }) {
179768
+ return plugin_config(config3).globalStorePrefix + name2;
179671
179769
  }
179672
- function plugin_config(config2) {
179673
- const cfg = config2.pluginConfig("houdini-svelte");
179770
+ function plugin_config(config3) {
179771
+ const cfg = config3.pluginConfig("houdini-svelte");
179674
179772
  return {
179773
+ client: "./src/client",
179675
179774
  globalStorePrefix: "GQL_",
179676
179775
  pageQueryFilename: "+page.gql",
179677
179776
  layoutQueryFilename: "+layout.gql",
@@ -179708,7 +179807,7 @@ function store_import({
179708
179807
  }
179709
179808
 
179710
179809
  // src/plugin/codegen/components/index.ts
179711
- async function componentTypesGenerator(framework2, { config: config2, documents }) {
179810
+ async function componentTypesGenerator(framework2, { config: config3, documents }) {
179712
179811
  const queries = {};
179713
179812
  for (const document of documents) {
179714
179813
  if (document.kind !== ArtifactKind.Query) {
@@ -179721,14 +179820,14 @@ async function componentTypesGenerator(framework2, { config: config2, documents
179721
179820
  }
179722
179821
  let matches2 = Object.keys(queries).filter((filepath) => filepath.endsWith(".svelte"));
179723
179822
  if (framework2 === "kit") {
179724
- matches2 = matches2.filter((match) => !match.startsWith(config2.routesDir));
179823
+ matches2 = matches2.filter((match) => !match.startsWith(config3.routesDir));
179725
179824
  }
179726
179825
  const files = {
179727
179826
  dirs: {},
179728
179827
  files: []
179729
179828
  };
179730
179829
  for (let file of matches2) {
179731
- file = path_exports.relative(config2.projectRoot, file);
179830
+ file = path_exports.relative(config3.projectRoot, file);
179732
179831
  let target = files;
179733
179832
  const parts = file.split("/");
179734
179833
  for (const [i3, part] of parts.entries()) {
@@ -179745,12 +179844,12 @@ async function componentTypesGenerator(framework2, { config: config2, documents
179745
179844
  target = target.dirs[part];
179746
179845
  }
179747
179846
  }
179748
- await walk_project(config2, files, queries, config2.projectRoot);
179847
+ await walk_project(config3, files, queries, config3.projectRoot);
179749
179848
  }
179750
- async function walk_project(config2, dirs, queries, root) {
179849
+ async function walk_project(config3, dirs, queries, root) {
179751
179850
  await Promise.all(
179752
179851
  Object.entries(dirs.dirs).map(async ([path_part, child]) => {
179753
- return walk_project(config2, child, queries, path_exports.join(root, path_part));
179852
+ return walk_project(config3, child, queries, path_exports.join(root, path_part));
179754
179853
  })
179755
179854
  );
179756
179855
  if (dirs.files.length === 0) {
@@ -179772,25 +179871,25 @@ type ${prop_type} = ComponentProps<${no_ext}>
179772
179871
  `;
179773
179872
  for (const query of queries[filepath]) {
179774
179873
  typeFile = `
179775
- import type { ${query.name}$input } from '${path_exports.relative(filepath, path_exports.join(config2.artifactDirectory, query.name)).replace("/$houdini", "")}'
179874
+ import type { ${query.name}$input } from '${path_exports.relative(filepath, path_exports.join(config3.artifactDirectory, query.name)).replace("/$houdini", "")}'
179776
179875
  ` + typeFile + `
179777
- export type ${config2.variableFunctionName(
179876
+ export type ${config3.variableFunctionName(
179778
179877
  query.name
179779
179878
  )} = <_Props = ${prop_type}>(args: { props: _Props }) => FragmentQueryVars$input
179780
179879
  `;
179781
179880
  }
179782
179881
  }
179783
- const relative3 = path_exports.join(config2.typeRootDir, path_exports.relative(config2.projectRoot, root));
179882
+ const relative3 = path_exports.join(config3.typeRootDir, path_exports.relative(config3.projectRoot, root));
179784
179883
  await fs_exports.mkdirp(relative3);
179785
179884
  await fs_exports.writeFile(path_exports.join(relative3, "$houdini.d.ts"), typeFile);
179786
179885
  }
179787
179886
 
179788
179887
  // src/plugin/codegen/routes/index.ts
179789
- async function svelteKitGenerator(framework2, { config: config2 }) {
179888
+ async function svelteKitGenerator(framework2, { config: config3 }) {
179790
179889
  if (framework2 !== "kit") {
179791
179890
  return;
179792
179891
  }
179793
- await walk_routes(config2, framework2, {
179892
+ await walk_routes(config3, framework2, {
179794
179893
  async route({
179795
179894
  dirpath,
179796
179895
  svelteTypeFilePath,
@@ -179799,9 +179898,9 @@ async function svelteKitGenerator(framework2, { config: config2 }) {
179799
179898
  layoutExports,
179800
179899
  pageExports
179801
179900
  }) {
179802
- const relativePath = path_exports.relative(config2.routesDir, dirpath);
179803
- const target = path_exports.join(type_route_dir(config2), relativePath, config2.typeRootFile);
179804
- const houdiniRelative = path_exports.relative(target, config2.typeRootDir);
179901
+ const relativePath = path_exports.relative(config3.routesDir, dirpath);
179902
+ const target = path_exports.join(type_route_dir(config3), relativePath, config3.typeRootFile);
179903
+ const houdiniRelative = path_exports.relative(target, config3.typeRootDir);
179805
179904
  const queryNames = [];
179806
179905
  const uniquePageQueries = [];
179807
179906
  for (const query of pageQueries) {
@@ -179820,26 +179919,26 @@ async function svelteKitGenerator(framework2, { config: config2 }) {
179820
179919
  }
179821
179920
  let skTypeString = await fs_exports.readFile(svelteTypeFilePath);
179822
179921
  if (skTypeString) {
179823
- const pageTypeImports = getTypeImports(houdiniRelative, config2, uniquePageQueries);
179922
+ const pageTypeImports = getTypeImports(houdiniRelative, config3, uniquePageQueries);
179824
179923
  const layoutTypeImports = getTypeImports(
179825
179924
  houdiniRelative,
179826
- config2,
179925
+ config3,
179827
179926
  uniqueLayoutQueries
179828
179927
  );
179829
- const afterPageLoad = pageExports.includes("afterLoad");
179830
- const beforePageLoad = pageExports.includes("beforeLoad");
179831
- const onPageError = pageExports.includes("onError");
179832
- const afterLayoutLoad = layoutExports.includes("afterLoad");
179833
- const beforeLayoutLoad = layoutExports.includes("beforeLoad");
179834
- const onLayoutError = layoutExports.includes("onError");
179928
+ const beforePageLoad = pageExports.includes(houdini_before_load_fn);
179929
+ const afterPageLoad = pageExports.includes(houdini_after_load_fn);
179930
+ const onPageError = pageExports.includes(houdini_on_error_fn);
179931
+ const beforeLayoutLoad = layoutExports.includes(houdini_before_load_fn);
179932
+ const afterLayoutLoad = layoutExports.includes(houdini_after_load_fn);
179933
+ const onLayoutError = layoutExports.includes(houdini_on_error_fn);
179835
179934
  const layout_append_VariablesFunction = append_VariablesFunction(
179836
179935
  "Layout",
179837
- config2,
179936
+ config3,
179838
179937
  uniqueLayoutQueries
179839
179938
  );
179840
179939
  const page_append_VariablesFunction = append_VariablesFunction(
179841
179940
  "Page",
179842
- config2,
179941
+ config3,
179843
179942
  uniquePageQueries
179844
179943
  );
179845
179944
  const layout_append_beforeLoad = append_beforeLoad(beforeLayoutLoad, "Layout");
@@ -179886,7 +179985,7 @@ import type { ${functionImportsToBring.join(
179886
179985
  /(?<=LayoutData = )([\s\S]*?)(?=;)/,
179887
179986
  `Expand<$1 & { ${layoutQueries.map((query) => {
179888
179987
  const name2 = query.name.value;
179889
- return [name2, name2 + store_suffix(config2)].join(": ");
179988
+ return [name2, name2 + store_suffix(config3)].join(": ");
179890
179989
  }).join("; ")} }${internal_append_TypeDataExtra(
179891
179990
  beforeLayoutLoad,
179892
179991
  afterLayoutLoad,
@@ -179896,7 +179995,7 @@ import type { ${functionImportsToBring.join(
179896
179995
  /(?<=PageData = )([\s\S]*?)(?=;)/,
179897
179996
  `Expand<$1 & { ${pageQueries.map((query) => {
179898
179997
  const name2 = query.name.value;
179899
- return [name2, name2 + store_suffix(config2)].join(": ");
179998
+ return [name2, name2 + store_suffix(config3)].join(": ");
179900
179999
  }).join("; ")} }${internal_append_TypeDataExtra(
179901
180000
  beforePageLoad,
179902
180001
  afterPageLoad,
@@ -179919,22 +180018,22 @@ import type { ${functionImportsToBring.join(
179919
180018
  }
179920
180019
  });
179921
180020
  }
179922
- function getTypeImports(houdiniRelative, config2, queries) {
180021
+ function getTypeImports(houdiniRelative, config3, queries) {
179923
180022
  return queries.map((query) => {
179924
180023
  const name2 = query.name.value;
179925
180024
  return `
179926
- import { ${name2}$result, ${name2}$input } from '${houdiniRelative}/${config2.artifactDirectoryName}/${name2}';
180025
+ import { ${name2}$result, ${name2}$input } from '${houdiniRelative}/${config3.artifactDirectoryName}/${name2}';
179927
180026
  import { ${name2}Store } from '${houdiniRelative}/plugins/houdini-svelte/${stores_directory_name()}/${name2}';`;
179928
180027
  }).join("\n");
179929
180028
  }
179930
- function append_VariablesFunction(type, config2, queries) {
180029
+ function append_VariablesFunction(type, config3, queries) {
179931
180030
  return queries.map((query) => {
179932
180031
  const name2 = query.name.value;
179933
180032
  if (!query.variableDefinitions?.length) {
179934
180033
  return "";
179935
180034
  }
179936
180035
  return `
179937
- export type ${config2.variableFunctionName(
180036
+ export type ${config3.variableFunctionName(
179938
180037
  name2
179939
180038
  )} = VariableFunction<${type}Params, ${name2}$input>;`;
179940
180039
  }).join("\n");
@@ -179995,11 +180094,11 @@ function store_import2(cfg, which) {
179995
180094
  }
179996
180095
 
179997
180096
  // src/plugin/codegen/stores/fragment.ts
179998
- async function fragmentStore({ config: config2, plugin_root }, doc) {
180097
+ async function fragmentStore({ config: config3, plugin_root }, doc) {
179999
180098
  const fileName = doc.name;
180000
180099
  const artifactName = `${doc.name}`;
180001
- const storeName = store_name({ config: config2, name: doc.name });
180002
- const globalStoreName = global_store_name({ config: config2, name: doc.name });
180100
+ const storeName = store_name({ config: config3, name: doc.name });
180101
+ const globalStoreName = global_store_name({ config: config3, name: doc.name });
180003
180102
  const paginationMethod = doc.refetch?.method;
180004
180103
  let which = "fragment";
180005
180104
  if (paginationMethod === "cursor") {
@@ -180007,11 +180106,11 @@ async function fragmentStore({ config: config2, plugin_root }, doc) {
180007
180106
  } else if (paginationMethod === "offset") {
180008
180107
  which = "fragmentOffset";
180009
180108
  }
180010
- const { statement, store_class } = store_import2(config2, which);
180109
+ const { statement, store_class } = store_import2(config3, which);
180011
180110
  const storeContent = `${statement}
180012
180111
  import artifact from '$houdini/artifacts/${artifactName}'
180013
- ${paginationMethod ? `import _PaginationArtifact from '${config2.artifactImportPath(
180014
- config2.paginationQueryName(doc.name)
180112
+ ${paginationMethod ? `import _PaginationArtifact from '${config3.artifactImportPath(
180113
+ config3.paginationQueryName(doc.name)
180015
180114
  )}'` : ""}
180016
180115
 
180017
180116
  // create the fragment store
@@ -180055,12 +180154,12 @@ export default ${storeName}
180055
180154
  }
180056
180155
 
180057
180156
  // src/plugin/codegen/stores/mutation.ts
180058
- async function mutationStore({ config: config2, plugin_root }, doc) {
180157
+ async function mutationStore({ config: config3, plugin_root }, doc) {
180059
180158
  const fileName = doc.name;
180060
- const storeName = store_name({ config: config2, name: doc.name });
180061
- const globalStoreName = global_store_name({ config: config2, name: doc.name });
180159
+ const storeName = store_name({ config: config3, name: doc.name });
180160
+ const globalStoreName = global_store_name({ config: config3, name: doc.name });
180062
180161
  const artifactName = `${doc.name}`;
180063
- const { statement, store_class } = store_import2(config2, "mutation");
180162
+ const { statement, store_class } = store_import2(config3, "mutation");
180064
180163
  const storeData = `import artifact from '$houdini/artifacts/${artifactName}'
180065
180164
  ${statement}
180066
180165
 
@@ -180100,11 +180199,11 @@ export default ${storeName}
180100
180199
  }
180101
180200
 
180102
180201
  // src/plugin/codegen/stores/query.ts
180103
- async function queryStore({ config: config2, plugin_root }, doc) {
180202
+ async function queryStore({ config: config3, plugin_root }, doc) {
180104
180203
  const fileName = doc.name;
180105
180204
  const artifactName = `${doc.name}`;
180106
- const storeName = store_name({ config: config2, name: doc.name });
180107
- const globalStoreName = global_store_name({ config: config2, name: doc.name });
180205
+ const storeName = store_name({ config: config3, name: doc.name });
180206
+ const globalStoreName = global_store_name({ config: config3, name: doc.name });
180108
180207
  let variables = false;
180109
180208
  const operation = doc.originalDocument.definitions.find(
180110
180209
  (defn) => defn.kind === "OperationDefinition" && defn.operation === "query"
@@ -180119,7 +180218,7 @@ async function queryStore({ config: config2, plugin_root }, doc) {
180119
180218
  } else if (paginationMethod === "offset") {
180120
180219
  which = "queryOffset";
180121
180220
  }
180122
- const { store_class, statement } = store_import2(config2, which);
180221
+ const { store_class, statement } = store_import2(config3, which);
180123
180222
  const storeData = `${statement}
180124
180223
  import artifact from '$houdini/artifacts/${artifactName}'
180125
180224
 
@@ -180234,12 +180333,12 @@ export default ${storeName}
180234
180333
  }
180235
180334
 
180236
180335
  // src/plugin/codegen/stores/subscription.ts
180237
- async function subscriptionStore({ config: config2, plugin_root }, doc) {
180336
+ async function subscriptionStore({ config: config3, plugin_root }, doc) {
180238
180337
  const fileName = doc.name;
180239
- const storeName = store_name({ config: config2, name: doc.name });
180240
- const globalStoreName = global_store_name({ config: config2, name: doc.name });
180338
+ const storeName = store_name({ config: config3, name: doc.name });
180339
+ const globalStoreName = global_store_name({ config: config3, name: doc.name });
180241
180340
  const artifactName = `${doc.name}`;
180242
- const { store_class, statement } = store_import2(config2, "subscription");
180341
+ const { store_class, statement } = store_import2(config3, "subscription");
180243
180342
  const storeContent = `import artifact from '$houdini/artifacts/${artifactName}'
180244
180343
  ${statement}
180245
180344
 
@@ -180279,7 +180378,7 @@ export default ${storeName}
180279
180378
 
180280
180379
  // src/plugin/codegen/stores/index.ts
180281
180380
  async function storesGenerator(input) {
180282
- const { config: config2, documents } = input;
180381
+ const { config: config3, documents } = input;
180283
180382
  const listOfStores = [];
180284
180383
  await Promise.all(
180285
180384
  documents.map(async (doc) => {
@@ -180332,33 +180431,33 @@ async function codegen_default(input) {
180332
180431
  // src/plugin/fsPatch.ts
180333
180432
  import filesystem, { Dirent } from "fs";
180334
180433
  var fsPatch_default = (getFramwork) => ({
180335
- async resolveId(filepath, _, { config: config2, isEntry }) {
180434
+ async resolveId(filepath, _, { config: config3, isEntry }) {
180336
180435
  if (!isEntry) {
180337
180436
  const match = filepath.match("^((../)+)src/routes");
180338
180437
  if (match) {
180339
- return path_exports.join(config2.projectRoot, filepath.substring(match[1].length));
180438
+ return path_exports.join(config3.projectRoot, filepath.substring(match[1].length));
180340
180439
  }
180341
180440
  return;
180342
180441
  }
180343
180442
  filepath = path_exports.posixify(filepath.toString());
180344
- if (is_route_script(getFramwork(), filepath) || is_root_layout(config2, filepath) || is_root_layout_server(config2, filepath)) {
180443
+ if (is_route_script(getFramwork(), filepath) || is_root_layout(config3, filepath) || is_root_layout_server(config3, filepath)) {
180345
180444
  return {
180346
- id: resolve_relative(config2, filepath)
180445
+ id: resolve_relative(config3, filepath)
180347
180446
  };
180348
180447
  }
180349
180448
  },
180350
- load: async (filepath, { config: config2 }) => {
180449
+ load: async (filepath, { config: config3 }) => {
180351
180450
  filepath = path_exports.posixify(filepath.toString());
180352
- if (is_route_script(getFramwork(), filepath) || is_root_layout_server(config2, filepath)) {
180353
- filepath = resolve_relative(config2, filepath);
180451
+ if (is_route_script(getFramwork(), filepath) || is_root_layout_server(config3, filepath)) {
180452
+ filepath = resolve_relative(config3, filepath);
180354
180453
  return {
180355
- code: await fs_exports.readFile(filepath) || await fs_exports.readFile(path_exports.join(config2.projectRoot, filepath)) || ""
180454
+ code: await fs_exports.readFile(filepath) || await fs_exports.readFile(path_exports.join(config3.projectRoot, filepath)) || ""
180356
180455
  };
180357
180456
  }
180358
- if (is_root_layout(config2, filepath)) {
180359
- filepath = resolve_relative(config2, filepath);
180457
+ if (is_root_layout(config3, filepath)) {
180458
+ filepath = resolve_relative(config3, filepath);
180360
180459
  return {
180361
- code: await fs_exports.readFile(filepath) || await fs_exports.readFile(path_exports.join(config2.projectRoot, filepath)) || empty_layout
180460
+ code: await fs_exports.readFile(filepath) || await fs_exports.readFile(path_exports.join(config3.projectRoot, filepath)) || empty_layout
180362
180461
  };
180363
180462
  }
180364
180463
  }
@@ -180535,6 +180634,37 @@ async function kit_init(page2) {
180535
180634
  );
180536
180635
  }
180537
180636
 
180637
+ // ../../node_modules/.pnpm/@kitql+helper@0.5.0/node_modules/@kitql/helper/index.mjs
180638
+ var config2 = {
180639
+ reset: {
180640
+ node: `\x1B[37m\x1B[0m`,
180641
+ browser: ""
180642
+ },
180643
+ green: {
180644
+ node: `\x1B[32m`,
180645
+ browser: "color: green"
180646
+ },
180647
+ magneta: {
180648
+ node: `\x1B[35m`,
180649
+ browser: "color: #ff00ff"
180650
+ },
180651
+ red: {
180652
+ node: `\x1B[31m`,
180653
+ browser: "color: red"
180654
+ },
180655
+ cyan: {
180656
+ node: `\x1B[36m`,
180657
+ browser: "color: cyan"
180658
+ },
180659
+ yellow: {
180660
+ node: `\x1B[33m`,
180661
+ browser: "color: yellow"
180662
+ }
180663
+ };
180664
+ function logYellow(str) {
180665
+ return `${config2.yellow.node}${str}${config2.reset.node}`;
180666
+ }
180667
+
180538
180668
  // src/plugin/transforms/kit/load.ts
180539
180669
  var graphql29 = __toESM(require_graphql4(), 1);
180540
180670
  var recast15 = __toESM(require_main5(), 1);
@@ -180542,8 +180672,8 @@ var recast15 = __toESM(require_main5(), 1);
180542
180672
  // src/plugin/transforms/query.ts
180543
180673
  var recast14 = __toESM(require_main5(), 1);
180544
180674
  var AST14 = recast14.types.builders;
180545
- async function QueryProcessor(config2, page2) {
180546
- if (!is_component(config2, page2.framework, page2.filepath)) {
180675
+ async function QueryProcessor(config3, page2) {
180676
+ if (!is_component(config3, page2.framework, page2.filepath)) {
180547
180677
  return;
180548
180678
  }
180549
180679
  const store_id = (name2) => {
@@ -180586,7 +180716,7 @@ async function QueryProcessor(config2, page2) {
180586
180716
  script: page2.script,
180587
180717
  config: page2.config,
180588
180718
  import: [`${query.name}Store`],
180589
- sourceModule: store_import_path({ config: config2, name: query.name })
180719
+ sourceModule: store_import_path({ config: config3, name: query.name })
180590
180720
  }).ids[0];
180591
180721
  page2.script.body.splice(
180592
180722
  find_insert_index(page2.script),
@@ -180600,6 +180730,14 @@ async function QueryProcessor(config2, page2) {
180600
180730
  ...queries.flatMap((query) => {
180601
180731
  const variable_fn = query_variable_fn(query.name);
180602
180732
  const has_variables = find_exported_fn(page2.script.body, variable_fn);
180733
+ if (query.variables && has_variables === null) {
180734
+ formatErrors({
180735
+ filepath: page2.filepath,
180736
+ message: `Could not find required variable function: ${logYellow(
180737
+ variable_fn
180738
+ )}. maybe its not exported? `
180739
+ });
180740
+ }
180603
180741
  return [
180604
180742
  AST14.labeledStatement(
180605
180743
  AST14.identifier("$"),
@@ -180695,9 +180833,7 @@ async function find_inline_queries(page2, parsed, store_id) {
180695
180833
  return false;
180696
180834
  }
180697
180835
  return !queryOperation.directives?.find(
180698
- (directive) => directive.name.value === page2.config.houdiniDirective && directive.arguments?.find(
180699
- (arg) => arg.name.value === "load" && arg.value.kind === "BooleanValue" && !arg.value.value
180700
- )
180836
+ (directive) => directive.name.value === page2.config.manualLoadDirective
180701
180837
  );
180702
180838
  },
180703
180839
  dependency: page2.watch_file,
@@ -180719,9 +180855,6 @@ async function find_inline_queries(page2, parsed, store_id) {
180719
180855
  };
180720
180856
  });
180721
180857
  }
180722
- function query_variable_fn(name2) {
180723
- return `${name2}Variables`;
180724
- }
180725
180858
  var local_input_id = (name2) => AST14.identifier(`_${name2}_Input`);
180726
180859
 
180727
180860
  // src/plugin/transforms/kit/load.ts
@@ -180753,7 +180886,7 @@ async function kit_load_generator(page2) {
180753
180886
  houdini_load_queries.push({
180754
180887
  name: target.name.value,
180755
180888
  variables: operation_requires_variables(target),
180756
- store_id: AST15.memberExpression(AST15.identifier("houdini_load"), AST15.literal(i3))
180889
+ store_id: AST15.memberExpression(AST15.identifier(houdini_load_fn), AST15.literal(i3))
180757
180890
  });
180758
180891
  }
180759
180892
  if (script) {
@@ -180806,7 +180939,9 @@ function add_load({
180806
180939
  if (!page_info.exports.includes(variable_fn) && query.variables) {
180807
180940
  formatErrors({
180808
180941
  filepath: page2.filepath,
180809
- message: `Could not find required variable function: ${variable_fn}. maybe its not exported? `
180942
+ message: `Could not find required variable function: ${logYellow(
180943
+ variable_fn
180944
+ )}. maybe its not exported? `
180810
180945
  });
180811
180946
  invalid2 = true;
180812
180947
  }
@@ -180826,9 +180961,9 @@ function add_load({
180826
180961
  import: ["getCurrentConfig"],
180827
180962
  sourceModule: "$houdini/runtime/lib/config"
180828
180963
  });
180829
- let before_load = page_info.exports.includes("beforeLoad");
180830
- let after_load = page_info.exports.includes("afterLoad");
180831
- let on_error = page_info.exports.includes("onError");
180964
+ let before_load = page_info.exports.includes(houdini_before_load_fn);
180965
+ let after_load = page_info.exports.includes(houdini_after_load_fn);
180966
+ let on_error = page_info.exports.includes(houdini_on_error_fn);
180832
180967
  const request_context = AST15.identifier("houdini_context");
180833
180968
  const promise_list = AST15.identifier("promises");
180834
180969
  const return_value = AST15.memberExpression(request_context, AST15.identifier("returnValue"));
@@ -180990,7 +181125,7 @@ function add_load({
180990
181125
  ),
180991
181126
  AST15.objectProperty(
180992
181127
  AST15.literal("hookFn"),
180993
- AST15.identifier("onError")
181128
+ AST15.identifier(houdini_on_error_fn)
180994
181129
  ),
180995
181130
  AST15.objectProperty(
180996
181131
  AST15.literal("error"),
@@ -181008,14 +181143,14 @@ function add_load({
181008
181143
  );
181009
181144
  if (before_load) {
181010
181145
  if (before_load) {
181011
- preload_fn.body.body.splice(1, 0, load_hook_statements("beforeLoad", ...args));
181146
+ preload_fn.body.body.splice(1, 0, load_hook_statements("before", ...args));
181012
181147
  }
181013
181148
  }
181014
181149
  if (after_load) {
181015
181150
  preload_fn.body.body.splice(
181016
181151
  preload_fn.body.body.length - 1,
181017
181152
  0,
181018
- load_hook_statements("afterLoad", ...args)
181153
+ load_hook_statements("after", ...args)
181019
181154
  );
181020
181155
  }
181021
181156
  }
@@ -181050,12 +181185,14 @@ function load_hook_statements(name2, request_context, input_id, result_id) {
181050
181185
  AST15.memberExpression(request_context, AST15.identifier("invokeLoadHook")),
181051
181186
  [
181052
181187
  AST15.objectExpression([
181188
+ AST15.objectProperty(AST15.literal("variant"), AST15.stringLiteral(name2)),
181053
181189
  AST15.objectProperty(
181054
- AST15.literal("variant"),
181055
- AST15.stringLiteral(name2 === "afterLoad" ? "after" : "before")
181190
+ AST15.literal("hookFn"),
181191
+ AST15.identifier(
181192
+ name2 === "before" ? houdini_before_load_fn : houdini_after_load_fn
181193
+ )
181056
181194
  ),
181057
- AST15.objectProperty(AST15.literal("hookFn"), AST15.identifier(name2)),
181058
- ...name2 === "afterLoad" ? [
181195
+ ...name2 === "after" ? [
181059
181196
  AST15.objectProperty(AST15.literal("input"), input_id),
181060
181197
  AST15.objectProperty(AST15.literal("data"), result_id)
181061
181198
  ] : []
@@ -181185,7 +181322,7 @@ function modify_load(page2, cb) {
181185
181322
  }
181186
181323
 
181187
181324
  // src/plugin/transforms/kit/index.ts
181188
- async function SvelteKitProcessor(config2, page2) {
181325
+ async function SvelteKitProcessor(config3, page2) {
181189
181326
  if (page2.framework !== "kit") {
181190
181327
  return;
181191
181328
  }
@@ -181308,8 +181445,8 @@ function walk2(ast, { enter, leave }) {
181308
181445
  // src/plugin/transforms/reactive.ts
181309
181446
  var recast17 = __toESM(require_main5(), 1);
181310
181447
  var AST17 = recast17.types.builders;
181311
- async function ReactiveProcessor(config2, page2) {
181312
- if (!is_component(config2, page2.framework, page2.filepath) && !is_route(config2, page2.framework, page2.filepath)) {
181448
+ async function ReactiveProcessor(config3, page2) {
181449
+ if (!is_component(config3, page2.framework, page2.filepath) && !is_route(config3, page2.framework, page2.filepath)) {
181313
181450
  return;
181314
181451
  }
181315
181452
  const magicFunctions = ["query", "graphql", "fragment", "paginatedFragment", "paginatedQuery"];
@@ -181371,12 +181508,12 @@ function filterTaggedTemplate(expr) {
181371
181508
  }
181372
181509
 
181373
181510
  // src/plugin/transforms/tags.ts
181374
- async function GraphQLTagProcessor(config2, page2) {
181375
- await find_graphql(config2, page2.script, {
181511
+ async function GraphQLTagProcessor(config3, page2) {
181512
+ await find_graphql(config3, page2.script, {
181376
181513
  dependency: page2.watch_file,
181377
181514
  tag(tag2) {
181378
181515
  const { node: node2, parsedDocument } = tag2;
181379
- const operation = config2.extractDefinition(parsedDocument);
181516
+ const operation = config3.extractDefinition(parsedDocument);
181380
181517
  node2.replaceWith(store_import({ page: page2, artifact: { name: operation.name.value } }).id);
181381
181518
  }
181382
181519
  });
@@ -181431,7 +181568,7 @@ var replace_between = (origin, startIndex, endIndex, insertion) => origin.substr
181431
181568
 
181432
181569
  // src/plugin/validate.ts
181433
181570
  async function validateDocuments({
181434
- config: config2,
181571
+ config: config3,
181435
181572
  documents
181436
181573
  }) {
181437
181574
  const forbiddenNames = [
@@ -181444,13 +181581,13 @@ async function validateDocuments({
181444
181581
  const errors = [];
181445
181582
  for (let i3 = 0; i3 < documents.length; i3++) {
181446
181583
  const doc = documents[i3];
181447
- if (forbiddenNames.includes(store_name({ config: config2, name: doc.name }))) {
181584
+ if (forbiddenNames.includes(store_name({ config: config3, name: doc.name }))) {
181448
181585
  errors.push(
181449
181586
  new HoudiniError({
181450
181587
  filepath: doc.filename,
181451
181588
  message: `Operation name "${doc.name}" forbidden (as Houdini uses "${store_name(
181452
181589
  {
181453
- config: config2,
181590
+ config: config3,
181454
181591
  name: doc.name
181455
181592
  }
181456
181593
  )}" internally), please change it to something else.`
@@ -181472,19 +181609,19 @@ var framework = "svelte";
181472
181609
  var HoudiniSveltePlugin = async () => ({
181473
181610
  extensions: [".svelte"],
181474
181611
  transform_runtime: {
181475
- "network.js": ({ config: config2, content }) => {
181612
+ "network.js": ({ config: config3, content }) => {
181476
181613
  const networkFilePath = path_exports.join(
181477
- config2.pluginRuntimeDirectory("houdini-svelte"),
181614
+ config3.pluginRuntimeDirectory("houdini-svelte"),
181478
181615
  "network.js"
181479
181616
  );
181480
181617
  const relativePath = path_exports.relative(
181481
181618
  path_exports.dirname(networkFilePath),
181482
- path_exports.join(config2.projectRoot, plugin_config(config2).client)
181619
+ path_exports.join(config3.projectRoot, plugin_config(config3).client)
181483
181620
  );
181484
181621
  return content.replace("HOUDINI_CLIENT_PATH", relativePath);
181485
181622
  },
181486
181623
  "adapter.js": ({ content }) => {
181487
- const sveltekit_adapter = `import { browser, prerendering } from '$app/environment'
181624
+ const sveltekit_adapter = `import { browser, building } from '$app/environment'
181488
181625
  import { error as svelteKitError } from '@sveltejs/kit'
181489
181626
 
181490
181627
  export const isBrowser = browser
@@ -181495,7 +181632,7 @@ export function setClientStarted() {
181495
181632
  clientStarted = true
181496
181633
  }
181497
181634
 
181498
- export const isPrerender = prerendering
181635
+ export const isPrerender = building
181499
181636
 
181500
181637
  export const error = svelteKitError
181501
181638
  `;
@@ -181510,15 +181647,15 @@ export const error = svelteKitError
181510
181647
  framework
181511
181648
  });
181512
181649
  },
181513
- index_file({ config: config2, content, export_star_from, plugin_root }) {
181514
- const storesDir = "./" + path_exports.relative(config2.rootDir, stores_directory(plugin_root)).split(path_exports.sep).join("/");
181650
+ index_file({ config: config3, content, export_star_from, plugin_root }) {
181651
+ const storesDir = "./" + path_exports.relative(config3.rootDir, stores_directory(plugin_root)).split(path_exports.sep).join("/");
181515
181652
  return content + export_star_from({ module: storesDir });
181516
181653
  },
181517
181654
  transform_file(page2) {
181518
181655
  return apply_transforms(framework, page2);
181519
181656
  },
181520
- include(config2, filepath) {
181521
- return config2.includeFile(resolve_relative(config2, filepath), { ignore_plugins: true });
181657
+ include(config3, filepath) {
181658
+ return config3.includeFile(resolve_relative(config3, filepath), { ignore_plugins: true });
181522
181659
  },
181523
181660
  vite: {
181524
181661
  ...fsPatch_default(() => framework)
@@ -181531,11 +181668,21 @@ export const error = svelteKitError
181531
181668
  description: `Here, both gives: ${store_name({ config: cfg, name: "QueryName" })}`
181532
181669
  });
181533
181670
  }
181534
- if (!cfg.configFile.plugins?.["houdini-svelte"].client) {
181671
+ const cfgPlugin = plugin_config(cfg);
181672
+ let client_file_exists = false;
181673
+ if (path_exports.extname(cfgPlugin.client)) {
181674
+ client_file_exists = !!await fs_exports.readFile(cfgPlugin.client);
181675
+ } else {
181676
+ client_file_exists = (await Promise.all([
181677
+ fs_exports.readFile(cfgPlugin.client + ".ts"),
181678
+ fs_exports.readFile(cfgPlugin.client + ".js")
181679
+ ])).some(Boolean);
181680
+ }
181681
+ if (!client_file_exists) {
181535
181682
  throw new HoudiniError({
181536
- filepath: cfg.filepath,
181537
- message: "Invalid config file: missing client value.",
181538
- description: "Please set it to the relative path (from houdini.config.js) to your client file. The file must have a default export with an instance of HoudiniClient."
181683
+ filepath: cfgPlugin.client,
181684
+ message: `File "${cfgPlugin.client}.(ts,js)" is missing. Either create it or set the client property in houdini.config.js file to target your houdini client file.`,
181685
+ description: "It has to be a relative path (from houdini.config.js) to your client file. The file must have a default export with an instance of HoudiniClient."
181539
181686
  });
181540
181687
  }
181541
181688
  try {