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.
@@ -3632,25 +3632,25 @@ var require_definition2 = __commonJS({
3632
3632
  return arr && arr.length > 0 ? arr : void 0;
3633
3633
  }
3634
3634
  var GraphQLScalarType = /* @__PURE__ */ function() {
3635
- function GraphQLScalarType2(config2) {
3635
+ function GraphQLScalarType2(config3) {
3636
3636
  var _config$parseValue, _config$serialize, _config$parseLiteral;
3637
- var parseValue = (_config$parseValue = config2.parseValue) !== null && _config$parseValue !== void 0 ? _config$parseValue : _identityFunc.default;
3638
- this.name = config2.name;
3639
- this.description = config2.description;
3640
- this.specifiedByUrl = config2.specifiedByUrl;
3641
- this.serialize = (_config$serialize = config2.serialize) !== null && _config$serialize !== void 0 ? _config$serialize : _identityFunc.default;
3637
+ var parseValue = (_config$parseValue = config3.parseValue) !== null && _config$parseValue !== void 0 ? _config$parseValue : _identityFunc.default;
3638
+ this.name = config3.name;
3639
+ this.description = config3.description;
3640
+ this.specifiedByUrl = config3.specifiedByUrl;
3641
+ this.serialize = (_config$serialize = config3.serialize) !== null && _config$serialize !== void 0 ? _config$serialize : _identityFunc.default;
3642
3642
  this.parseValue = parseValue;
3643
- this.parseLiteral = (_config$parseLiteral = config2.parseLiteral) !== null && _config$parseLiteral !== void 0 ? _config$parseLiteral : function(node2, variables) {
3643
+ this.parseLiteral = (_config$parseLiteral = config3.parseLiteral) !== null && _config$parseLiteral !== void 0 ? _config$parseLiteral : function(node2, variables) {
3644
3644
  return parseValue((0, _valueFromASTUntyped.valueFromASTUntyped)(node2, variables));
3645
3645
  };
3646
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
3647
- this.astNode = config2.astNode;
3648
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
3649
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
3650
- 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), "."));
3651
- 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.'));
3652
- if (config2.parseLiteral) {
3653
- typeof config2.parseValue === "function" && typeof config2.parseLiteral === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide both "parseValue" and "parseLiteral" functions.'));
3646
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
3647
+ this.astNode = config3.astNode;
3648
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
3649
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
3650
+ 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), "."));
3651
+ 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.'));
3652
+ if (config3.parseLiteral) {
3653
+ typeof config3.parseValue === "function" && typeof config3.parseLiteral === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide both "parseValue" and "parseLiteral" functions.'));
3654
3654
  }
3655
3655
  }
3656
3656
  var _proto = GraphQLScalarType2.prototype;
@@ -3685,17 +3685,17 @@ var require_definition2 = __commonJS({
3685
3685
  exports.GraphQLScalarType = GraphQLScalarType;
3686
3686
  (0, _defineInspect.default)(GraphQLScalarType);
3687
3687
  var GraphQLObjectType = /* @__PURE__ */ function() {
3688
- function GraphQLObjectType2(config2) {
3689
- this.name = config2.name;
3690
- this.description = config2.description;
3691
- this.isTypeOf = config2.isTypeOf;
3692
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
3693
- this.astNode = config2.astNode;
3694
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
3695
- this._fields = defineFieldMap.bind(void 0, config2);
3696
- this._interfaces = defineInterfaces.bind(void 0, config2);
3697
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
3698
- 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), "."));
3688
+ function GraphQLObjectType2(config3) {
3689
+ this.name = config3.name;
3690
+ this.description = config3.description;
3691
+ this.isTypeOf = config3.isTypeOf;
3692
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
3693
+ this.astNode = config3.astNode;
3694
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
3695
+ this._fields = defineFieldMap.bind(void 0, config3);
3696
+ this._interfaces = defineInterfaces.bind(void 0, config3);
3697
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
3698
+ 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), "."));
3699
3699
  }
3700
3700
  var _proto2 = GraphQLObjectType2.prototype;
3701
3701
  _proto2.getFields = function getFields() {
@@ -3738,22 +3738,22 @@ var require_definition2 = __commonJS({
3738
3738
  }();
3739
3739
  exports.GraphQLObjectType = GraphQLObjectType;
3740
3740
  (0, _defineInspect.default)(GraphQLObjectType);
3741
- function defineInterfaces(config2) {
3741
+ function defineInterfaces(config3) {
3742
3742
  var _resolveThunk;
3743
- var interfaces = (_resolveThunk = resolveThunk(config2.interfaces)) !== null && _resolveThunk !== void 0 ? _resolveThunk : [];
3744
- Array.isArray(interfaces) || (0, _devAssert.default)(0, "".concat(config2.name, " interfaces must be an Array or a function which returns an Array."));
3743
+ var interfaces = (_resolveThunk = resolveThunk(config3.interfaces)) !== null && _resolveThunk !== void 0 ? _resolveThunk : [];
3744
+ Array.isArray(interfaces) || (0, _devAssert.default)(0, "".concat(config3.name, " interfaces must be an Array or a function which returns an Array."));
3745
3745
  return interfaces;
3746
3746
  }
3747
- function defineFieldMap(config2) {
3748
- var fieldMap = resolveThunk(config2.fields);
3749
- 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."));
3747
+ function defineFieldMap(config3) {
3748
+ var fieldMap = resolveThunk(config3.fields);
3749
+ 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."));
3750
3750
  return (0, _mapValue.default)(fieldMap, function(fieldConfig, fieldName) {
3751
3751
  var _fieldConfig$args;
3752
- isPlainObj(fieldConfig) || (0, _devAssert.default)(0, "".concat(config2.name, ".").concat(fieldName, " field config must be an object."));
3753
- !("isDeprecated" in fieldConfig) || (0, _devAssert.default)(0, "".concat(config2.name, ".").concat(fieldName, ' should provide "deprecationReason" instead of "isDeprecated".'));
3754
- 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), "."));
3752
+ isPlainObj(fieldConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, " field config must be an object."));
3753
+ !("isDeprecated" in fieldConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, ' should provide "deprecationReason" instead of "isDeprecated".'));
3754
+ 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), "."));
3755
3755
  var argsConfig = (_fieldConfig$args = fieldConfig.args) !== null && _fieldConfig$args !== void 0 ? _fieldConfig$args : {};
3756
- isPlainObj(argsConfig) || (0, _devAssert.default)(0, "".concat(config2.name, ".").concat(fieldName, " args must be an object with argument names as keys."));
3756
+ isPlainObj(argsConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, " args must be an object with argument names as keys."));
3757
3757
  var args = (0, _objectEntries.default)(argsConfig).map(function(_ref) {
3758
3758
  var argName = _ref[0], argConfig = _ref[1];
3759
3759
  return {
@@ -3815,17 +3815,17 @@ var require_definition2 = __commonJS({
3815
3815
  return isNonNullType(arg.type) && arg.defaultValue === void 0;
3816
3816
  }
3817
3817
  var GraphQLInterfaceType = /* @__PURE__ */ function() {
3818
- function GraphQLInterfaceType2(config2) {
3819
- this.name = config2.name;
3820
- this.description = config2.description;
3821
- this.resolveType = config2.resolveType;
3822
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
3823
- this.astNode = config2.astNode;
3824
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
3825
- this._fields = defineFieldMap.bind(void 0, config2);
3826
- this._interfaces = defineInterfaces.bind(void 0, config2);
3827
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
3828
- 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), "."));
3818
+ function GraphQLInterfaceType2(config3) {
3819
+ this.name = config3.name;
3820
+ this.description = config3.description;
3821
+ this.resolveType = config3.resolveType;
3822
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
3823
+ this.astNode = config3.astNode;
3824
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
3825
+ this._fields = defineFieldMap.bind(void 0, config3);
3826
+ this._interfaces = defineInterfaces.bind(void 0, config3);
3827
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
3828
+ 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), "."));
3829
3829
  }
3830
3830
  var _proto3 = GraphQLInterfaceType2.prototype;
3831
3831
  _proto3.getFields = function getFields() {
@@ -3870,16 +3870,16 @@ var require_definition2 = __commonJS({
3870
3870
  exports.GraphQLInterfaceType = GraphQLInterfaceType;
3871
3871
  (0, _defineInspect.default)(GraphQLInterfaceType);
3872
3872
  var GraphQLUnionType = /* @__PURE__ */ function() {
3873
- function GraphQLUnionType2(config2) {
3874
- this.name = config2.name;
3875
- this.description = config2.description;
3876
- this.resolveType = config2.resolveType;
3877
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
3878
- this.astNode = config2.astNode;
3879
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
3880
- this._types = defineTypes.bind(void 0, config2);
3881
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
3882
- 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), "."));
3873
+ function GraphQLUnionType2(config3) {
3874
+ this.name = config3.name;
3875
+ this.description = config3.description;
3876
+ this.resolveType = config3.resolveType;
3877
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
3878
+ this.astNode = config3.astNode;
3879
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
3880
+ this._types = defineTypes.bind(void 0, config3);
3881
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
3882
+ 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), "."));
3883
3883
  }
3884
3884
  var _proto4 = GraphQLUnionType2.prototype;
3885
3885
  _proto4.getTypes = function getTypes() {
@@ -3916,26 +3916,26 @@ var require_definition2 = __commonJS({
3916
3916
  }();
3917
3917
  exports.GraphQLUnionType = GraphQLUnionType;
3918
3918
  (0, _defineInspect.default)(GraphQLUnionType);
3919
- function defineTypes(config2) {
3920
- var types11 = resolveThunk(config2.types);
3921
- 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, "."));
3919
+ function defineTypes(config3) {
3920
+ var types11 = resolveThunk(config3.types);
3921
+ 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, "."));
3922
3922
  return types11;
3923
3923
  }
3924
3924
  var GraphQLEnumType = /* @__PURE__ */ function() {
3925
- function GraphQLEnumType2(config2) {
3926
- this.name = config2.name;
3927
- this.description = config2.description;
3928
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
3929
- this.astNode = config2.astNode;
3930
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
3931
- this._values = defineEnumValues(this.name, config2.values);
3925
+ function GraphQLEnumType2(config3) {
3926
+ this.name = config3.name;
3927
+ this.description = config3.description;
3928
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
3929
+ this.astNode = config3.astNode;
3930
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
3931
+ this._values = defineEnumValues(this.name, config3.values);
3932
3932
  this._valueLookup = new Map(this._values.map(function(enumValue) {
3933
3933
  return [enumValue.value, enumValue];
3934
3934
  }));
3935
3935
  this._nameLookup = (0, _keyMap.default)(this._values, function(value2) {
3936
3936
  return value2.name;
3937
3937
  });
3938
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
3938
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
3939
3939
  }
3940
3940
  var _proto5 = GraphQLEnumType2.prototype;
3941
3941
  _proto5.getValues = function getValues() {
@@ -4037,14 +4037,14 @@ var require_definition2 = __commonJS({
4037
4037
  });
4038
4038
  }
4039
4039
  var GraphQLInputObjectType = /* @__PURE__ */ function() {
4040
- function GraphQLInputObjectType2(config2) {
4041
- this.name = config2.name;
4042
- this.description = config2.description;
4043
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
4044
- this.astNode = config2.astNode;
4045
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
4046
- this._fields = defineInputFieldMap.bind(void 0, config2);
4047
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
4040
+ function GraphQLInputObjectType2(config3) {
4041
+ this.name = config3.name;
4042
+ this.description = config3.description;
4043
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
4044
+ this.astNode = config3.astNode;
4045
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
4046
+ this._fields = defineInputFieldMap.bind(void 0, config3);
4047
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
4048
4048
  }
4049
4049
  var _proto6 = GraphQLInputObjectType2.prototype;
4050
4050
  _proto6.getFields = function getFields() {
@@ -4090,11 +4090,11 @@ var require_definition2 = __commonJS({
4090
4090
  }();
4091
4091
  exports.GraphQLInputObjectType = GraphQLInputObjectType;
4092
4092
  (0, _defineInspect.default)(GraphQLInputObjectType);
4093
- function defineInputFieldMap(config2) {
4094
- var fieldMap = resolveThunk(config2.fields);
4095
- 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."));
4093
+ function defineInputFieldMap(config3) {
4094
+ var fieldMap = resolveThunk(config3.fields);
4095
+ 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."));
4096
4096
  return (0, _mapValue.default)(fieldMap, function(fieldConfig, fieldName) {
4097
- !("resolve" in fieldConfig) || (0, _devAssert.default)(0, "".concat(config2.name, ".").concat(fieldName, " field has a resolve property, but Input Types cannot define resolvers."));
4097
+ !("resolve" in fieldConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, " field has a resolve property, but Input Types cannot define resolvers."));
4098
4098
  return {
4099
4099
  name: fieldName,
4100
4100
  description: fieldConfig.description,
@@ -5291,18 +5291,18 @@ var require_directives2 = __commonJS({
5291
5291
  return directive;
5292
5292
  }
5293
5293
  var GraphQLDirective = /* @__PURE__ */ function() {
5294
- function GraphQLDirective2(config2) {
5294
+ function GraphQLDirective2(config3) {
5295
5295
  var _config$isRepeatable, _config$args;
5296
- this.name = config2.name;
5297
- this.description = config2.description;
5298
- this.locations = config2.locations;
5299
- this.isRepeatable = (_config$isRepeatable = config2.isRepeatable) !== null && _config$isRepeatable !== void 0 ? _config$isRepeatable : false;
5300
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
5301
- this.astNode = config2.astNode;
5302
- config2.name || (0, _devAssert.default)(0, "Directive must be named.");
5303
- Array.isArray(config2.locations) || (0, _devAssert.default)(0, "@".concat(config2.name, " locations must be an Array."));
5304
- var args = (_config$args = config2.args) !== null && _config$args !== void 0 ? _config$args : {};
5305
- (0, _isObjectLike.default)(args) && !Array.isArray(args) || (0, _devAssert.default)(0, "@".concat(config2.name, " args must be an object with argument names as keys."));
5296
+ this.name = config3.name;
5297
+ this.description = config3.description;
5298
+ this.locations = config3.locations;
5299
+ this.isRepeatable = (_config$isRepeatable = config3.isRepeatable) !== null && _config$isRepeatable !== void 0 ? _config$isRepeatable : false;
5300
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
5301
+ this.astNode = config3.astNode;
5302
+ config3.name || (0, _devAssert.default)(0, "Directive must be named.");
5303
+ Array.isArray(config3.locations) || (0, _devAssert.default)(0, "@".concat(config3.name, " locations must be an Array."));
5304
+ var args = (_config$args = config3.args) !== null && _config$args !== void 0 ? _config$args : {};
5305
+ (0, _isObjectLike.default)(args) && !Array.isArray(args) || (0, _devAssert.default)(0, "@".concat(config3.name, " args must be an object with argument names as keys."));
5306
5306
  this.args = (0, _objectEntries.default)(args).map(function(_ref) {
5307
5307
  var argName = _ref[0], argConfig = _ref[1];
5308
5308
  return {
@@ -5458,23 +5458,23 @@ var require_schema2 = __commonJS({
5458
5458
  return schema;
5459
5459
  }
5460
5460
  var GraphQLSchema = /* @__PURE__ */ function() {
5461
- function GraphQLSchema2(config2) {
5461
+ function GraphQLSchema2(config3) {
5462
5462
  var _config$directives;
5463
- this.__validationErrors = config2.assumeValid === true ? [] : void 0;
5464
- (0, _isObjectLike.default)(config2) || (0, _devAssert.default)(0, "Must provide configuration object.");
5465
- !config2.types || Array.isArray(config2.types) || (0, _devAssert.default)(0, '"types" must be Array if provided but got: '.concat((0, _inspect.default)(config2.types), "."));
5466
- !config2.directives || Array.isArray(config2.directives) || (0, _devAssert.default)(0, '"directives" must be Array if provided but got: ' + "".concat((0, _inspect.default)(config2.directives), "."));
5467
- this.description = config2.description;
5468
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
5469
- this.astNode = config2.astNode;
5470
- this.extensionASTNodes = config2.extensionASTNodes;
5471
- this._queryType = config2.query;
5472
- this._mutationType = config2.mutation;
5473
- this._subscriptionType = config2.subscription;
5474
- this._directives = (_config$directives = config2.directives) !== null && _config$directives !== void 0 ? _config$directives : _directives.specifiedDirectives;
5475
- var allReferencedTypes = new Set(config2.types);
5476
- if (config2.types != null) {
5477
- for (var _i2 = 0, _config$types2 = config2.types; _i2 < _config$types2.length; _i2++) {
5463
+ this.__validationErrors = config3.assumeValid === true ? [] : void 0;
5464
+ (0, _isObjectLike.default)(config3) || (0, _devAssert.default)(0, "Must provide configuration object.");
5465
+ !config3.types || Array.isArray(config3.types) || (0, _devAssert.default)(0, '"types" must be Array if provided but got: '.concat((0, _inspect.default)(config3.types), "."));
5466
+ !config3.directives || Array.isArray(config3.directives) || (0, _devAssert.default)(0, '"directives" must be Array if provided but got: ' + "".concat((0, _inspect.default)(config3.directives), "."));
5467
+ this.description = config3.description;
5468
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
5469
+ this.astNode = config3.astNode;
5470
+ this.extensionASTNodes = config3.extensionASTNodes;
5471
+ this._queryType = config3.query;
5472
+ this._mutationType = config3.mutation;
5473
+ this._subscriptionType = config3.subscription;
5474
+ this._directives = (_config$directives = config3.directives) !== null && _config$directives !== void 0 ? _config$directives : _directives.specifiedDirectives;
5475
+ var allReferencedTypes = new Set(config3.types);
5476
+ if (config3.types != null) {
5477
+ for (var _i2 = 0, _config$types2 = config3.types; _i2 < _config$types2.length; _i2++) {
5478
5478
  var type = _config$types2[_i2];
5479
5479
  allReferencedTypes.delete(type);
5480
5480
  collectReferencedTypes(type, allReferencedTypes);
@@ -11800,9 +11800,9 @@ var require_extendSchema2 = __commonJS({
11800
11800
  return typeMap[type.name];
11801
11801
  }
11802
11802
  function replaceDirective(directive) {
11803
- var config2 = directive.toConfig();
11804
- return new _directives.GraphQLDirective(_objectSpread(_objectSpread({}, config2), {}, {
11805
- args: (0, _mapValue.default)(config2.args, extendArg)
11803
+ var config3 = directive.toConfig();
11804
+ return new _directives.GraphQLDirective(_objectSpread(_objectSpread({}, config3), {}, {
11805
+ args: (0, _mapValue.default)(config3.args, extendArg)
11806
11806
  }));
11807
11807
  }
11808
11808
  function extendNamedType(type) {
@@ -11831,80 +11831,80 @@ var require_extendSchema2 = __commonJS({
11831
11831
  }
11832
11832
  function extendInputObjectType(type) {
11833
11833
  var _typeExtensionsMap$co;
11834
- var config2 = type.toConfig();
11835
- var extensions = (_typeExtensionsMap$co = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co !== void 0 ? _typeExtensionsMap$co : [];
11836
- return new _definition.GraphQLInputObjectType(_objectSpread(_objectSpread({}, config2), {}, {
11834
+ var config3 = type.toConfig();
11835
+ var extensions = (_typeExtensionsMap$co = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co !== void 0 ? _typeExtensionsMap$co : [];
11836
+ return new _definition.GraphQLInputObjectType(_objectSpread(_objectSpread({}, config3), {}, {
11837
11837
  fields: function fields() {
11838
- return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config2.fields, function(field) {
11838
+ return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config3.fields, function(field) {
11839
11839
  return _objectSpread(_objectSpread({}, field), {}, {
11840
11840
  type: replaceType(field.type)
11841
11841
  });
11842
11842
  })), buildInputFieldMap(extensions));
11843
11843
  },
11844
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
11844
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
11845
11845
  }));
11846
11846
  }
11847
11847
  function extendEnumType(type) {
11848
11848
  var _typeExtensionsMap$ty;
11849
- var config2 = type.toConfig();
11849
+ var config3 = type.toConfig();
11850
11850
  var extensions = (_typeExtensionsMap$ty = typeExtensionsMap[type.name]) !== null && _typeExtensionsMap$ty !== void 0 ? _typeExtensionsMap$ty : [];
11851
- return new _definition.GraphQLEnumType(_objectSpread(_objectSpread({}, config2), {}, {
11852
- values: _objectSpread(_objectSpread({}, config2.values), buildEnumValueMap(extensions)),
11853
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
11851
+ return new _definition.GraphQLEnumType(_objectSpread(_objectSpread({}, config3), {}, {
11852
+ values: _objectSpread(_objectSpread({}, config3.values), buildEnumValueMap(extensions)),
11853
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
11854
11854
  }));
11855
11855
  }
11856
11856
  function extendScalarType(type) {
11857
11857
  var _typeExtensionsMap$co2;
11858
- var config2 = type.toConfig();
11859
- var extensions = (_typeExtensionsMap$co2 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co2 !== void 0 ? _typeExtensionsMap$co2 : [];
11860
- var specifiedByUrl = config2.specifiedByUrl;
11858
+ var config3 = type.toConfig();
11859
+ var extensions = (_typeExtensionsMap$co2 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co2 !== void 0 ? _typeExtensionsMap$co2 : [];
11860
+ var specifiedByUrl = config3.specifiedByUrl;
11861
11861
  for (var _i8 = 0; _i8 < extensions.length; _i8++) {
11862
11862
  var _getSpecifiedByUrl;
11863
11863
  var extensionNode = extensions[_i8];
11864
11864
  specifiedByUrl = (_getSpecifiedByUrl = getSpecifiedByUrl(extensionNode)) !== null && _getSpecifiedByUrl !== void 0 ? _getSpecifiedByUrl : specifiedByUrl;
11865
11865
  }
11866
- return new _definition.GraphQLScalarType(_objectSpread(_objectSpread({}, config2), {}, {
11866
+ return new _definition.GraphQLScalarType(_objectSpread(_objectSpread({}, config3), {}, {
11867
11867
  specifiedByUrl,
11868
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
11868
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
11869
11869
  }));
11870
11870
  }
11871
11871
  function extendObjectType(type) {
11872
11872
  var _typeExtensionsMap$co3;
11873
- var config2 = type.toConfig();
11874
- var extensions = (_typeExtensionsMap$co3 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co3 !== void 0 ? _typeExtensionsMap$co3 : [];
11875
- return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config2), {}, {
11873
+ var config3 = type.toConfig();
11874
+ var extensions = (_typeExtensionsMap$co3 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co3 !== void 0 ? _typeExtensionsMap$co3 : [];
11875
+ return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config3), {}, {
11876
11876
  interfaces: function interfaces() {
11877
11877
  return [].concat(type.getInterfaces().map(replaceNamedType), buildInterfaces(extensions));
11878
11878
  },
11879
11879
  fields: function fields() {
11880
- return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config2.fields, extendField)), buildFieldMap(extensions));
11880
+ return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config3.fields, extendField)), buildFieldMap(extensions));
11881
11881
  },
11882
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
11882
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
11883
11883
  }));
11884
11884
  }
11885
11885
  function extendInterfaceType(type) {
11886
11886
  var _typeExtensionsMap$co4;
11887
- var config2 = type.toConfig();
11888
- var extensions = (_typeExtensionsMap$co4 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co4 !== void 0 ? _typeExtensionsMap$co4 : [];
11889
- return new _definition.GraphQLInterfaceType(_objectSpread(_objectSpread({}, config2), {}, {
11887
+ var config3 = type.toConfig();
11888
+ var extensions = (_typeExtensionsMap$co4 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co4 !== void 0 ? _typeExtensionsMap$co4 : [];
11889
+ return new _definition.GraphQLInterfaceType(_objectSpread(_objectSpread({}, config3), {}, {
11890
11890
  interfaces: function interfaces() {
11891
11891
  return [].concat(type.getInterfaces().map(replaceNamedType), buildInterfaces(extensions));
11892
11892
  },
11893
11893
  fields: function fields() {
11894
- return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config2.fields, extendField)), buildFieldMap(extensions));
11894
+ return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config3.fields, extendField)), buildFieldMap(extensions));
11895
11895
  },
11896
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
11896
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
11897
11897
  }));
11898
11898
  }
11899
11899
  function extendUnionType(type) {
11900
11900
  var _typeExtensionsMap$co5;
11901
- var config2 = type.toConfig();
11902
- var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
11903
- return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config2), {}, {
11901
+ var config3 = type.toConfig();
11902
+ var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
11903
+ return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config3), {}, {
11904
11904
  types: function types11() {
11905
11905
  return [].concat(type.getTypes().map(replaceNamedType), buildUnionTypes(extensions));
11906
11906
  },
11907
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
11907
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
11908
11908
  }));
11909
11909
  }
11910
11910
  function extendField(field) {
@@ -12221,24 +12221,24 @@ var require_buildASTSchema2 = __commonJS({
12221
12221
  extensionASTNodes: [],
12222
12222
  assumeValid: false
12223
12223
  };
12224
- var config2 = (0, _extendSchema.extendSchemaImpl)(emptySchemaConfig, documentAST, options);
12225
- if (config2.astNode == null) {
12226
- for (var _i2 = 0, _config$types2 = config2.types; _i2 < _config$types2.length; _i2++) {
12224
+ var config3 = (0, _extendSchema.extendSchemaImpl)(emptySchemaConfig, documentAST, options);
12225
+ if (config3.astNode == null) {
12226
+ for (var _i2 = 0, _config$types2 = config3.types; _i2 < _config$types2.length; _i2++) {
12227
12227
  var type = _config$types2[_i2];
12228
12228
  switch (type.name) {
12229
12229
  case "Query":
12230
- config2.query = type;
12230
+ config3.query = type;
12231
12231
  break;
12232
12232
  case "Mutation":
12233
- config2.mutation = type;
12233
+ config3.mutation = type;
12234
12234
  break;
12235
12235
  case "Subscription":
12236
- config2.subscription = type;
12236
+ config3.subscription = type;
12237
12237
  break;
12238
12238
  }
12239
12239
  }
12240
12240
  }
12241
- var directives = config2.directives;
12241
+ var directives = config3.directives;
12242
12242
  var _loop = function _loop2(_i42) {
12243
12243
  var stdDirective = _directives.specifiedDirectives[_i42];
12244
12244
  if (directives.every(function(directive) {
@@ -12250,7 +12250,7 @@ var require_buildASTSchema2 = __commonJS({
12250
12250
  for (var _i4 = 0; _i4 < _directives.specifiedDirectives.length; _i4++) {
12251
12251
  _loop(_i4);
12252
12252
  }
12253
- return new _schema.GraphQLSchema(config2);
12253
+ return new _schema.GraphQLSchema(config3);
12254
12254
  }
12255
12255
  function buildSchema(source, options) {
12256
12256
  var document = (0, _parser.parse)(source, {
@@ -12352,12 +12352,12 @@ var require_lexicographicSortSchema2 = __commonJS({
12352
12352
  return maybeType && replaceNamedType(maybeType);
12353
12353
  }
12354
12354
  function sortDirective(directive) {
12355
- var config2 = directive.toConfig();
12356
- return new _directives.GraphQLDirective(_objectSpread(_objectSpread({}, config2), {}, {
12357
- locations: sortBy(config2.locations, function(x4) {
12355
+ var config3 = directive.toConfig();
12356
+ return new _directives.GraphQLDirective(_objectSpread(_objectSpread({}, config3), {}, {
12357
+ locations: sortBy(config3.locations, function(x4) {
12358
12358
  return x4;
12359
12359
  }),
12360
- args: sortArgs(config2.args)
12360
+ args: sortArgs(config3.args)
12361
12361
  }));
12362
12362
  }
12363
12363
  function sortArgs(args) {
@@ -12390,13 +12390,13 @@ var require_lexicographicSortSchema2 = __commonJS({
12390
12390
  return type;
12391
12391
  }
12392
12392
  if ((0, _definition.isObjectType)(type)) {
12393
- var config2 = type.toConfig();
12394
- return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config2), {}, {
12393
+ var config3 = type.toConfig();
12394
+ return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config3), {}, {
12395
12395
  interfaces: function interfaces() {
12396
- return sortTypes(config2.interfaces);
12396
+ return sortTypes(config3.interfaces);
12397
12397
  },
12398
12398
  fields: function fields() {
12399
- return sortFields(config2.fields);
12399
+ return sortFields(config3.fields);
12400
12400
  }
12401
12401
  }));
12402
12402
  }
@@ -26494,13 +26494,13 @@ var require_esprima6 = __commonJS({
26494
26494
  return Reader2;
26495
26495
  }();
26496
26496
  var Tokenizer = function() {
26497
- function Tokenizer2(code, config2) {
26497
+ function Tokenizer2(code, config3) {
26498
26498
  this.errorHandler = new error_handler_1.ErrorHandler();
26499
- this.errorHandler.tolerant = config2 ? typeof config2.tolerant === "boolean" && config2.tolerant : false;
26499
+ this.errorHandler.tolerant = config3 ? typeof config3.tolerant === "boolean" && config3.tolerant : false;
26500
26500
  this.scanner = new scanner_1.Scanner(code, this.errorHandler);
26501
- this.scanner.trackComment = config2 ? typeof config2.comment === "boolean" && config2.comment : false;
26502
- this.trackRange = config2 ? typeof config2.range === "boolean" && config2.range : false;
26503
- this.trackLoc = config2 ? typeof config2.loc === "boolean" && config2.loc : false;
26501
+ this.scanner.trackComment = config3 ? typeof config3.comment === "boolean" && config3.comment : false;
26502
+ this.trackRange = config3 ? typeof config3.range === "boolean" && config3.range : false;
26503
+ this.trackLoc = config3 ? typeof config3.loc === "boolean" && config3.loc : false;
26504
26504
  this.buffer = [];
26505
26505
  this.reader = new Reader();
26506
26506
  }
@@ -28668,11 +28668,11 @@ var require_printer5 = __commonJS({
28668
28668
  return this.code;
28669
28669
  };
28670
28670
  var emptyPrintResult = new PrintResult("");
28671
- var Printer = function Printer2(config2) {
28671
+ var Printer = function Printer2(config3) {
28672
28672
  assert_1.default.ok(this instanceof Printer2);
28673
- var explicitTabWidth = config2 && config2.tabWidth;
28674
- config2 = options_1.normalize(config2);
28675
- config2.sourceFileName = null;
28673
+ var explicitTabWidth = config3 && config3.tabWidth;
28674
+ config3 = options_1.normalize(config3);
28675
+ config3.sourceFileName = null;
28676
28676
  function makePrintFunctionWith(options, overrides) {
28677
28677
  options = Object.assign({}, options, overrides);
28678
28678
  return function(path3) {
@@ -28687,19 +28687,19 @@ var require_printer5 = __commonJS({
28687
28687
  includeComments: false
28688
28688
  }));
28689
28689
  }
28690
- var oldTabWidth = config2.tabWidth;
28690
+ var oldTabWidth = config3.tabWidth;
28691
28691
  if (!explicitTabWidth) {
28692
28692
  var loc = path3.getNode().loc;
28693
28693
  if (loc && loc.lines && loc.lines.guessTabWidth) {
28694
- config2.tabWidth = loc.lines.guessTabWidth();
28694
+ config3.tabWidth = loc.lines.guessTabWidth();
28695
28695
  }
28696
28696
  }
28697
28697
  var reprinter = patcher_1.getReprinter(path3);
28698
- var lines = reprinter ? reprinter(print2) : genericPrint(path3, config2, options, makePrintFunctionWith(options, {
28698
+ var lines = reprinter ? reprinter(print2) : genericPrint(path3, config3, options, makePrintFunctionWith(options, {
28699
28699
  includeComments: true,
28700
28700
  avoidRootParens: false
28701
28701
  }));
28702
- config2.tabWidth = oldTabWidth;
28702
+ config3.tabWidth = oldTabWidth;
28703
28703
  return lines;
28704
28704
  }
28705
28705
  this.print = function(ast) {
@@ -28710,7 +28710,7 @@ var require_printer5 = __commonJS({
28710
28710
  includeComments: true,
28711
28711
  avoidRootParens: false
28712
28712
  });
28713
- return new PrintResult(lines.toString(config2), util.composeSourceMaps(config2.inputSourceMap, lines.getSourceMap(config2.sourceMapName, config2.sourceRoot)));
28713
+ return new PrintResult(lines.toString(config3), util.composeSourceMaps(config3.inputSourceMap, lines.getSourceMap(config3.sourceMapName, config3.sourceRoot)));
28714
28714
  };
28715
28715
  this.printGenerically = function(ast) {
28716
28716
  if (!ast) {
@@ -28718,26 +28718,26 @@ var require_printer5 = __commonJS({
28718
28718
  }
28719
28719
  function printGenerically(path4) {
28720
28720
  return comments_1.printComments(path4, function(path5) {
28721
- return genericPrint(path5, config2, {
28721
+ return genericPrint(path5, config3, {
28722
28722
  includeComments: true,
28723
28723
  avoidRootParens: false
28724
28724
  }, printGenerically);
28725
28725
  });
28726
28726
  }
28727
28727
  var path3 = fast_path_1.default.from(ast);
28728
- var oldReuseWhitespace = config2.reuseWhitespace;
28729
- config2.reuseWhitespace = false;
28730
- var pr = new PrintResult(printGenerically(path3).toString(config2));
28731
- config2.reuseWhitespace = oldReuseWhitespace;
28728
+ var oldReuseWhitespace = config3.reuseWhitespace;
28729
+ config3.reuseWhitespace = false;
28730
+ var pr = new PrintResult(printGenerically(path3).toString(config3));
28731
+ config3.reuseWhitespace = oldReuseWhitespace;
28732
28732
  return pr;
28733
28733
  };
28734
28734
  };
28735
28735
  exports.Printer = Printer;
28736
- function genericPrint(path3, config2, options, printPath) {
28736
+ function genericPrint(path3, config3, options, printPath) {
28737
28737
  assert_1.default.ok(path3 instanceof fast_path_1.default);
28738
28738
  var node2 = path3.getValue();
28739
28739
  var parts = [];
28740
- var linesWithoutParens = genericPrintNoParens(path3, config2, printPath);
28740
+ var linesWithoutParens = genericPrintNoParens(path3, config3, printPath);
28741
28741
  if (!node2 || linesWithoutParens.isEmpty()) {
28742
28742
  return linesWithoutParens;
28743
28743
  }
@@ -30803,10 +30803,10 @@ var require_main5 = __commonJS({
30803
30803
  }
30804
30804
  });
30805
30805
 
30806
- // ../../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
30806
+ // ../../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
30807
30807
  var HttpError, Redirect, ValidationError;
30808
30808
  var init_control = __esm({
30809
- "../../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"() {
30809
+ "../../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"() {
30810
30810
  HttpError = class {
30811
30811
  constructor(status, body) {
30812
30812
  this.status = status;
@@ -30837,7 +30837,7 @@ var init_control = __esm({
30837
30837
  }
30838
30838
  });
30839
30839
 
30840
- // ../../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
30840
+ // ../../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
30841
30841
  var exports_exports = {};
30842
30842
  __export(exports_exports, {
30843
30843
  error: () => error2,
@@ -30846,10 +30846,13 @@ __export(exports_exports, {
30846
30846
  redirect: () => redirect
30847
30847
  });
30848
30848
  function error2(status, message) {
30849
+ if ((!__SVELTEKIT_BROWSER__ || __SVELTEKIT_DEV__) && (isNaN(status) || status < 400 || status > 599)) {
30850
+ throw new Error(`HTTP error status codes must be between 400 and 599 \u2014 ${status} is invalid`);
30851
+ }
30849
30852
  return new HttpError(status, message);
30850
30853
  }
30851
30854
  function redirect(status, location) {
30852
- if (isNaN(status) || status < 300 || status > 308) {
30855
+ if ((!__SVELTEKIT_BROWSER__ || __SVELTEKIT_DEV__) && (isNaN(status) || status < 300 || status > 308)) {
30853
30856
  throw new Error("Invalid status code");
30854
30857
  }
30855
30858
  return new Redirect(status, location);
@@ -30868,7 +30871,7 @@ function invalid(status, data2) {
30868
30871
  return new ValidationError(status, data2);
30869
30872
  }
30870
30873
  var init_exports = __esm({
30871
- "../../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"() {
30874
+ "../../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"() {
30872
30875
  init_control();
30873
30876
  }
30874
30877
  });
@@ -34457,25 +34460,25 @@ var require_definition = __commonJS2({
34457
34460
  return arr && arr.length > 0 ? arr : void 0;
34458
34461
  }
34459
34462
  var GraphQLScalarType4 = /* @__PURE__ */ function() {
34460
- function GraphQLScalarType5(config2) {
34463
+ function GraphQLScalarType5(config3) {
34461
34464
  var _config$parseValue, _config$serialize, _config$parseLiteral;
34462
- var parseValue = (_config$parseValue = config2.parseValue) !== null && _config$parseValue !== void 0 ? _config$parseValue : _identityFunc.default;
34463
- this.name = config2.name;
34464
- this.description = config2.description;
34465
- this.specifiedByUrl = config2.specifiedByUrl;
34466
- this.serialize = (_config$serialize = config2.serialize) !== null && _config$serialize !== void 0 ? _config$serialize : _identityFunc.default;
34465
+ var parseValue = (_config$parseValue = config3.parseValue) !== null && _config$parseValue !== void 0 ? _config$parseValue : _identityFunc.default;
34466
+ this.name = config3.name;
34467
+ this.description = config3.description;
34468
+ this.specifiedByUrl = config3.specifiedByUrl;
34469
+ this.serialize = (_config$serialize = config3.serialize) !== null && _config$serialize !== void 0 ? _config$serialize : _identityFunc.default;
34467
34470
  this.parseValue = parseValue;
34468
- this.parseLiteral = (_config$parseLiteral = config2.parseLiteral) !== null && _config$parseLiteral !== void 0 ? _config$parseLiteral : function(node2, variables) {
34471
+ this.parseLiteral = (_config$parseLiteral = config3.parseLiteral) !== null && _config$parseLiteral !== void 0 ? _config$parseLiteral : function(node2, variables) {
34469
34472
  return parseValue((0, _valueFromASTUntyped.valueFromASTUntyped)(node2, variables));
34470
34473
  };
34471
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
34472
- this.astNode = config2.astNode;
34473
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
34474
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34475
- 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), "."));
34476
- 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.'));
34477
- if (config2.parseLiteral) {
34478
- typeof config2.parseValue === "function" && typeof config2.parseLiteral === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide both "parseValue" and "parseLiteral" functions.'));
34474
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
34475
+ this.astNode = config3.astNode;
34476
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
34477
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34478
+ 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), "."));
34479
+ 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.'));
34480
+ if (config3.parseLiteral) {
34481
+ typeof config3.parseValue === "function" && typeof config3.parseLiteral === "function" || (0, _devAssert.default)(0, "".concat(this.name, ' must provide both "parseValue" and "parseLiteral" functions.'));
34479
34482
  }
34480
34483
  }
34481
34484
  var _proto = GraphQLScalarType5.prototype;
@@ -34510,17 +34513,17 @@ var require_definition = __commonJS2({
34510
34513
  exports.GraphQLScalarType = GraphQLScalarType4;
34511
34514
  (0, _defineInspect.default)(GraphQLScalarType4);
34512
34515
  var GraphQLObjectType5 = /* @__PURE__ */ function() {
34513
- function GraphQLObjectType6(config2) {
34514
- this.name = config2.name;
34515
- this.description = config2.description;
34516
- this.isTypeOf = config2.isTypeOf;
34517
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
34518
- this.astNode = config2.astNode;
34519
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
34520
- this._fields = defineFieldMap.bind(void 0, config2);
34521
- this._interfaces = defineInterfaces.bind(void 0, config2);
34522
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34523
- 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), "."));
34516
+ function GraphQLObjectType6(config3) {
34517
+ this.name = config3.name;
34518
+ this.description = config3.description;
34519
+ this.isTypeOf = config3.isTypeOf;
34520
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
34521
+ this.astNode = config3.astNode;
34522
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
34523
+ this._fields = defineFieldMap.bind(void 0, config3);
34524
+ this._interfaces = defineInterfaces.bind(void 0, config3);
34525
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34526
+ 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), "."));
34524
34527
  }
34525
34528
  var _proto2 = GraphQLObjectType6.prototype;
34526
34529
  _proto2.getFields = function getFields() {
@@ -34563,22 +34566,22 @@ var require_definition = __commonJS2({
34563
34566
  }();
34564
34567
  exports.GraphQLObjectType = GraphQLObjectType5;
34565
34568
  (0, _defineInspect.default)(GraphQLObjectType5);
34566
- function defineInterfaces(config2) {
34569
+ function defineInterfaces(config3) {
34567
34570
  var _resolveThunk;
34568
- var interfaces = (_resolveThunk = resolveThunk(config2.interfaces)) !== null && _resolveThunk !== void 0 ? _resolveThunk : [];
34569
- Array.isArray(interfaces) || (0, _devAssert.default)(0, "".concat(config2.name, " interfaces must be an Array or a function which returns an Array."));
34571
+ var interfaces = (_resolveThunk = resolveThunk(config3.interfaces)) !== null && _resolveThunk !== void 0 ? _resolveThunk : [];
34572
+ Array.isArray(interfaces) || (0, _devAssert.default)(0, "".concat(config3.name, " interfaces must be an Array or a function which returns an Array."));
34570
34573
  return interfaces;
34571
34574
  }
34572
- function defineFieldMap(config2) {
34573
- var fieldMap = resolveThunk(config2.fields);
34574
- 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."));
34575
+ function defineFieldMap(config3) {
34576
+ var fieldMap = resolveThunk(config3.fields);
34577
+ 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."));
34575
34578
  return (0, _mapValue.default)(fieldMap, function(fieldConfig, fieldName) {
34576
34579
  var _fieldConfig$args;
34577
- isPlainObj(fieldConfig) || (0, _devAssert.default)(0, "".concat(config2.name, ".").concat(fieldName, " field config must be an object."));
34578
- !("isDeprecated" in fieldConfig) || (0, _devAssert.default)(0, "".concat(config2.name, ".").concat(fieldName, ' should provide "deprecationReason" instead of "isDeprecated".'));
34579
- 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), "."));
34580
+ isPlainObj(fieldConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, " field config must be an object."));
34581
+ !("isDeprecated" in fieldConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, ' should provide "deprecationReason" instead of "isDeprecated".'));
34582
+ 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), "."));
34580
34583
  var argsConfig = (_fieldConfig$args = fieldConfig.args) !== null && _fieldConfig$args !== void 0 ? _fieldConfig$args : {};
34581
- isPlainObj(argsConfig) || (0, _devAssert.default)(0, "".concat(config2.name, ".").concat(fieldName, " args must be an object with argument names as keys."));
34584
+ isPlainObj(argsConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, " args must be an object with argument names as keys."));
34582
34585
  var args = (0, _objectEntries.default)(argsConfig).map(function(_ref) {
34583
34586
  var argName = _ref[0], argConfig = _ref[1];
34584
34587
  return {
@@ -34640,17 +34643,17 @@ var require_definition = __commonJS2({
34640
34643
  return isNonNullType6(arg.type) && arg.defaultValue === void 0;
34641
34644
  }
34642
34645
  var GraphQLInterfaceType5 = /* @__PURE__ */ function() {
34643
- function GraphQLInterfaceType6(config2) {
34644
- this.name = config2.name;
34645
- this.description = config2.description;
34646
- this.resolveType = config2.resolveType;
34647
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
34648
- this.astNode = config2.astNode;
34649
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
34650
- this._fields = defineFieldMap.bind(void 0, config2);
34651
- this._interfaces = defineInterfaces.bind(void 0, config2);
34652
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34653
- 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), "."));
34646
+ function GraphQLInterfaceType6(config3) {
34647
+ this.name = config3.name;
34648
+ this.description = config3.description;
34649
+ this.resolveType = config3.resolveType;
34650
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
34651
+ this.astNode = config3.astNode;
34652
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
34653
+ this._fields = defineFieldMap.bind(void 0, config3);
34654
+ this._interfaces = defineInterfaces.bind(void 0, config3);
34655
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34656
+ 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), "."));
34654
34657
  }
34655
34658
  var _proto3 = GraphQLInterfaceType6.prototype;
34656
34659
  _proto3.getFields = function getFields() {
@@ -34695,16 +34698,16 @@ var require_definition = __commonJS2({
34695
34698
  exports.GraphQLInterfaceType = GraphQLInterfaceType5;
34696
34699
  (0, _defineInspect.default)(GraphQLInterfaceType5);
34697
34700
  var GraphQLUnionType3 = /* @__PURE__ */ function() {
34698
- function GraphQLUnionType4(config2) {
34699
- this.name = config2.name;
34700
- this.description = config2.description;
34701
- this.resolveType = config2.resolveType;
34702
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
34703
- this.astNode = config2.astNode;
34704
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
34705
- this._types = defineTypes.bind(void 0, config2);
34706
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34707
- 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), "."));
34701
+ function GraphQLUnionType4(config3) {
34702
+ this.name = config3.name;
34703
+ this.description = config3.description;
34704
+ this.resolveType = config3.resolveType;
34705
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
34706
+ this.astNode = config3.astNode;
34707
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
34708
+ this._types = defineTypes.bind(void 0, config3);
34709
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34710
+ 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), "."));
34708
34711
  }
34709
34712
  var _proto4 = GraphQLUnionType4.prototype;
34710
34713
  _proto4.getTypes = function getTypes() {
@@ -34741,26 +34744,26 @@ var require_definition = __commonJS2({
34741
34744
  }();
34742
34745
  exports.GraphQLUnionType = GraphQLUnionType3;
34743
34746
  (0, _defineInspect.default)(GraphQLUnionType3);
34744
- function defineTypes(config2) {
34745
- var types42 = resolveThunk(config2.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(config2.name, "."));
34747
+ function defineTypes(config3) {
34748
+ var types42 = resolveThunk(config3.types);
34749
+ 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, "."));
34747
34750
  return types42;
34748
34751
  }
34749
34752
  var GraphQLEnumType4 = /* @__PURE__ */ function() {
34750
- function GraphQLEnumType5(config2) {
34751
- this.name = config2.name;
34752
- this.description = config2.description;
34753
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
34754
- this.astNode = config2.astNode;
34755
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
34756
- this._values = defineEnumValues(this.name, config2.values);
34753
+ function GraphQLEnumType5(config3) {
34754
+ this.name = config3.name;
34755
+ this.description = config3.description;
34756
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
34757
+ this.astNode = config3.astNode;
34758
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
34759
+ this._values = defineEnumValues(this.name, config3.values);
34757
34760
  this._valueLookup = new Map(this._values.map(function(enumValue) {
34758
34761
  return [enumValue.value, enumValue];
34759
34762
  }));
34760
34763
  this._nameLookup = (0, _keyMap.default)(this._values, function(value2) {
34761
34764
  return value2.name;
34762
34765
  });
34763
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34766
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34764
34767
  }
34765
34768
  var _proto5 = GraphQLEnumType5.prototype;
34766
34769
  _proto5.getValues = function getValues() {
@@ -34862,14 +34865,14 @@ var require_definition = __commonJS2({
34862
34865
  });
34863
34866
  }
34864
34867
  var GraphQLInputObjectType4 = /* @__PURE__ */ function() {
34865
- function GraphQLInputObjectType5(config2) {
34866
- this.name = config2.name;
34867
- this.description = config2.description;
34868
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
34869
- this.astNode = config2.astNode;
34870
- this.extensionASTNodes = undefineIfEmpty(config2.extensionASTNodes);
34871
- this._fields = defineInputFieldMap.bind(void 0, config2);
34872
- typeof config2.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34868
+ function GraphQLInputObjectType5(config3) {
34869
+ this.name = config3.name;
34870
+ this.description = config3.description;
34871
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
34872
+ this.astNode = config3.astNode;
34873
+ this.extensionASTNodes = undefineIfEmpty(config3.extensionASTNodes);
34874
+ this._fields = defineInputFieldMap.bind(void 0, config3);
34875
+ typeof config3.name === "string" || (0, _devAssert.default)(0, "Must provide name.");
34873
34876
  }
34874
34877
  var _proto6 = GraphQLInputObjectType5.prototype;
34875
34878
  _proto6.getFields = function getFields() {
@@ -34915,11 +34918,11 @@ var require_definition = __commonJS2({
34915
34918
  }();
34916
34919
  exports.GraphQLInputObjectType = GraphQLInputObjectType4;
34917
34920
  (0, _defineInspect.default)(GraphQLInputObjectType4);
34918
- function defineInputFieldMap(config2) {
34919
- var fieldMap = resolveThunk(config2.fields);
34920
- 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."));
34921
+ function defineInputFieldMap(config3) {
34922
+ var fieldMap = resolveThunk(config3.fields);
34923
+ 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."));
34921
34924
  return (0, _mapValue.default)(fieldMap, function(fieldConfig, fieldName) {
34922
- !("resolve" in fieldConfig) || (0, _devAssert.default)(0, "".concat(config2.name, ".").concat(fieldName, " field has a resolve property, but Input Types cannot define resolvers."));
34925
+ !("resolve" in fieldConfig) || (0, _devAssert.default)(0, "".concat(config3.name, ".").concat(fieldName, " field has a resolve property, but Input Types cannot define resolvers."));
34923
34926
  return {
34924
34927
  name: fieldName,
34925
34928
  description: fieldConfig.description,
@@ -36098,18 +36101,18 @@ var require_directives = __commonJS2({
36098
36101
  return directive;
36099
36102
  }
36100
36103
  var GraphQLDirective2 = /* @__PURE__ */ function() {
36101
- function GraphQLDirective3(config2) {
36104
+ function GraphQLDirective3(config3) {
36102
36105
  var _config$isRepeatable, _config$args;
36103
- this.name = config2.name;
36104
- this.description = config2.description;
36105
- this.locations = config2.locations;
36106
- this.isRepeatable = (_config$isRepeatable = config2.isRepeatable) !== null && _config$isRepeatable !== void 0 ? _config$isRepeatable : false;
36107
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
36108
- this.astNode = config2.astNode;
36109
- config2.name || (0, _devAssert.default)(0, "Directive must be named.");
36110
- Array.isArray(config2.locations) || (0, _devAssert.default)(0, "@".concat(config2.name, " locations must be an Array."));
36111
- var args = (_config$args = config2.args) !== null && _config$args !== void 0 ? _config$args : {};
36112
- (0, _isObjectLike.default)(args) && !Array.isArray(args) || (0, _devAssert.default)(0, "@".concat(config2.name, " args must be an object with argument names as keys."));
36106
+ this.name = config3.name;
36107
+ this.description = config3.description;
36108
+ this.locations = config3.locations;
36109
+ this.isRepeatable = (_config$isRepeatable = config3.isRepeatable) !== null && _config$isRepeatable !== void 0 ? _config$isRepeatable : false;
36110
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
36111
+ this.astNode = config3.astNode;
36112
+ config3.name || (0, _devAssert.default)(0, "Directive must be named.");
36113
+ Array.isArray(config3.locations) || (0, _devAssert.default)(0, "@".concat(config3.name, " locations must be an Array."));
36114
+ var args = (_config$args = config3.args) !== null && _config$args !== void 0 ? _config$args : {};
36115
+ (0, _isObjectLike.default)(args) && !Array.isArray(args) || (0, _devAssert.default)(0, "@".concat(config3.name, " args must be an object with argument names as keys."));
36113
36116
  this.args = (0, _objectEntries.default)(args).map(function(_ref) {
36114
36117
  var argName = _ref[0], argConfig = _ref[1];
36115
36118
  return {
@@ -36263,23 +36266,23 @@ var require_schema = __commonJS2({
36263
36266
  return schema;
36264
36267
  }
36265
36268
  var GraphQLSchema2 = /* @__PURE__ */ function() {
36266
- function GraphQLSchema3(config2) {
36269
+ function GraphQLSchema3(config3) {
36267
36270
  var _config$directives;
36268
- this.__validationErrors = config2.assumeValid === true ? [] : void 0;
36269
- (0, _isObjectLike.default)(config2) || (0, _devAssert.default)(0, "Must provide configuration object.");
36270
- !config2.types || Array.isArray(config2.types) || (0, _devAssert.default)(0, '"types" must be Array if provided but got: '.concat((0, _inspect.default)(config2.types), "."));
36271
- !config2.directives || Array.isArray(config2.directives) || (0, _devAssert.default)(0, '"directives" must be Array if provided but got: ' + "".concat((0, _inspect.default)(config2.directives), "."));
36272
- this.description = config2.description;
36273
- this.extensions = config2.extensions && (0, _toObjMap.default)(config2.extensions);
36274
- this.astNode = config2.astNode;
36275
- this.extensionASTNodes = config2.extensionASTNodes;
36276
- this._queryType = config2.query;
36277
- this._mutationType = config2.mutation;
36278
- this._subscriptionType = config2.subscription;
36279
- this._directives = (_config$directives = config2.directives) !== null && _config$directives !== void 0 ? _config$directives : _directives.specifiedDirectives;
36280
- var allReferencedTypes = new Set(config2.types);
36281
- if (config2.types != null) {
36282
- for (var _i2 = 0, _config$types2 = config2.types; _i2 < _config$types2.length; _i2++) {
36271
+ this.__validationErrors = config3.assumeValid === true ? [] : void 0;
36272
+ (0, _isObjectLike.default)(config3) || (0, _devAssert.default)(0, "Must provide configuration object.");
36273
+ !config3.types || Array.isArray(config3.types) || (0, _devAssert.default)(0, '"types" must be Array if provided but got: '.concat((0, _inspect.default)(config3.types), "."));
36274
+ !config3.directives || Array.isArray(config3.directives) || (0, _devAssert.default)(0, '"directives" must be Array if provided but got: ' + "".concat((0, _inspect.default)(config3.directives), "."));
36275
+ this.description = config3.description;
36276
+ this.extensions = config3.extensions && (0, _toObjMap.default)(config3.extensions);
36277
+ this.astNode = config3.astNode;
36278
+ this.extensionASTNodes = config3.extensionASTNodes;
36279
+ this._queryType = config3.query;
36280
+ this._mutationType = config3.mutation;
36281
+ this._subscriptionType = config3.subscription;
36282
+ this._directives = (_config$directives = config3.directives) !== null && _config$directives !== void 0 ? _config$directives : _directives.specifiedDirectives;
36283
+ var allReferencedTypes = new Set(config3.types);
36284
+ if (config3.types != null) {
36285
+ for (var _i2 = 0, _config$types2 = config3.types; _i2 < _config$types2.length; _i2++) {
36283
36286
  var type = _config$types2[_i2];
36284
36287
  allReferencedTypes.delete(type);
36285
36288
  collectReferencedTypes(type, allReferencedTypes);
@@ -42469,9 +42472,9 @@ var require_extendSchema = __commonJS2({
42469
42472
  return typeMap[type.name];
42470
42473
  }
42471
42474
  function replaceDirective(directive) {
42472
- var config2 = directive.toConfig();
42473
- return new _directives.GraphQLDirective(_objectSpread(_objectSpread({}, config2), {}, {
42474
- args: (0, _mapValue.default)(config2.args, extendArg)
42475
+ var config3 = directive.toConfig();
42476
+ return new _directives.GraphQLDirective(_objectSpread(_objectSpread({}, config3), {}, {
42477
+ args: (0, _mapValue.default)(config3.args, extendArg)
42475
42478
  }));
42476
42479
  }
42477
42480
  function extendNamedType(type) {
@@ -42500,80 +42503,80 @@ var require_extendSchema = __commonJS2({
42500
42503
  }
42501
42504
  function extendInputObjectType(type) {
42502
42505
  var _typeExtensionsMap$co;
42503
- var config2 = type.toConfig();
42504
- var extensions = (_typeExtensionsMap$co = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co !== void 0 ? _typeExtensionsMap$co : [];
42505
- return new _definition.GraphQLInputObjectType(_objectSpread(_objectSpread({}, config2), {}, {
42506
+ var config3 = type.toConfig();
42507
+ var extensions = (_typeExtensionsMap$co = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co !== void 0 ? _typeExtensionsMap$co : [];
42508
+ return new _definition.GraphQLInputObjectType(_objectSpread(_objectSpread({}, config3), {}, {
42506
42509
  fields: function fields() {
42507
- return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config2.fields, function(field) {
42510
+ return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config3.fields, function(field) {
42508
42511
  return _objectSpread(_objectSpread({}, field), {}, {
42509
42512
  type: replaceType(field.type)
42510
42513
  });
42511
42514
  })), buildInputFieldMap(extensions));
42512
42515
  },
42513
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
42516
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
42514
42517
  }));
42515
42518
  }
42516
42519
  function extendEnumType(type) {
42517
42520
  var _typeExtensionsMap$ty;
42518
- var config2 = type.toConfig();
42521
+ var config3 = type.toConfig();
42519
42522
  var extensions = (_typeExtensionsMap$ty = typeExtensionsMap[type.name]) !== null && _typeExtensionsMap$ty !== void 0 ? _typeExtensionsMap$ty : [];
42520
- return new _definition.GraphQLEnumType(_objectSpread(_objectSpread({}, config2), {}, {
42521
- values: _objectSpread(_objectSpread({}, config2.values), buildEnumValueMap(extensions)),
42522
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
42523
+ return new _definition.GraphQLEnumType(_objectSpread(_objectSpread({}, config3), {}, {
42524
+ values: _objectSpread(_objectSpread({}, config3.values), buildEnumValueMap(extensions)),
42525
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
42523
42526
  }));
42524
42527
  }
42525
42528
  function extendScalarType(type) {
42526
42529
  var _typeExtensionsMap$co2;
42527
- var config2 = type.toConfig();
42528
- var extensions = (_typeExtensionsMap$co2 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co2 !== void 0 ? _typeExtensionsMap$co2 : [];
42529
- var specifiedByUrl = config2.specifiedByUrl;
42530
+ var config3 = type.toConfig();
42531
+ var extensions = (_typeExtensionsMap$co2 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co2 !== void 0 ? _typeExtensionsMap$co2 : [];
42532
+ var specifiedByUrl = config3.specifiedByUrl;
42530
42533
  for (var _i8 = 0; _i8 < extensions.length; _i8++) {
42531
42534
  var _getSpecifiedByUrl;
42532
42535
  var extensionNode = extensions[_i8];
42533
42536
  specifiedByUrl = (_getSpecifiedByUrl = getSpecifiedByUrl(extensionNode)) !== null && _getSpecifiedByUrl !== void 0 ? _getSpecifiedByUrl : specifiedByUrl;
42534
42537
  }
42535
- return new _definition.GraphQLScalarType(_objectSpread(_objectSpread({}, config2), {}, {
42538
+ return new _definition.GraphQLScalarType(_objectSpread(_objectSpread({}, config3), {}, {
42536
42539
  specifiedByUrl,
42537
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
42540
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
42538
42541
  }));
42539
42542
  }
42540
42543
  function extendObjectType(type) {
42541
42544
  var _typeExtensionsMap$co3;
42542
- var config2 = type.toConfig();
42543
- var extensions = (_typeExtensionsMap$co3 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co3 !== void 0 ? _typeExtensionsMap$co3 : [];
42544
- return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config2), {}, {
42545
+ var config3 = type.toConfig();
42546
+ var extensions = (_typeExtensionsMap$co3 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co3 !== void 0 ? _typeExtensionsMap$co3 : [];
42547
+ return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config3), {}, {
42545
42548
  interfaces: function interfaces() {
42546
42549
  return [].concat(type.getInterfaces().map(replaceNamedType), buildInterfaces(extensions));
42547
42550
  },
42548
42551
  fields: function fields() {
42549
- return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config2.fields, extendField)), buildFieldMap(extensions));
42552
+ return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config3.fields, extendField)), buildFieldMap(extensions));
42550
42553
  },
42551
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
42554
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
42552
42555
  }));
42553
42556
  }
42554
42557
  function extendInterfaceType(type) {
42555
42558
  var _typeExtensionsMap$co4;
42556
- var config2 = type.toConfig();
42557
- var extensions = (_typeExtensionsMap$co4 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co4 !== void 0 ? _typeExtensionsMap$co4 : [];
42558
- return new _definition.GraphQLInterfaceType(_objectSpread(_objectSpread({}, config2), {}, {
42559
+ var config3 = type.toConfig();
42560
+ var extensions = (_typeExtensionsMap$co4 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co4 !== void 0 ? _typeExtensionsMap$co4 : [];
42561
+ return new _definition.GraphQLInterfaceType(_objectSpread(_objectSpread({}, config3), {}, {
42559
42562
  interfaces: function interfaces() {
42560
42563
  return [].concat(type.getInterfaces().map(replaceNamedType), buildInterfaces(extensions));
42561
42564
  },
42562
42565
  fields: function fields() {
42563
- return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config2.fields, extendField)), buildFieldMap(extensions));
42566
+ return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config3.fields, extendField)), buildFieldMap(extensions));
42564
42567
  },
42565
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
42568
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
42566
42569
  }));
42567
42570
  }
42568
42571
  function extendUnionType(type) {
42569
42572
  var _typeExtensionsMap$co5;
42570
- var config2 = type.toConfig();
42571
- var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
42572
- return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config2), {}, {
42573
+ var config3 = type.toConfig();
42574
+ var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config3.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
42575
+ return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config3), {}, {
42573
42576
  types: function types42() {
42574
42577
  return [].concat(type.getTypes().map(replaceNamedType), buildUnionTypes(extensions));
42575
42578
  },
42576
- extensionASTNodes: config2.extensionASTNodes.concat(extensions)
42579
+ extensionASTNodes: config3.extensionASTNodes.concat(extensions)
42577
42580
  }));
42578
42581
  }
42579
42582
  function extendField(field) {
@@ -42888,24 +42891,24 @@ var require_buildASTSchema = __commonJS2({
42888
42891
  extensionASTNodes: [],
42889
42892
  assumeValid: false
42890
42893
  };
42891
- var config2 = (0, _extendSchema.extendSchemaImpl)(emptySchemaConfig, documentAST, options);
42892
- if (config2.astNode == null) {
42893
- for (var _i2 = 0, _config$types2 = config2.types; _i2 < _config$types2.length; _i2++) {
42894
+ var config3 = (0, _extendSchema.extendSchemaImpl)(emptySchemaConfig, documentAST, options);
42895
+ if (config3.astNode == null) {
42896
+ for (var _i2 = 0, _config$types2 = config3.types; _i2 < _config$types2.length; _i2++) {
42894
42897
  var type = _config$types2[_i2];
42895
42898
  switch (type.name) {
42896
42899
  case "Query":
42897
- config2.query = type;
42900
+ config3.query = type;
42898
42901
  break;
42899
42902
  case "Mutation":
42900
- config2.mutation = type;
42903
+ config3.mutation = type;
42901
42904
  break;
42902
42905
  case "Subscription":
42903
- config2.subscription = type;
42906
+ config3.subscription = type;
42904
42907
  break;
42905
42908
  }
42906
42909
  }
42907
42910
  }
42908
- var directives = config2.directives;
42911
+ var directives = config3.directives;
42909
42912
  var _loop = function _loop2(_i42) {
42910
42913
  var stdDirective = _directives.specifiedDirectives[_i42];
42911
42914
  if (directives.every(function(directive) {
@@ -42917,7 +42920,7 @@ var require_buildASTSchema = __commonJS2({
42917
42920
  for (var _i4 = 0; _i4 < _directives.specifiedDirectives.length; _i4++) {
42918
42921
  _loop(_i4);
42919
42922
  }
42920
- return new _schema.GraphQLSchema(config2);
42923
+ return new _schema.GraphQLSchema(config3);
42921
42924
  }
42922
42925
  function buildSchema3(source, options) {
42923
42926
  var document = (0, _parser.parse)(source, {
@@ -43017,12 +43020,12 @@ var require_lexicographicSortSchema = __commonJS2({
43017
43020
  return maybeType && replaceNamedType(maybeType);
43018
43021
  }
43019
43022
  function sortDirective(directive) {
43020
- var config2 = directive.toConfig();
43021
- return new _directives.GraphQLDirective(_objectSpread(_objectSpread({}, config2), {}, {
43022
- locations: sortBy(config2.locations, function(x22) {
43023
+ var config3 = directive.toConfig();
43024
+ return new _directives.GraphQLDirective(_objectSpread(_objectSpread({}, config3), {}, {
43025
+ locations: sortBy(config3.locations, function(x22) {
43023
43026
  return x22;
43024
43027
  }),
43025
- args: sortArgs(config2.args)
43028
+ args: sortArgs(config3.args)
43026
43029
  }));
43027
43030
  }
43028
43031
  function sortArgs(args) {
@@ -43055,13 +43058,13 @@ var require_lexicographicSortSchema = __commonJS2({
43055
43058
  return type;
43056
43059
  }
43057
43060
  if ((0, _definition.isObjectType)(type)) {
43058
- var config2 = type.toConfig();
43059
- return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config2), {}, {
43061
+ var config3 = type.toConfig();
43062
+ return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config3), {}, {
43060
43063
  interfaces: function interfaces() {
43061
- return sortTypes(config2.interfaces);
43064
+ return sortTypes(config3.interfaces);
43062
43065
  },
43063
43066
  fields: function fields() {
43064
- return sortFields(config2.fields);
43067
+ return sortFields(config3.fields);
43065
43068
  }
43066
43069
  }));
43067
43070
  }
@@ -83866,13 +83869,13 @@ var require_esprima2 = __commonJS2({
83866
83869
  return Reader2;
83867
83870
  }();
83868
83871
  var Tokenizer = function() {
83869
- function Tokenizer2(code, config2) {
83872
+ function Tokenizer2(code, config3) {
83870
83873
  this.errorHandler = new error_handler_1.ErrorHandler();
83871
- this.errorHandler.tolerant = config2 ? typeof config2.tolerant === "boolean" && config2.tolerant : false;
83874
+ this.errorHandler.tolerant = config3 ? typeof config3.tolerant === "boolean" && config3.tolerant : false;
83872
83875
  this.scanner = new scanner_1.Scanner(code, this.errorHandler);
83873
- this.scanner.trackComment = config2 ? typeof config2.comment === "boolean" && config2.comment : false;
83874
- this.trackRange = config2 ? typeof config2.range === "boolean" && config2.range : false;
83875
- this.trackLoc = config2 ? typeof config2.loc === "boolean" && config2.loc : false;
83876
+ this.scanner.trackComment = config3 ? typeof config3.comment === "boolean" && config3.comment : false;
83877
+ this.trackRange = config3 ? typeof config3.range === "boolean" && config3.range : false;
83878
+ this.trackLoc = config3 ? typeof config3.loc === "boolean" && config3.loc : false;
83876
83879
  this.buffer = [];
83877
83880
  this.reader = new Reader();
83878
83881
  }
@@ -86022,11 +86025,11 @@ var require_printer2 = __commonJS2({
86022
86025
  return this.code;
86023
86026
  };
86024
86027
  var emptyPrintResult = new PrintResult("");
86025
- var Printer = function Printer2(config2) {
86028
+ var Printer = function Printer2(config3) {
86026
86029
  assert_1.default.ok(this instanceof Printer2);
86027
- var explicitTabWidth = config2 && config2.tabWidth;
86028
- config2 = options_1.normalize(config2);
86029
- config2.sourceFileName = null;
86030
+ var explicitTabWidth = config3 && config3.tabWidth;
86031
+ config3 = options_1.normalize(config3);
86032
+ config3.sourceFileName = null;
86030
86033
  function makePrintFunctionWith(options, overrides) {
86031
86034
  options = Object.assign({}, options, overrides);
86032
86035
  return function(path22) {
@@ -86041,19 +86044,19 @@ var require_printer2 = __commonJS2({
86041
86044
  includeComments: false
86042
86045
  }));
86043
86046
  }
86044
- var oldTabWidth = config2.tabWidth;
86047
+ var oldTabWidth = config3.tabWidth;
86045
86048
  if (!explicitTabWidth) {
86046
86049
  var loc = path22.getNode().loc;
86047
86050
  if (loc && loc.lines && loc.lines.guessTabWidth) {
86048
- config2.tabWidth = loc.lines.guessTabWidth();
86051
+ config3.tabWidth = loc.lines.guessTabWidth();
86049
86052
  }
86050
86053
  }
86051
86054
  var reprinter = patcher_1.getReprinter(path22);
86052
- var lines = reprinter ? reprinter(print5) : genericPrint(path22, config2, options, makePrintFunctionWith(options, {
86055
+ var lines = reprinter ? reprinter(print5) : genericPrint(path22, config3, options, makePrintFunctionWith(options, {
86053
86056
  includeComments: true,
86054
86057
  avoidRootParens: false
86055
86058
  }));
86056
- config2.tabWidth = oldTabWidth;
86059
+ config3.tabWidth = oldTabWidth;
86057
86060
  return lines;
86058
86061
  }
86059
86062
  this.print = function(ast) {
@@ -86064,7 +86067,7 @@ var require_printer2 = __commonJS2({
86064
86067
  includeComments: true,
86065
86068
  avoidRootParens: false
86066
86069
  });
86067
- return new PrintResult(lines.toString(config2), util.composeSourceMaps(config2.inputSourceMap, lines.getSourceMap(config2.sourceMapName, config2.sourceRoot)));
86070
+ return new PrintResult(lines.toString(config3), util.composeSourceMaps(config3.inputSourceMap, lines.getSourceMap(config3.sourceMapName, config3.sourceRoot)));
86068
86071
  };
86069
86072
  this.printGenerically = function(ast) {
86070
86073
  if (!ast) {
@@ -86072,26 +86075,26 @@ var require_printer2 = __commonJS2({
86072
86075
  }
86073
86076
  function printGenerically(path3) {
86074
86077
  return comments_1.printComments(path3, function(path4) {
86075
- return genericPrint(path4, config2, {
86078
+ return genericPrint(path4, config3, {
86076
86079
  includeComments: true,
86077
86080
  avoidRootParens: false
86078
86081
  }, printGenerically);
86079
86082
  });
86080
86083
  }
86081
86084
  var path22 = fast_path_1.default.from(ast);
86082
- var oldReuseWhitespace = config2.reuseWhitespace;
86083
- config2.reuseWhitespace = false;
86084
- var pr = new PrintResult(printGenerically(path22).toString(config2));
86085
- config2.reuseWhitespace = oldReuseWhitespace;
86085
+ var oldReuseWhitespace = config3.reuseWhitespace;
86086
+ config3.reuseWhitespace = false;
86087
+ var pr = new PrintResult(printGenerically(path22).toString(config3));
86088
+ config3.reuseWhitespace = oldReuseWhitespace;
86086
86089
  return pr;
86087
86090
  };
86088
86091
  };
86089
86092
  exports.Printer = Printer;
86090
- function genericPrint(path22, config2, options, printPath) {
86093
+ function genericPrint(path22, config3, options, printPath) {
86091
86094
  assert_1.default.ok(path22 instanceof fast_path_1.default);
86092
86095
  var node2 = path22.getValue();
86093
86096
  var parts = [];
86094
- var linesWithoutParens = genericPrintNoParens(path22, config2, printPath);
86097
+ var linesWithoutParens = genericPrintNoParens(path22, config3, printPath);
86095
86098
  if (!node2 || linesWithoutParens.isEmpty()) {
86096
86099
  return linesWithoutParens;
86097
86100
  }
@@ -88154,9 +88157,9 @@ var require_main2 = __commonJS2({
88154
88157
  }
88155
88158
  }
88156
88159
  });
88157
- async function runPipeline(config2, pipeline22, target) {
88160
+ async function runPipeline(config3, pipeline22, target) {
88158
88161
  for (const transform of pipeline22) {
88159
- await transform?.(config2, target);
88162
+ await transform?.(config3, target);
88160
88163
  }
88161
88164
  }
88162
88165
  var import_graphql16 = __toESM2(require_graphql2(), 1);
@@ -88500,6 +88503,18 @@ function deepEquals(objA, objB, map = /* @__PURE__ */ new WeakMap()) {
88500
88503
  }
88501
88504
  return true;
88502
88505
  }
88506
+ function getFieldsForType(selection, __typename) {
88507
+ let targetSelection = selection.fields || {};
88508
+ if (selection.abstractFields && __typename) {
88509
+ const mappedType = selection.abstractFields.typeMap[__typename];
88510
+ if (mappedType) {
88511
+ targetSelection = selection.abstractFields.fields[mappedType];
88512
+ } else if (selection.abstractFields.fields[__typename]) {
88513
+ targetSelection = selection.abstractFields.fields[__typename];
88514
+ }
88515
+ }
88516
+ return targetSelection;
88517
+ }
88503
88518
  var GarbageCollector = class {
88504
88519
  cache;
88505
88520
  lifetimes = /* @__PURE__ */ new Map();
@@ -88717,23 +88732,32 @@ var List = class {
88717
88732
  let insertData = data2;
88718
88733
  if (this.connection) {
88719
88734
  insertSelection = {
88720
- newEntry: {
88721
- keyRaw: this.key,
88722
- type: "Connection",
88723
- fields: {
88724
- edges: {
88725
- keyRaw: "edges",
88726
- type: "ConnectionEdge",
88727
- update: where === "first" ? "prepend" : "append",
88735
+ fields: {
88736
+ newEntry: {
88737
+ keyRaw: this.key,
88738
+ type: "Connection",
88739
+ selection: {
88728
88740
  fields: {
88729
- node: {
88730
- type: listType,
88731
- keyRaw: "node",
88732
- fields: {
88733
- ...selection,
88734
- __typename: {
88735
- keyRaw: "__typename",
88736
- type: "String"
88741
+ edges: {
88742
+ keyRaw: "edges",
88743
+ type: "ConnectionEdge",
88744
+ update: where === "first" ? "prepend" : "append",
88745
+ selection: {
88746
+ fields: {
88747
+ node: {
88748
+ type: listType,
88749
+ keyRaw: "node",
88750
+ selection: {
88751
+ ...selection,
88752
+ fields: {
88753
+ ...selection.fields,
88754
+ __typename: {
88755
+ keyRaw: "__typename",
88756
+ type: "String"
88757
+ }
88758
+ }
88759
+ }
88760
+ }
88737
88761
  }
88738
88762
  }
88739
88763
  }
@@ -88749,15 +88773,20 @@ var List = class {
88749
88773
  };
88750
88774
  } else {
88751
88775
  insertSelection = {
88752
- newEntries: {
88753
- keyRaw: this.key,
88754
- type: listType,
88755
- update: where === "first" ? "prepend" : "append",
88756
- fields: {
88757
- ...selection,
88758
- __typename: {
88759
- keyRaw: "__typename",
88760
- type: "String"
88776
+ fields: {
88777
+ newEntries: {
88778
+ keyRaw: this.key,
88779
+ type: listType,
88780
+ update: where === "first" ? "prepend" : "append",
88781
+ selection: {
88782
+ ...selection,
88783
+ fields: {
88784
+ ...selection.fields,
88785
+ __typename: {
88786
+ keyRaw: "__typename",
88787
+ type: "String"
88788
+ }
88789
+ }
88761
88790
  }
88762
88791
  }
88763
88792
  }
@@ -88817,7 +88846,7 @@ var List = class {
88817
88846
  const subscribers = this.cache._internal_unstable.subscriptions.get(this.recordID, this.key);
88818
88847
  this.cache._internal_unstable.subscriptions.remove(
88819
88848
  targetID,
88820
- this.connection ? this.selection.edges.fields : this.selection,
88849
+ this.connection ? this.selection.fields.edges.selection : this.selection,
88821
88850
  subscribers,
88822
88851
  variables
88823
88852
  );
@@ -89302,18 +89331,20 @@ var InMemorySubscriptions = class {
89302
89331
  variables,
89303
89332
  parentType
89304
89333
  }) {
89305
- for (const fieldSelection of Object.values(selection)) {
89306
- const { keyRaw, fields, type } = fieldSelection;
89334
+ const __typename = this.cache._internal_unstable.storage.get(parent, "__typename").value;
89335
+ let targetSelection = getFieldsForType(selection, __typename);
89336
+ for (const fieldSelection of Object.values(targetSelection || {})) {
89337
+ const { keyRaw, selection: innerSelection, type } = fieldSelection;
89307
89338
  const key = evaluateKey(keyRaw, variables);
89308
89339
  this.addFieldSubscription({
89309
89340
  id: parent,
89310
89341
  key,
89311
- selection: fieldSelection,
89342
+ field: fieldSelection,
89312
89343
  spec,
89313
89344
  parentType: parentType || spec.rootType,
89314
89345
  variables
89315
89346
  });
89316
- if (fields) {
89347
+ if (innerSelection) {
89317
89348
  const { value: linkedRecord } = this.cache._internal_unstable.storage.get(
89318
89349
  parent,
89319
89350
  key
@@ -89326,7 +89357,7 @@ var InMemorySubscriptions = class {
89326
89357
  this.add({
89327
89358
  parent: child,
89328
89359
  spec,
89329
- selection: fields,
89360
+ selection: innerSelection,
89330
89361
  variables,
89331
89362
  parentType: type
89332
89363
  });
@@ -89337,7 +89368,7 @@ var InMemorySubscriptions = class {
89337
89368
  addFieldSubscription({
89338
89369
  id: id2,
89339
89370
  key,
89340
- selection,
89371
+ field,
89341
89372
  spec,
89342
89373
  parentType,
89343
89374
  variables
@@ -89364,8 +89395,8 @@ var InMemorySubscriptions = class {
89364
89395
  const counts = this.referenceCounts[id2][key];
89365
89396
  counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
89366
89397
  this.cache._internal_unstable.lifetimes.resetLifetime(id2, key);
89367
- const { fields, list, filters } = selection;
89368
- if (fields && list) {
89398
+ const { selection, list, filters } = field;
89399
+ if (selection && list) {
89369
89400
  this.cache._internal_unstable.lists.add({
89370
89401
  name: list.name,
89371
89402
  connection: list.connection,
@@ -89373,7 +89404,7 @@ var InMemorySubscriptions = class {
89373
89404
  recordType: this.cache._internal_unstable.storage.get(id2, "__typename")?.value || parentType,
89374
89405
  listType: list.type,
89375
89406
  key,
89376
- selection: fields,
89407
+ selection,
89377
89408
  filters: Object.entries(filters || {}).reduce((acc, [key2, { kind, value: value2 }]) => {
89378
89409
  return {
89379
89410
  ...acc,
@@ -89390,20 +89421,21 @@ var InMemorySubscriptions = class {
89390
89421
  subscribers,
89391
89422
  parentType
89392
89423
  }) {
89393
- for (const fieldSelection of Object.values(selection)) {
89394
- const { type: linkedType, keyRaw, fields } = fieldSelection;
89424
+ let targetSelection = getFieldsForType(selection, parentType);
89425
+ for (const fieldSelection of Object.values(targetSelection)) {
89426
+ const { type: linkedType, keyRaw, selection: innerSelection } = fieldSelection;
89395
89427
  const key = evaluateKey(keyRaw, variables);
89396
89428
  for (const spec of subscribers) {
89397
89429
  this.addFieldSubscription({
89398
89430
  id: parent,
89399
89431
  key,
89400
- selection: fieldSelection,
89432
+ field: fieldSelection,
89401
89433
  spec,
89402
89434
  parentType,
89403
89435
  variables
89404
89436
  });
89405
89437
  }
89406
- if (fields) {
89438
+ if (innerSelection) {
89407
89439
  const { value: link } = this.cache._internal_unstable.storage.get(parent, key);
89408
89440
  const children = !Array.isArray(link) ? [link] : flattenList(link);
89409
89441
  for (const linkedRecord of children) {
@@ -89412,7 +89444,7 @@ var InMemorySubscriptions = class {
89412
89444
  }
89413
89445
  this.addMany({
89414
89446
  parent: linkedRecord,
89415
- selection: fields,
89447
+ selection: innerSelection,
89416
89448
  variables,
89417
89449
  subscribers,
89418
89450
  parentType: linkedType
@@ -89424,22 +89456,20 @@ var InMemorySubscriptions = class {
89424
89456
  get(id2, field) {
89425
89457
  return this.subscribers[id2]?.[field] || [];
89426
89458
  }
89427
- remove(id2, fields, targets, variables, visited = []) {
89459
+ remove(id2, selection, targets, variables, visited = []) {
89428
89460
  visited.push(id2);
89429
89461
  const linkedIDs = [];
89430
- for (const selection of Object.values(fields)) {
89431
- const key = evaluateKey(selection.keyRaw, variables);
89462
+ for (const fieldSelection of Object.values(selection.fields || {})) {
89463
+ const key = evaluateKey(fieldSelection.keyRaw, variables);
89432
89464
  this.removeSubscribers(id2, key, targets);
89433
- if (!selection.fields) {
89465
+ if (!fieldSelection.selection?.fields) {
89434
89466
  continue;
89435
89467
  }
89436
- if (selection.list) {
89437
- }
89438
89468
  const { value: previousValue } = this.cache._internal_unstable.storage.get(id2, key);
89439
89469
  const links = !Array.isArray(previousValue) ? [previousValue] : flattenList(previousValue);
89440
89470
  for (const link of links) {
89441
89471
  if (link !== null) {
89442
- linkedIDs.push([link, selection.fields]);
89472
+ linkedIDs.push([link, fieldSelection.selection || {}]);
89443
89473
  }
89444
89474
  }
89445
89475
  }
@@ -89488,7 +89518,7 @@ var InMemorySubscriptions = class {
89488
89518
  };
89489
89519
  var Cache2 = class {
89490
89520
  _internal_unstable;
89491
- constructor(config2) {
89521
+ constructor(config3) {
89492
89522
  this._internal_unstable = new CacheInternal({
89493
89523
  cache: this,
89494
89524
  storage: new InMemoryStorage(),
@@ -89496,8 +89526,8 @@ var Cache2 = class {
89496
89526
  lists: new ListManager(this, rootID),
89497
89527
  lifetimes: new GarbageCollector(this)
89498
89528
  });
89499
- if (config2) {
89500
- this.setConfig(defaultConfigValues(config2));
89529
+ if (config3) {
89530
+ this.setConfig(defaultConfigValues(config3));
89501
89531
  }
89502
89532
  }
89503
89533
  write({
@@ -89562,8 +89592,8 @@ var Cache2 = class {
89562
89592
  this._internal_unstable.lists.removeIDFromAllLists(id2);
89563
89593
  this._internal_unstable.storage.delete(id2);
89564
89594
  }
89565
- setConfig(config2) {
89566
- this._internal_unstable.setConfig(config2);
89595
+ setConfig(config3) {
89596
+ this._internal_unstable.setConfig(config3);
89567
89597
  }
89568
89598
  };
89569
89599
  var CacheInternal = class {
@@ -89598,8 +89628,8 @@ var CacheInternal = class {
89598
89628
  this._disabled = typeof globalThis.window === "undefined";
89599
89629
  }
89600
89630
  }
89601
- setConfig(config2) {
89602
- this.config = config2;
89631
+ setConfig(config3) {
89632
+ this.config = config3;
89603
89633
  }
89604
89634
  writeSelection({
89605
89635
  data: data2,
@@ -89615,8 +89645,9 @@ var CacheInternal = class {
89615
89645
  if (this._disabled) {
89616
89646
  return [];
89617
89647
  }
89648
+ let targetSelection = getFieldsForType(selection, data2["__typename"]);
89618
89649
  for (const [field, value2] of Object.entries(data2)) {
89619
- if (!selection || !selection[field]) {
89650
+ if (!selection || !targetSelection[field]) {
89620
89651
  throw new Error(
89621
89652
  "Could not find field listing in selection for " + field + " @ " + JSON.stringify(selection)
89622
89653
  );
@@ -89624,11 +89655,11 @@ var CacheInternal = class {
89624
89655
  let {
89625
89656
  type: linkedType,
89626
89657
  keyRaw,
89627
- fields,
89658
+ selection: fieldSelection,
89628
89659
  operations,
89629
89660
  abstract: isAbstract,
89630
89661
  update
89631
- } = selection[field];
89662
+ } = targetSelection[field];
89632
89663
  const key = evaluateKey(keyRaw, variables);
89633
89664
  const currentSubscribers = this.subscriptions.get(parent, key);
89634
89665
  const { value: previousValue, displayLayers } = this.storage.get(parent, key);
@@ -89636,7 +89667,7 @@ var CacheInternal = class {
89636
89667
  if (displayLayer) {
89637
89668
  this.lifetimes.resetLifetime(parent, key);
89638
89669
  }
89639
- if (!fields) {
89670
+ if (!fieldSelection) {
89640
89671
  let newValue = value2;
89641
89672
  if (Array.isArray(value2) && applyUpdates && update) {
89642
89673
  if (update === "append") {
@@ -89656,7 +89687,7 @@ var CacheInternal = class {
89656
89687
  }
89657
89688
  const previousLinks = flattenList([previousValue]);
89658
89689
  for (const link of previousLinks) {
89659
- this.subscriptions.remove(link, fields, currentSubscribers, variables);
89690
+ this.subscriptions.remove(link, fieldSelection, currentSubscribers, variables);
89660
89691
  }
89661
89692
  layer.writeLink(parent, key, null);
89662
89693
  toNotify.push(...currentSubscribers);
@@ -89682,14 +89713,14 @@ var CacheInternal = class {
89682
89713
  if (previousValue && typeof previousValue === "string") {
89683
89714
  this.subscriptions.remove(
89684
89715
  previousValue,
89685
- fields,
89716
+ fieldSelection,
89686
89717
  currentSubscribers,
89687
89718
  variables
89688
89719
  );
89689
89720
  }
89690
89721
  this.subscriptions.addMany({
89691
89722
  parent: linkedID,
89692
- selection: fields,
89723
+ selection: fieldSelection,
89693
89724
  subscribers: currentSubscribers,
89694
89725
  variables,
89695
89726
  parentType: linkedType
@@ -89699,14 +89730,14 @@ var CacheInternal = class {
89699
89730
  if (linkedID) {
89700
89731
  this.writeSelection({
89701
89732
  root,
89702
- selection: fields,
89733
+ selection: fieldSelection,
89703
89734
  parent: linkedID,
89704
89735
  data: value2,
89705
89736
  variables,
89706
89737
  toNotify,
89707
89738
  applyUpdates,
89708
89739
  layer,
89709
- forceNotify: true
89740
+ forceNotify
89710
89741
  });
89711
89742
  }
89712
89743
  } else if (Array.isArray(value2) && (typeof previousValue === "undefined" || Array.isArray(previousValue))) {
@@ -89735,7 +89766,7 @@ var CacheInternal = class {
89735
89766
  key,
89736
89767
  linkedType,
89737
89768
  variables,
89738
- fields,
89769
+ fields: fieldSelection,
89739
89770
  layer,
89740
89771
  forceNotify
89741
89772
  });
@@ -89785,7 +89816,7 @@ var CacheInternal = class {
89785
89816
  if (linkedIDs.includes(lostID) || !lostID) {
89786
89817
  continue;
89787
89818
  }
89788
- this.subscriptions.remove(lostID, fields, currentSubscribers, variables);
89819
+ this.subscriptions.remove(lostID, fieldSelection, currentSubscribers, variables);
89789
89820
  }
89790
89821
  if (contentChanged || oldIDs.length === 0 && newIDs.length === 0) {
89791
89822
  layer.writeLink(parent, key, linkedIDs);
@@ -89796,7 +89827,7 @@ var CacheInternal = class {
89796
89827
  }
89797
89828
  this.subscriptions.addMany({
89798
89829
  parent: id2,
89799
- selection: fields,
89830
+ selection: fieldSelection,
89800
89831
  subscribers: currentSubscribers,
89801
89832
  variables,
89802
89833
  parentType: linkedType
@@ -89821,9 +89852,14 @@ var CacheInternal = class {
89821
89852
  }
89822
89853
  const targets = Array.isArray(value2) ? value2 : [value2];
89823
89854
  for (const target of targets) {
89824
- if (operation.action === "insert" && target instanceof Object && fields && operation.list) {
89825
- this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(fields, target, variables, operation.position || "last");
89826
- } else if (operation.action === "remove" && target instanceof Object && fields && operation.list) {
89855
+ if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
89856
+ this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(
89857
+ fieldSelection,
89858
+ target,
89859
+ variables,
89860
+ operation.position || "last"
89861
+ );
89862
+ } else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
89827
89863
  this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
89828
89864
  } else if (operation.action === "delete" && operation.type) {
89829
89865
  if (typeof target !== "string") {
@@ -89834,8 +89870,13 @@ var CacheInternal = class {
89834
89870
  continue;
89835
89871
  }
89836
89872
  this.cache.delete(targetID);
89837
- } else if (operation.action === "toggle" && target instanceof Object && fields && operation.list) {
89838
- this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
89873
+ } else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
89874
+ this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(
89875
+ fieldSelection,
89876
+ target,
89877
+ variables,
89878
+ operation.position || "last"
89879
+ );
89839
89880
  }
89840
89881
  }
89841
89882
  }
@@ -89855,9 +89896,12 @@ var CacheInternal = class {
89855
89896
  let hasData = false;
89856
89897
  let partial = false;
89857
89898
  let cascadeNull = false;
89858
- for (const [attributeName, { type, keyRaw, fields, nullable, list }] of Object.entries(
89859
- selection
89860
- )) {
89899
+ const typename = this.storage.get(parent, "__typename").value;
89900
+ let targetSelection = getFieldsForType(selection, typename);
89901
+ for (const [
89902
+ attributeName,
89903
+ { type, keyRaw, selection: fieldSelection, nullable, list }
89904
+ ] of Object.entries(targetSelection)) {
89861
89905
  const key = evaluateKey(keyRaw, variables);
89862
89906
  const { value: value2 } = this.storage.get(parent, key);
89863
89907
  let nextStep = stepsFromConnection;
@@ -89880,7 +89924,7 @@ var CacheInternal = class {
89880
89924
  if (typeof value2 !== "undefined") {
89881
89925
  hasData = true;
89882
89926
  }
89883
- } else if (!fields) {
89927
+ } else if (!fieldSelection) {
89884
89928
  const fnUnmarshal = this.config?.scalars?.[type]?.unmarshal;
89885
89929
  if (fnUnmarshal) {
89886
89930
  target[attributeName] = fnUnmarshal(value2);
@@ -89890,7 +89934,7 @@ var CacheInternal = class {
89890
89934
  hasData = true;
89891
89935
  } else if (Array.isArray(value2)) {
89892
89936
  const listValue = this.hydrateNestedList({
89893
- fields,
89937
+ fields: fieldSelection,
89894
89938
  variables,
89895
89939
  linkedList: value2,
89896
89940
  stepsFromConnection: nextStep
@@ -89905,7 +89949,7 @@ var CacheInternal = class {
89905
89949
  } else {
89906
89950
  const objectFields = this.getSelection({
89907
89951
  parent: value2,
89908
- selection: fields,
89952
+ selection: fieldSelection,
89909
89953
  variables,
89910
89954
  stepsFromConnection: nextStep
89911
89955
  });
@@ -91148,7 +91192,7 @@ async function asyncWalk(ast, { enter, leave }) {
91148
91192
  return await instance.visit(ast, null);
91149
91193
  }
91150
91194
  var graphql4 = __toESM2(require_graphql2(), 1);
91151
- async function find_graphql(config2, parsedScript, walker) {
91195
+ async function find_graphql(config3, parsedScript, walker) {
91152
91196
  await asyncWalk(parsedScript, {
91153
91197
  async enter(node2, parent) {
91154
91198
  if (node2.type === "TaggedTemplateExpression" && node2.tag.name === "graphql") {
@@ -91158,7 +91202,7 @@ async function find_graphql(config2, parsedScript, walker) {
91158
91202
  if (walker.where && !walker.where(parsedTag)) {
91159
91203
  return;
91160
91204
  }
91161
- const definition = config2.extractDefinition(parsedTag);
91205
+ const definition = config3.extractDefinition(parsedTag);
91162
91206
  const name2 = definition.name?.value;
91163
91207
  if (!name2) {
91164
91208
  throw new Error("Could not find definition name");
@@ -91175,7 +91219,7 @@ async function find_graphql(config2, parsedScript, walker) {
91175
91219
  kind = CompiledSubscriptionKind;
91176
91220
  }
91177
91221
  }
91178
- walker.dependency?.(config2.artifactPath(parsedTag));
91222
+ walker.dependency?.(config3.artifactPath(parsedTag));
91179
91223
  await walker.tag({
91180
91224
  parsedDocument: parsedTag,
91181
91225
  node: {
@@ -97876,7 +97920,7 @@ var require_definition3 = __commonJS3({
97876
97920
  exports.assertObjectType = assertObjectType;
97877
97921
  exports.isInterfaceType = isInterfaceType12;
97878
97922
  exports.assertInterfaceType = assertInterfaceType;
97879
- exports.isUnionType = isUnionType12;
97923
+ exports.isUnionType = isUnionType13;
97880
97924
  exports.assertUnionType = assertUnionType;
97881
97925
  exports.isEnumType = isEnumType9;
97882
97926
  exports.assertEnumType = assertEnumType;
@@ -97894,7 +97938,7 @@ var require_definition3 = __commonJS3({
97894
97938
  exports.assertLeafType = assertLeafType;
97895
97939
  exports.isCompositeType = isCompositeType;
97896
97940
  exports.assertCompositeType = assertCompositeType;
97897
- exports.isAbstractType = isAbstractType;
97941
+ exports.isAbstractType = isAbstractType2;
97898
97942
  exports.assertAbstractType = assertAbstractType;
97899
97943
  exports.GraphQLList = GraphQLList6;
97900
97944
  exports.GraphQLNonNull = GraphQLNonNull6;
@@ -97949,7 +97993,7 @@ var require_definition3 = __commonJS3({
97949
97993
  return Constructor;
97950
97994
  }
97951
97995
  function isType(type) {
97952
- return isScalarType12(type) || isObjectType11(type) || isInterfaceType12(type) || isUnionType12(type) || isEnumType9(type) || isInputObjectType7(type) || isListType8(type) || isNonNullType10(type);
97996
+ return isScalarType12(type) || isObjectType11(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType9(type) || isInputObjectType7(type) || isListType8(type) || isNonNullType10(type);
97953
97997
  }
97954
97998
  function assertType(type) {
97955
97999
  if (!isType(type)) {
@@ -97984,11 +98028,11 @@ var require_definition3 = __commonJS3({
97984
98028
  }
97985
98029
  return type;
97986
98030
  }
97987
- function isUnionType12(type) {
98031
+ function isUnionType13(type) {
97988
98032
  return (0, _instanceOf.default)(type, GraphQLUnionType3);
97989
98033
  }
97990
98034
  function assertUnionType(type) {
97991
- if (!isUnionType12(type)) {
98035
+ if (!isUnionType13(type)) {
97992
98036
  throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Union type."));
97993
98037
  }
97994
98038
  return type;
@@ -98039,7 +98083,7 @@ var require_definition3 = __commonJS3({
98039
98083
  return type;
98040
98084
  }
98041
98085
  function isOutputType(type) {
98042
- return isScalarType12(type) || isObjectType11(type) || isInterfaceType12(type) || isUnionType12(type) || isEnumType9(type) || isWrappingType(type) && isOutputType(type.ofType);
98086
+ return isScalarType12(type) || isObjectType11(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType9(type) || isWrappingType(type) && isOutputType(type.ofType);
98043
98087
  }
98044
98088
  function assertOutputType(type) {
98045
98089
  if (!isOutputType(type)) {
@@ -98057,7 +98101,7 @@ var require_definition3 = __commonJS3({
98057
98101
  return type;
98058
98102
  }
98059
98103
  function isCompositeType(type) {
98060
- return isObjectType11(type) || isInterfaceType12(type) || isUnionType12(type);
98104
+ return isObjectType11(type) || isInterfaceType12(type) || isUnionType13(type);
98061
98105
  }
98062
98106
  function assertCompositeType(type) {
98063
98107
  if (!isCompositeType(type)) {
@@ -98065,11 +98109,11 @@ var require_definition3 = __commonJS3({
98065
98109
  }
98066
98110
  return type;
98067
98111
  }
98068
- function isAbstractType(type) {
98069
- return isInterfaceType12(type) || isUnionType12(type);
98112
+ function isAbstractType2(type) {
98113
+ return isInterfaceType12(type) || isUnionType13(type);
98070
98114
  }
98071
98115
  function assertAbstractType(type) {
98072
- if (!isAbstractType(type)) {
98116
+ if (!isAbstractType2(type)) {
98073
98117
  throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL abstract type."));
98074
98118
  }
98075
98119
  return type;
@@ -98136,7 +98180,7 @@ var require_definition3 = __commonJS3({
98136
98180
  }
98137
98181
  }
98138
98182
  function isNamedType4(type) {
98139
- return isScalarType12(type) || isObjectType11(type) || isInterfaceType12(type) || isUnionType12(type) || isEnumType9(type) || isInputObjectType7(type);
98183
+ return isScalarType12(type) || isObjectType11(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType9(type) || isInputObjectType7(type);
98140
98184
  }
98141
98185
  function assertNamedType(type) {
98142
98186
  if (!isNamedType4(type)) {
@@ -151572,6 +151616,18 @@ function deepEquals2(objA, objB, map = /* @__PURE__ */ new WeakMap()) {
151572
151616
  }
151573
151617
  return true;
151574
151618
  }
151619
+ function getFieldsForType2(selection2, __typename) {
151620
+ let targetSelection = selection2.fields || {};
151621
+ if (selection2.abstractFields && __typename) {
151622
+ const mappedType = selection2.abstractFields.typeMap[__typename];
151623
+ if (mappedType) {
151624
+ targetSelection = selection2.abstractFields.fields[mappedType];
151625
+ } else if (selection2.abstractFields.fields[__typename]) {
151626
+ targetSelection = selection2.abstractFields.fields[__typename];
151627
+ }
151628
+ }
151629
+ return targetSelection;
151630
+ }
151575
151631
  var GarbageCollector2 = class {
151576
151632
  cache;
151577
151633
  lifetimes = /* @__PURE__ */ new Map();
@@ -151789,23 +151845,32 @@ var List2 = class {
151789
151845
  let insertData = data2;
151790
151846
  if (this.connection) {
151791
151847
  insertSelection = {
151792
- newEntry: {
151793
- keyRaw: this.key,
151794
- type: "Connection",
151795
- fields: {
151796
- edges: {
151797
- keyRaw: "edges",
151798
- type: "ConnectionEdge",
151799
- update: where === "first" ? "prepend" : "append",
151848
+ fields: {
151849
+ newEntry: {
151850
+ keyRaw: this.key,
151851
+ type: "Connection",
151852
+ selection: {
151800
151853
  fields: {
151801
- node: {
151802
- type: listType,
151803
- keyRaw: "node",
151804
- fields: {
151805
- ...selection2,
151806
- __typename: {
151807
- keyRaw: "__typename",
151808
- type: "String"
151854
+ edges: {
151855
+ keyRaw: "edges",
151856
+ type: "ConnectionEdge",
151857
+ update: where === "first" ? "prepend" : "append",
151858
+ selection: {
151859
+ fields: {
151860
+ node: {
151861
+ type: listType,
151862
+ keyRaw: "node",
151863
+ selection: {
151864
+ ...selection2,
151865
+ fields: {
151866
+ ...selection2.fields,
151867
+ __typename: {
151868
+ keyRaw: "__typename",
151869
+ type: "String"
151870
+ }
151871
+ }
151872
+ }
151873
+ }
151809
151874
  }
151810
151875
  }
151811
151876
  }
@@ -151821,15 +151886,20 @@ var List2 = class {
151821
151886
  };
151822
151887
  } else {
151823
151888
  insertSelection = {
151824
- newEntries: {
151825
- keyRaw: this.key,
151826
- type: listType,
151827
- update: where === "first" ? "prepend" : "append",
151828
- fields: {
151829
- ...selection2,
151830
- __typename: {
151831
- keyRaw: "__typename",
151832
- type: "String"
151889
+ fields: {
151890
+ newEntries: {
151891
+ keyRaw: this.key,
151892
+ type: listType,
151893
+ update: where === "first" ? "prepend" : "append",
151894
+ selection: {
151895
+ ...selection2,
151896
+ fields: {
151897
+ ...selection2.fields,
151898
+ __typename: {
151899
+ keyRaw: "__typename",
151900
+ type: "String"
151901
+ }
151902
+ }
151833
151903
  }
151834
151904
  }
151835
151905
  }
@@ -151889,7 +151959,7 @@ var List2 = class {
151889
151959
  const subscribers = this.cache._internal_unstable.subscriptions.get(this.recordID, this.key);
151890
151960
  this.cache._internal_unstable.subscriptions.remove(
151891
151961
  targetID,
151892
- this.connection ? this.selection.edges.fields : this.selection,
151962
+ this.connection ? this.selection.fields.edges.selection : this.selection,
151893
151963
  subscribers,
151894
151964
  variables
151895
151965
  );
@@ -152374,18 +152444,20 @@ var InMemorySubscriptions2 = class {
152374
152444
  variables,
152375
152445
  parentType
152376
152446
  }) {
152377
- for (const fieldSelection of Object.values(selection2)) {
152378
- const { keyRaw, fields, type } = fieldSelection;
152447
+ const __typename = this.cache._internal_unstable.storage.get(parent, "__typename").value;
152448
+ let targetSelection = getFieldsForType2(selection2, __typename);
152449
+ for (const fieldSelection of Object.values(targetSelection || {})) {
152450
+ const { keyRaw, selection: innerSelection, type } = fieldSelection;
152379
152451
  const key = evaluateKey2(keyRaw, variables);
152380
152452
  this.addFieldSubscription({
152381
152453
  id: parent,
152382
152454
  key,
152383
- selection: fieldSelection,
152455
+ field: fieldSelection,
152384
152456
  spec,
152385
152457
  parentType: parentType || spec.rootType,
152386
152458
  variables
152387
152459
  });
152388
- if (fields) {
152460
+ if (innerSelection) {
152389
152461
  const { value: linkedRecord } = this.cache._internal_unstable.storage.get(
152390
152462
  parent,
152391
152463
  key
@@ -152398,7 +152470,7 @@ var InMemorySubscriptions2 = class {
152398
152470
  this.add({
152399
152471
  parent: child,
152400
152472
  spec,
152401
- selection: fields,
152473
+ selection: innerSelection,
152402
152474
  variables,
152403
152475
  parentType: type
152404
152476
  });
@@ -152409,7 +152481,7 @@ var InMemorySubscriptions2 = class {
152409
152481
  addFieldSubscription({
152410
152482
  id: id2,
152411
152483
  key,
152412
- selection: selection2,
152484
+ field,
152413
152485
  spec,
152414
152486
  parentType,
152415
152487
  variables
@@ -152436,8 +152508,8 @@ var InMemorySubscriptions2 = class {
152436
152508
  const counts = this.referenceCounts[id2][key];
152437
152509
  counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
152438
152510
  this.cache._internal_unstable.lifetimes.resetLifetime(id2, key);
152439
- const { fields, list, filters } = selection2;
152440
- if (fields && list) {
152511
+ const { selection: selection2, list, filters } = field;
152512
+ if (selection2 && list) {
152441
152513
  this.cache._internal_unstable.lists.add({
152442
152514
  name: list.name,
152443
152515
  connection: list.connection,
@@ -152445,7 +152517,7 @@ var InMemorySubscriptions2 = class {
152445
152517
  recordType: this.cache._internal_unstable.storage.get(id2, "__typename")?.value || parentType,
152446
152518
  listType: list.type,
152447
152519
  key,
152448
- selection: fields,
152520
+ selection: selection2,
152449
152521
  filters: Object.entries(filters || {}).reduce((acc, [key2, { kind, value: value2 }]) => {
152450
152522
  return {
152451
152523
  ...acc,
@@ -152462,20 +152534,21 @@ var InMemorySubscriptions2 = class {
152462
152534
  subscribers,
152463
152535
  parentType
152464
152536
  }) {
152465
- for (const fieldSelection of Object.values(selection2)) {
152466
- const { type: linkedType, keyRaw, fields } = fieldSelection;
152537
+ let targetSelection = getFieldsForType2(selection2, parentType);
152538
+ for (const fieldSelection of Object.values(targetSelection)) {
152539
+ const { type: linkedType, keyRaw, selection: innerSelection } = fieldSelection;
152467
152540
  const key = evaluateKey2(keyRaw, variables);
152468
152541
  for (const spec of subscribers) {
152469
152542
  this.addFieldSubscription({
152470
152543
  id: parent,
152471
152544
  key,
152472
- selection: fieldSelection,
152545
+ field: fieldSelection,
152473
152546
  spec,
152474
152547
  parentType,
152475
152548
  variables
152476
152549
  });
152477
152550
  }
152478
- if (fields) {
152551
+ if (innerSelection) {
152479
152552
  const { value: link } = this.cache._internal_unstable.storage.get(parent, key);
152480
152553
  const children = !Array.isArray(link) ? [link] : flattenList2(link);
152481
152554
  for (const linkedRecord of children) {
@@ -152484,7 +152557,7 @@ var InMemorySubscriptions2 = class {
152484
152557
  }
152485
152558
  this.addMany({
152486
152559
  parent: linkedRecord,
152487
- selection: fields,
152560
+ selection: innerSelection,
152488
152561
  variables,
152489
152562
  subscribers,
152490
152563
  parentType: linkedType
@@ -152496,22 +152569,20 @@ var InMemorySubscriptions2 = class {
152496
152569
  get(id2, field) {
152497
152570
  return this.subscribers[id2]?.[field] || [];
152498
152571
  }
152499
- remove(id2, fields, targets, variables, visited = []) {
152572
+ remove(id2, selection2, targets, variables, visited = []) {
152500
152573
  visited.push(id2);
152501
152574
  const linkedIDs = [];
152502
- for (const selection2 of Object.values(fields)) {
152503
- const key = evaluateKey2(selection2.keyRaw, variables);
152575
+ for (const fieldSelection of Object.values(selection2.fields || {})) {
152576
+ const key = evaluateKey2(fieldSelection.keyRaw, variables);
152504
152577
  this.removeSubscribers(id2, key, targets);
152505
- if (!selection2.fields) {
152578
+ if (!fieldSelection.selection?.fields) {
152506
152579
  continue;
152507
152580
  }
152508
- if (selection2.list) {
152509
- }
152510
152581
  const { value: previousValue } = this.cache._internal_unstable.storage.get(id2, key);
152511
152582
  const links = !Array.isArray(previousValue) ? [previousValue] : flattenList2(previousValue);
152512
152583
  for (const link of links) {
152513
152584
  if (link !== null) {
152514
- linkedIDs.push([link, selection2.fields]);
152585
+ linkedIDs.push([link, fieldSelection.selection || {}]);
152515
152586
  }
152516
152587
  }
152517
152588
  }
@@ -152687,8 +152758,9 @@ var CacheInternal2 = class {
152687
152758
  if (this._disabled) {
152688
152759
  return [];
152689
152760
  }
152761
+ let targetSelection = getFieldsForType2(selection2, data2["__typename"]);
152690
152762
  for (const [field, value2] of Object.entries(data2)) {
152691
- if (!selection2 || !selection2[field]) {
152763
+ if (!selection2 || !targetSelection[field]) {
152692
152764
  throw new Error(
152693
152765
  "Could not find field listing in selection for " + field + " @ " + JSON.stringify(selection2)
152694
152766
  );
@@ -152696,11 +152768,11 @@ var CacheInternal2 = class {
152696
152768
  let {
152697
152769
  type: linkedType,
152698
152770
  keyRaw,
152699
- fields,
152771
+ selection: fieldSelection,
152700
152772
  operations,
152701
152773
  abstract: isAbstract,
152702
152774
  update
152703
- } = selection2[field];
152775
+ } = targetSelection[field];
152704
152776
  const key = evaluateKey2(keyRaw, variables);
152705
152777
  const currentSubscribers = this.subscriptions.get(parent, key);
152706
152778
  const { value: previousValue, displayLayers } = this.storage.get(parent, key);
@@ -152708,7 +152780,7 @@ var CacheInternal2 = class {
152708
152780
  if (displayLayer) {
152709
152781
  this.lifetimes.resetLifetime(parent, key);
152710
152782
  }
152711
- if (!fields) {
152783
+ if (!fieldSelection) {
152712
152784
  let newValue = value2;
152713
152785
  if (Array.isArray(value2) && applyUpdates && update) {
152714
152786
  if (update === "append") {
@@ -152728,7 +152800,7 @@ var CacheInternal2 = class {
152728
152800
  }
152729
152801
  const previousLinks = flattenList2([previousValue]);
152730
152802
  for (const link of previousLinks) {
152731
- this.subscriptions.remove(link, fields, currentSubscribers, variables);
152803
+ this.subscriptions.remove(link, fieldSelection, currentSubscribers, variables);
152732
152804
  }
152733
152805
  layer.writeLink(parent, key, null);
152734
152806
  toNotify.push(...currentSubscribers);
@@ -152754,14 +152826,14 @@ var CacheInternal2 = class {
152754
152826
  if (previousValue && typeof previousValue === "string") {
152755
152827
  this.subscriptions.remove(
152756
152828
  previousValue,
152757
- fields,
152829
+ fieldSelection,
152758
152830
  currentSubscribers,
152759
152831
  variables
152760
152832
  );
152761
152833
  }
152762
152834
  this.subscriptions.addMany({
152763
152835
  parent: linkedID,
152764
- selection: fields,
152836
+ selection: fieldSelection,
152765
152837
  subscribers: currentSubscribers,
152766
152838
  variables,
152767
152839
  parentType: linkedType
@@ -152771,14 +152843,14 @@ var CacheInternal2 = class {
152771
152843
  if (linkedID) {
152772
152844
  this.writeSelection({
152773
152845
  root,
152774
- selection: fields,
152846
+ selection: fieldSelection,
152775
152847
  parent: linkedID,
152776
152848
  data: value2,
152777
152849
  variables,
152778
152850
  toNotify,
152779
152851
  applyUpdates,
152780
152852
  layer,
152781
- forceNotify: true
152853
+ forceNotify
152782
152854
  });
152783
152855
  }
152784
152856
  } else if (Array.isArray(value2) && (typeof previousValue === "undefined" || Array.isArray(previousValue))) {
@@ -152807,7 +152879,7 @@ var CacheInternal2 = class {
152807
152879
  key,
152808
152880
  linkedType,
152809
152881
  variables,
152810
- fields,
152882
+ fields: fieldSelection,
152811
152883
  layer,
152812
152884
  forceNotify
152813
152885
  });
@@ -152857,7 +152929,7 @@ var CacheInternal2 = class {
152857
152929
  if (linkedIDs.includes(lostID) || !lostID) {
152858
152930
  continue;
152859
152931
  }
152860
- this.subscriptions.remove(lostID, fields, currentSubscribers, variables);
152932
+ this.subscriptions.remove(lostID, fieldSelection, currentSubscribers, variables);
152861
152933
  }
152862
152934
  if (contentChanged || oldIDs.length === 0 && newIDs.length === 0) {
152863
152935
  layer.writeLink(parent, key, linkedIDs);
@@ -152868,7 +152940,7 @@ var CacheInternal2 = class {
152868
152940
  }
152869
152941
  this.subscriptions.addMany({
152870
152942
  parent: id2,
152871
- selection: fields,
152943
+ selection: fieldSelection,
152872
152944
  subscribers: currentSubscribers,
152873
152945
  variables,
152874
152946
  parentType: linkedType
@@ -152893,9 +152965,14 @@ var CacheInternal2 = class {
152893
152965
  }
152894
152966
  const targets = Array.isArray(value2) ? value2 : [value2];
152895
152967
  for (const target of targets) {
152896
- if (operation.action === "insert" && target instanceof Object && fields && operation.list) {
152897
- this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(fields, target, variables, operation.position || "last");
152898
- } else if (operation.action === "remove" && target instanceof Object && fields && operation.list) {
152968
+ if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
152969
+ this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(
152970
+ fieldSelection,
152971
+ target,
152972
+ variables,
152973
+ operation.position || "last"
152974
+ );
152975
+ } else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
152899
152976
  this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
152900
152977
  } else if (operation.action === "delete" && operation.type) {
152901
152978
  if (typeof target !== "string") {
@@ -152906,8 +152983,13 @@ var CacheInternal2 = class {
152906
152983
  continue;
152907
152984
  }
152908
152985
  this.cache.delete(targetID);
152909
- } else if (operation.action === "toggle" && target instanceof Object && fields && operation.list) {
152910
- this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
152986
+ } else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
152987
+ this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(
152988
+ fieldSelection,
152989
+ target,
152990
+ variables,
152991
+ operation.position || "last"
152992
+ );
152911
152993
  }
152912
152994
  }
152913
152995
  }
@@ -152927,9 +153009,12 @@ var CacheInternal2 = class {
152927
153009
  let hasData = false;
152928
153010
  let partial = false;
152929
153011
  let cascadeNull = false;
152930
- for (const [attributeName, { type, keyRaw, fields, nullable, list }] of Object.entries(
152931
- selection2
152932
- )) {
153012
+ const typename = this.storage.get(parent, "__typename").value;
153013
+ let targetSelection = getFieldsForType2(selection2, typename);
153014
+ for (const [
153015
+ attributeName,
153016
+ { type, keyRaw, selection: fieldSelection, nullable, list }
153017
+ ] of Object.entries(targetSelection)) {
152933
153018
  const key = evaluateKey2(keyRaw, variables);
152934
153019
  const { value: value2 } = this.storage.get(parent, key);
152935
153020
  let nextStep = stepsFromConnection;
@@ -152952,7 +153037,7 @@ var CacheInternal2 = class {
152952
153037
  if (typeof value2 !== "undefined") {
152953
153038
  hasData = true;
152954
153039
  }
152955
- } else if (!fields) {
153040
+ } else if (!fieldSelection) {
152956
153041
  const fnUnmarshal = this.config?.scalars?.[type]?.unmarshal;
152957
153042
  if (fnUnmarshal) {
152958
153043
  target[attributeName] = fnUnmarshal(value2);
@@ -152962,7 +153047,7 @@ var CacheInternal2 = class {
152962
153047
  hasData = true;
152963
153048
  } else if (Array.isArray(value2)) {
152964
153049
  const listValue = this.hydrateNestedList({
152965
- fields,
153050
+ fields: fieldSelection,
152966
153051
  variables,
152967
153052
  linkedList: value2,
152968
153053
  stepsFromConnection: nextStep
@@ -152977,7 +153062,7 @@ var CacheInternal2 = class {
152977
153062
  } else {
152978
153063
  const objectFields = this.getSelection({
152979
153064
  parent: value2,
152980
- selection: fields,
153065
+ selection: fieldSelection,
152981
153066
  variables,
152982
153067
  stepsFromConnection: nextStep
152983
153068
  });
@@ -162390,54 +162475,54 @@ function createParseContext(name2) {
162390
162475
  return this[name2]();
162391
162476
  };
162392
162477
  }
162393
- function processConfig(config2) {
162478
+ function processConfig(config3) {
162394
162479
  var parserConfig = {
162395
162480
  context: {},
162396
162481
  scope: {},
162397
162482
  atrule: {},
162398
162483
  pseudo: {}
162399
162484
  };
162400
- if (config2.parseContext) {
162401
- for (var name2 in config2.parseContext) {
162402
- switch (typeof config2.parseContext[name2]) {
162485
+ if (config3.parseContext) {
162486
+ for (var name2 in config3.parseContext) {
162487
+ switch (typeof config3.parseContext[name2]) {
162403
162488
  case "function":
162404
- parserConfig.context[name2] = config2.parseContext[name2];
162489
+ parserConfig.context[name2] = config3.parseContext[name2];
162405
162490
  break;
162406
162491
  case "string":
162407
- parserConfig.context[name2] = createParseContext(config2.parseContext[name2]);
162492
+ parserConfig.context[name2] = createParseContext(config3.parseContext[name2]);
162408
162493
  break;
162409
162494
  }
162410
162495
  }
162411
162496
  }
162412
- if (config2.scope) {
162413
- for (var name2 in config2.scope) {
162414
- parserConfig.scope[name2] = config2.scope[name2];
162497
+ if (config3.scope) {
162498
+ for (var name2 in config3.scope) {
162499
+ parserConfig.scope[name2] = config3.scope[name2];
162415
162500
  }
162416
162501
  }
162417
- if (config2.atrule) {
162418
- for (var name2 in config2.atrule) {
162419
- var atrule2 = config2.atrule[name2];
162502
+ if (config3.atrule) {
162503
+ for (var name2 in config3.atrule) {
162504
+ var atrule2 = config3.atrule[name2];
162420
162505
  if (atrule2.parse) {
162421
162506
  parserConfig.atrule[name2] = atrule2.parse;
162422
162507
  }
162423
162508
  }
162424
162509
  }
162425
- if (config2.pseudo) {
162426
- for (var name2 in config2.pseudo) {
162427
- var pseudo2 = config2.pseudo[name2];
162510
+ if (config3.pseudo) {
162511
+ for (var name2 in config3.pseudo) {
162512
+ var pseudo2 = config3.pseudo[name2];
162428
162513
  if (pseudo2.parse) {
162429
162514
  parserConfig.pseudo[name2] = pseudo2.parse;
162430
162515
  }
162431
162516
  }
162432
162517
  }
162433
- if (config2.node) {
162434
- for (var name2 in config2.node) {
162435
- parserConfig[name2] = config2.node[name2].parse;
162518
+ if (config3.node) {
162519
+ for (var name2 in config3.node) {
162520
+ parserConfig[name2] = config3.node[name2].parse;
162436
162521
  }
162437
162522
  }
162438
162523
  return parserConfig;
162439
162524
  }
162440
- var create = function createParser(config2) {
162525
+ var create = function createParser(config3) {
162441
162526
  var parser2 = {
162442
162527
  scanner: new TokenStream_1(),
162443
162528
  locationMap: new OffsetToLocation_1(),
@@ -162564,9 +162649,9 @@ var create = function createParser(config2) {
162564
162649
  );
162565
162650
  }
162566
162651
  };
162567
- config2 = processConfig(config2 || {});
162568
- for (var key in config2) {
162569
- parser2[key] = config2[key];
162652
+ config3 = processConfig(config3 || {});
162653
+ for (var key in config3) {
162654
+ parser2[key] = config3[key];
162570
162655
  }
162571
162656
  return function(source, options) {
162572
162657
  options = options || {};
@@ -179322,7 +179407,18 @@ function findScriptInnerBounds({
179322
179407
  // src/plugin/extractLoadFunction.ts
179323
179408
  var graphql20 = __toESM(require_graphql4(), 1);
179324
179409
  var import_vite = require("vite");
179325
- async function extract_load_function(config2, filepath, mockArtifacts) {
179410
+
179411
+ // src/plugin/naming.ts
179412
+ var query_variable_fn = (name2) => {
179413
+ return `_${name2}Variables`;
179414
+ };
179415
+ var houdini_load_fn = "_houdini_load";
179416
+ var houdini_before_load_fn = "_houdini_beforeLoad";
179417
+ var houdini_after_load_fn = "_houdini_afterLoad";
179418
+ var houdini_on_error_fn = "_houdini_onError";
179419
+
179420
+ // src/plugin/extractLoadFunction.ts
179421
+ async function extract_load_function(config3, filepath, mockArtifacts) {
179326
179422
  const nil = {
179327
179423
  houdini_load: [],
179328
179424
  exports: []
@@ -179342,7 +179438,7 @@ async function extract_load_function(config2, filepath, mockArtifacts) {
179342
179438
  if (!parsed) {
179343
179439
  return nil;
179344
179440
  }
179345
- const { exports, load } = await processScript(config2, filepath, parsed, mockArtifacts);
179441
+ const { exports, load } = await processScript(config3, filepath, parsed, mockArtifacts);
179346
179442
  return {
179347
179443
  exports,
179348
179444
  houdini_load: load.map(
@@ -179350,7 +179446,7 @@ async function extract_load_function(config2, filepath, mockArtifacts) {
179350
179446
  )
179351
179447
  };
179352
179448
  }
179353
- async function processScript(config2, filepath, program, mockArtifacts) {
179449
+ async function processScript(config3, filepath, program, mockArtifacts) {
179354
179450
  const exports = [];
179355
179451
  const globalImports = {};
179356
179452
  let houdiniLoad = null;
@@ -179363,16 +179459,16 @@ async function processScript(config2, filepath, program, mockArtifacts) {
179363
179459
  for (const specifier of statement.specifiers ?? []) {
179364
179460
  let name2 = specifier.local?.name || "";
179365
179461
  let query = "";
179366
- const store_prefix = plugin_config(config2).globalStorePrefix;
179462
+ const store_prefix = plugin_config(config3).globalStorePrefix;
179367
179463
  if (store_prefix && name2.startsWith(store_prefix)) {
179368
179464
  query = name2.substring(store_prefix.length);
179369
- } else if (name2.endsWith(store_suffix(config2))) {
179370
- query = name2.substring(0, name2.length - store_suffix(config2).length);
179465
+ } else if (name2.endsWith(store_suffix(config3))) {
179466
+ query = name2.substring(0, name2.length - store_suffix(config3).length);
179371
179467
  } else if (source.startsWith("$houdini/" + stores_directory_name()) && specifier.type === "ImportDefaultSpecifier") {
179372
179468
  query = source.substring(`$houdini/${stores_directory_name()}`.length - 1);
179373
179469
  }
179374
179470
  if (query) {
179375
- const artifact = mockArtifacts?.[query] || (await import(path_exports.importPath(path_exports.join(config2.artifactDirectory, query + ".js")))).default;
179471
+ const artifact = mockArtifacts?.[query] || (await import(path_exports.importPath(path_exports.join(config3.artifactDirectory, query + ".js")))).default;
179376
179472
  globalImports[name2] = artifact.raw;
179377
179473
  }
179378
179474
  }
@@ -179380,7 +179476,7 @@ async function processScript(config2, filepath, program, mockArtifacts) {
179380
179476
  } else if (statement.type === "ExportNamedDeclaration") {
179381
179477
  if (statement.declaration?.type === "VariableDeclaration" && statement.declaration.declarations.length === 1 && statement.declaration.declarations[0].type === "VariableDeclarator" && statement.declaration.declarations[0].id.type === "Identifier") {
179382
179478
  exports.push(statement.declaration.declarations[0].id.name);
179383
- if (statement.declaration.declarations[0].id.name === "houdini_load" && statement.declaration.declarations[0].init) {
179479
+ if (statement.declaration.declarations[0].id.name === houdini_load_fn && statement.declaration.declarations[0].init) {
179384
179480
  houdiniLoad = statement.declaration.declarations[0].init;
179385
179481
  }
179386
179482
  } else if (statement.declaration?.type === "FunctionDeclaration" && statement.declaration.id?.type === "Identifier") {
@@ -179413,12 +179509,14 @@ async function processScript(config2, filepath, program, mockArtifacts) {
179413
179509
  load.push(result);
179414
179510
  if (!result) {
179415
179511
  throw new Error(
179416
- "Could not find query for computing houdini_load: " + element.name + ". filepath: " + filepath
179512
+ `Could not find query for computing ${houdini_load_fn}: ` + element.name + ". filepath: " + filepath
179417
179513
  );
179418
179514
  }
179419
179515
  } else if (element.type === "TaggedTemplateExpression") {
179420
179516
  if (element.tag.type !== "Identifier" || element.tag.name !== "graphql") {
179421
- throw new Error("only graphql template tags can be passed to houdini_load");
179517
+ throw new Error(
179518
+ `only graphql template tags can be passed to ${houdini_load_fn}`
179519
+ );
179422
179520
  }
179423
179521
  load.push(element.quasi.quasis[0].value.raw);
179424
179522
  }
@@ -179435,7 +179533,7 @@ function identifyQueryReference(imports, statement) {
179435
179533
  return null;
179436
179534
  }
179437
179535
  const local = declaration.id.name;
179438
- if (local === "houdini_load") {
179536
+ if (local === houdini_load_fn) {
179439
179537
  return null;
179440
179538
  }
179441
179539
  const value2 = declaration.init;
@@ -179450,7 +179548,7 @@ function identifyQueryReference(imports, statement) {
179450
179548
  }
179451
179549
  if (value2.type === "TaggedTemplateExpression") {
179452
179550
  if (value2.tag.type !== "Identifier" || value2.tag.name !== "graphql") {
179453
- throw new Error("only graphql template tags can be passed to houdini_load");
179551
+ throw new Error(`only graphql template tags can be passed to ${houdini_load_fn}`);
179454
179552
  }
179455
179553
  return { local, query: value2.quasi.quasis[0].value.raw };
179456
179554
  }
@@ -179458,17 +179556,17 @@ function identifyQueryReference(imports, statement) {
179458
179556
  }
179459
179557
 
179460
179558
  // src/plugin/kit.ts
179461
- function is_route(config2, framework2, filepath) {
179559
+ function is_route(config3, framework2, filepath) {
179462
179560
  if (framework2 === "svelte") {
179463
179561
  return false;
179464
179562
  }
179465
- if (!filepath.startsWith(config2.routesDir)) {
179563
+ if (!filepath.startsWith(config3.routesDir)) {
179466
179564
  return false;
179467
179565
  }
179468
179566
  return ["+layout.svelte", "+page.svelte"].includes(path_exports.parse(filepath).base);
179469
179567
  }
179470
- function route_data_path(config2, filename) {
179471
- return resolve_relative(config2, filename).replace(".svelte", ".js");
179568
+ function route_data_path(config3, filename) {
179569
+ return resolve_relative(config3, filename).replace(".svelte", ".js");
179472
179570
  }
179473
179571
  function is_route_script(framework2, filename) {
179474
179572
  return is_page_script(framework2, filename) || is_layout_script(framework2, filename);
@@ -179479,14 +179577,14 @@ function is_page_script(framework2, filename) {
179479
179577
  function is_layout_script(framework2, filename) {
179480
179578
  return framework2 === "kit" && (filename.endsWith("+layout.js") || filename.endsWith("+layout.ts"));
179481
179579
  }
179482
- function is_root_layout(config2, filename) {
179483
- return resolve_relative(config2, filename).replace(config2.projectRoot, "") === path_exports.sep + path_exports.join("src", "routes", "+layout.svelte");
179580
+ function is_root_layout(config3, filename) {
179581
+ return resolve_relative(config3, filename).replace(config3.projectRoot, "") === path_exports.sep + path_exports.join("src", "routes", "+layout.svelte");
179484
179582
  }
179485
- function is_root_layout_server(config2, filename) {
179486
- return resolve_relative(config2, filename).replace(config2.projectRoot, "").replace(".ts", ".js") === path_exports.sep + path_exports.join("src", "routes", "+layout.server.js");
179583
+ function is_root_layout_server(config3, filename) {
179584
+ return resolve_relative(config3, filename).replace(config3.projectRoot, "").replace(".ts", ".js") === path_exports.sep + path_exports.join("src", "routes", "+layout.server.js");
179487
179585
  }
179488
- function is_root_layout_script(config2, filename) {
179489
- return resolve_relative(config2, filename).replace(config2.projectRoot, "").replace(".ts", ".js") === path_exports.sep + path_exports.join("src", "routes", "+layout.js");
179586
+ function is_root_layout_script(config3, filename) {
179587
+ return resolve_relative(config3, filename).replace(config3.projectRoot, "").replace(".ts", ".js") === path_exports.sep + path_exports.join("src", "routes", "+layout.js");
179490
179588
  }
179491
179589
  function is_layout_component(framework2, filename) {
179492
179590
  return framework2 === "kit" && filename.endsWith("+layout.svelte");
@@ -179494,29 +179592,29 @@ function is_layout_component(framework2, filename) {
179494
179592
  function is_layout(framework2, filename) {
179495
179593
  return is_layout_script(framework2, filename) || is_layout_component(framework2, filename);
179496
179594
  }
179497
- function is_component(config2, framework2, filename) {
179498
- return framework2 === "svelte" || filename.endsWith(".svelte") && !is_route_script(framework2, filename) && !is_route(config2, framework2, filename);
179595
+ function is_component(config3, framework2, filename) {
179596
+ return framework2 === "svelte" || filename.endsWith(".svelte") && !is_route_script(framework2, filename) && !is_route(config3, framework2, filename);
179499
179597
  }
179500
- function page_query_path(config2, filename) {
179598
+ function page_query_path(config3, filename) {
179501
179599
  return path_exports.join(
179502
- path_exports.dirname(resolve_relative(config2, filename)),
179503
- plugin_config(config2).pageQueryFilename
179600
+ path_exports.dirname(resolve_relative(config3, filename)),
179601
+ plugin_config(config3).pageQueryFilename
179504
179602
  );
179505
179603
  }
179506
- function layout_query_path(config2, filename) {
179604
+ function layout_query_path(config3, filename) {
179507
179605
  return path_exports.join(
179508
- path_exports.dirname(resolve_relative(config2, filename)),
179509
- plugin_config(config2).layoutQueryFilename
179606
+ path_exports.dirname(resolve_relative(config3, filename)),
179607
+ plugin_config(config3).layoutQueryFilename
179510
179608
  );
179511
179609
  }
179512
- function resolve_relative(config2, filename) {
179610
+ function resolve_relative(config3, filename) {
179513
179611
  const match = filename.match("^((../)+)src/routes");
179514
179612
  if (match) {
179515
- filename = path_exports.join(config2.projectRoot, filename.substring(match[1].length));
179613
+ filename = path_exports.join(config3.projectRoot, filename.substring(match[1].length));
179516
179614
  }
179517
179615
  return filename;
179518
179616
  }
179519
- async function walk_routes(config2, framework2, visitor, dirpath = config2.routesDir) {
179617
+ async function walk_routes(config3, framework2, visitor, dirpath = config3.routesDir) {
179520
179618
  let pageExports = [];
179521
179619
  let layoutExports = [];
179522
179620
  let pageQueries = [];
@@ -179525,19 +179623,19 @@ async function walk_routes(config2, framework2, visitor, dirpath = config2.route
179525
179623
  for (const child of await fs_exports.readdir(dirpath)) {
179526
179624
  const childPath = path_exports.join(dirpath, child);
179527
179625
  if ((await fs_exports.stat(childPath)).isDirectory()) {
179528
- await walk_routes(config2, framework2, visitor, childPath);
179626
+ await walk_routes(config3, framework2, visitor, childPath);
179529
179627
  continue;
179530
179628
  }
179531
179629
  if (is_layout_script(framework2, childPath)) {
179532
179630
  validRoute = true;
179533
- const { houdini_load, exports } = await extract_load_function(config2, childPath);
179631
+ const { houdini_load, exports } = await extract_load_function(config3, childPath);
179534
179632
  await visitor.layoutQueries?.(houdini_load ?? [], childPath);
179535
179633
  layoutQueries.push(...houdini_load ?? []);
179536
179634
  await visitor.layoutExports?.(exports, childPath);
179537
179635
  layoutExports.push(...exports);
179538
179636
  } else if (is_page_script(framework2, childPath)) {
179539
179637
  validRoute = true;
179540
- const { houdini_load, exports } = await extract_load_function(config2, childPath);
179638
+ const { houdini_load, exports } = await extract_load_function(config3, childPath);
179541
179639
  await visitor.pageQueries?.(houdini_load ?? [], childPath);
179542
179640
  pageQueries.push(...houdini_load ?? []);
179543
179641
  await visitor.pageExports?.(exports, childPath);
@@ -179552,21 +179650,21 @@ async function walk_routes(config2, framework2, visitor, dirpath = config2.route
179552
179650
  if (!parsed) {
179553
179651
  continue;
179554
179652
  }
179555
- await find_graphql(config2, parsed.script, {
179653
+ await find_graphql(config3, parsed.script, {
179556
179654
  where: (tag2) => {
179557
179655
  try {
179558
- return !!config2.extractQueryDefinition(tag2);
179656
+ return !!config3.extractQueryDefinition(tag2);
179559
179657
  } catch {
179560
179658
  return false;
179561
179659
  }
179562
179660
  },
179563
179661
  tag: async ({ parsedDocument }) => {
179564
- let definition = config2.extractQueryDefinition(parsedDocument);
179662
+ let definition = config3.extractQueryDefinition(parsedDocument);
179565
179663
  await visitor.inlineLayoutQueries?.(definition, childPath);
179566
179664
  layoutQueries.push(definition);
179567
179665
  }
179568
179666
  });
179569
- } else if (is_component(config2, framework2, child)) {
179667
+ } else if (is_component(config3, framework2, child)) {
179570
179668
  validRoute = true;
179571
179669
  const contents = await fs_exports.readFile(childPath);
179572
179670
  if (!contents) {
@@ -179576,41 +179674,41 @@ async function walk_routes(config2, framework2, visitor, dirpath = config2.route
179576
179674
  if (!parsed) {
179577
179675
  continue;
179578
179676
  }
179579
- await find_graphql(config2, parsed.script, {
179677
+ await find_graphql(config3, parsed.script, {
179580
179678
  where: (tag2) => {
179581
179679
  try {
179582
- return !!config2.extractQueryDefinition(tag2);
179680
+ return !!config3.extractQueryDefinition(tag2);
179583
179681
  } catch {
179584
179682
  return false;
179585
179683
  }
179586
179684
  },
179587
179685
  tag: async ({ parsedDocument }) => {
179588
- let definition = config2.extractQueryDefinition(parsedDocument);
179686
+ let definition = config3.extractQueryDefinition(parsedDocument);
179589
179687
  await visitor.inlinePageQueries?.(definition, childPath);
179590
179688
  pageQueries.push(definition);
179591
179689
  }
179592
179690
  });
179593
- } else if (child === plugin_config(config2).layoutQueryFilename) {
179691
+ } else if (child === plugin_config(config3).layoutQueryFilename) {
179594
179692
  validRoute = true;
179595
179693
  const contents = await fs_exports.readFile(childPath);
179596
179694
  if (!contents) {
179597
179695
  continue;
179598
179696
  }
179599
179697
  try {
179600
- const query = config2.extractQueryDefinition(graphql28.parse(contents));
179698
+ const query = config3.extractQueryDefinition(graphql28.parse(contents));
179601
179699
  await visitor.routeLayoutQuery?.(query, childPath);
179602
179700
  layoutQueries.push(query);
179603
179701
  } catch (e3) {
179604
179702
  throw routeQueryError(childPath);
179605
179703
  }
179606
- } else if (child === plugin_config(config2).pageQueryFilename) {
179704
+ } else if (child === plugin_config(config3).pageQueryFilename) {
179607
179705
  validRoute = true;
179608
179706
  const contents = await fs_exports.readFile(childPath);
179609
179707
  if (!contents) {
179610
179708
  continue;
179611
179709
  }
179612
179710
  try {
179613
- const query = config2.extractQueryDefinition(graphql28.parse(contents));
179711
+ const query = config3.extractQueryDefinition(graphql28.parse(contents));
179614
179712
  await visitor.routePageQuery?.(query, childPath);
179615
179713
  pageQueries.push(query);
179616
179714
  } catch (e3) {
@@ -179623,14 +179721,14 @@ async function walk_routes(config2, framework2, visitor, dirpath = config2.route
179623
179721
  if (visitor.route && validRoute) {
179624
179722
  const relative_path_regex = /src(.*)/;
179625
179723
  const svelteTypeFilePath = path_exports.join(
179626
- config2.projectRoot,
179724
+ config3.projectRoot,
179627
179725
  ".svelte-kit",
179628
179726
  "types",
179629
179727
  dirpath.match(relative_path_regex)?.[0] ?? "",
179630
179728
  "$types.d.ts"
179631
179729
  );
179632
179730
  if (!fs_exports.existsSync(svelteTypeFilePath)) {
179633
- throw Error(`SvelteKit types do not exist at route: ${svelteTypeFilePath}`);
179731
+ return;
179634
179732
  }
179635
179733
  await visitor.route(
179636
179734
  {
@@ -179649,8 +179747,8 @@ var routeQueryError = (filepath) => ({
179649
179747
  filepath,
179650
179748
  message: "route query error"
179651
179749
  });
179652
- function route_page_path(config2, filename) {
179653
- return resolve_relative(config2, filename).replace(".js", ".svelte").replace(".ts", ".svelte");
179750
+ function route_page_path(config3, filename) {
179751
+ return resolve_relative(config3, filename).replace(".js", ".svelte").replace(".ts", ".svelte");
179654
179752
  }
179655
179753
  function stores_directory_name() {
179656
179754
  return "stores";
@@ -179658,24 +179756,25 @@ function stores_directory_name() {
179658
179756
  function stores_directory(plugin_root) {
179659
179757
  return path_exports.join(plugin_root, stores_directory_name());
179660
179758
  }
179661
- function type_route_dir(config2) {
179662
- return path_exports.join(config2.typeRootDir, "src", "routes");
179759
+ function type_route_dir(config3) {
179760
+ return path_exports.join(config3.typeRootDir, "src", "routes");
179663
179761
  }
179664
- function store_import_path({ config: config2, name: name2 }) {
179762
+ function store_import_path({ config: config3, name: name2 }) {
179665
179763
  return `$houdini/plugins/houdini-svelte/${stores_directory_name()}/${name2}`;
179666
179764
  }
179667
- function store_suffix(config2) {
179765
+ function store_suffix(config3) {
179668
179766
  return "Store";
179669
179767
  }
179670
- function store_name({ config: config2, name: name2 }) {
179671
- return name2 + store_suffix(config2);
179768
+ function store_name({ config: config3, name: name2 }) {
179769
+ return name2 + store_suffix(config3);
179672
179770
  }
179673
- function global_store_name({ config: config2, name: name2 }) {
179674
- return plugin_config(config2).globalStorePrefix + name2;
179771
+ function global_store_name({ config: config3, name: name2 }) {
179772
+ return plugin_config(config3).globalStorePrefix + name2;
179675
179773
  }
179676
- function plugin_config(config2) {
179677
- const cfg = config2.pluginConfig("houdini-svelte");
179774
+ function plugin_config(config3) {
179775
+ const cfg = config3.pluginConfig("houdini-svelte");
179678
179776
  return {
179777
+ client: "./src/client",
179679
179778
  globalStorePrefix: "GQL_",
179680
179779
  pageQueryFilename: "+page.gql",
179681
179780
  layoutQueryFilename: "+layout.gql",
@@ -179712,7 +179811,7 @@ function store_import({
179712
179811
  }
179713
179812
 
179714
179813
  // src/plugin/codegen/components/index.ts
179715
- async function componentTypesGenerator(framework2, { config: config2, documents }) {
179814
+ async function componentTypesGenerator(framework2, { config: config3, documents }) {
179716
179815
  const queries = {};
179717
179816
  for (const document of documents) {
179718
179817
  if (document.kind !== ArtifactKind.Query) {
@@ -179725,14 +179824,14 @@ async function componentTypesGenerator(framework2, { config: config2, documents
179725
179824
  }
179726
179825
  let matches2 = Object.keys(queries).filter((filepath) => filepath.endsWith(".svelte"));
179727
179826
  if (framework2 === "kit") {
179728
- matches2 = matches2.filter((match) => !match.startsWith(config2.routesDir));
179827
+ matches2 = matches2.filter((match) => !match.startsWith(config3.routesDir));
179729
179828
  }
179730
179829
  const files = {
179731
179830
  dirs: {},
179732
179831
  files: []
179733
179832
  };
179734
179833
  for (let file of matches2) {
179735
- file = path_exports.relative(config2.projectRoot, file);
179834
+ file = path_exports.relative(config3.projectRoot, file);
179736
179835
  let target = files;
179737
179836
  const parts = file.split("/");
179738
179837
  for (const [i3, part] of parts.entries()) {
@@ -179749,12 +179848,12 @@ async function componentTypesGenerator(framework2, { config: config2, documents
179749
179848
  target = target.dirs[part];
179750
179849
  }
179751
179850
  }
179752
- await walk_project(config2, files, queries, config2.projectRoot);
179851
+ await walk_project(config3, files, queries, config3.projectRoot);
179753
179852
  }
179754
- async function walk_project(config2, dirs, queries, root) {
179853
+ async function walk_project(config3, dirs, queries, root) {
179755
179854
  await Promise.all(
179756
179855
  Object.entries(dirs.dirs).map(async ([path_part, child]) => {
179757
- return walk_project(config2, child, queries, path_exports.join(root, path_part));
179856
+ return walk_project(config3, child, queries, path_exports.join(root, path_part));
179758
179857
  })
179759
179858
  );
179760
179859
  if (dirs.files.length === 0) {
@@ -179776,25 +179875,25 @@ type ${prop_type} = ComponentProps<${no_ext}>
179776
179875
  `;
179777
179876
  for (const query of queries[filepath]) {
179778
179877
  typeFile = `
179779
- import type { ${query.name}$input } from '${path_exports.relative(filepath, path_exports.join(config2.artifactDirectory, query.name)).replace("/$houdini", "")}'
179878
+ import type { ${query.name}$input } from '${path_exports.relative(filepath, path_exports.join(config3.artifactDirectory, query.name)).replace("/$houdini", "")}'
179780
179879
  ` + typeFile + `
179781
- export type ${config2.variableFunctionName(
179880
+ export type ${config3.variableFunctionName(
179782
179881
  query.name
179783
179882
  )} = <_Props = ${prop_type}>(args: { props: _Props }) => FragmentQueryVars$input
179784
179883
  `;
179785
179884
  }
179786
179885
  }
179787
- const relative3 = path_exports.join(config2.typeRootDir, path_exports.relative(config2.projectRoot, root));
179886
+ const relative3 = path_exports.join(config3.typeRootDir, path_exports.relative(config3.projectRoot, root));
179788
179887
  await fs_exports.mkdirp(relative3);
179789
179888
  await fs_exports.writeFile(path_exports.join(relative3, "$houdini.d.ts"), typeFile);
179790
179889
  }
179791
179890
 
179792
179891
  // src/plugin/codegen/routes/index.ts
179793
- async function svelteKitGenerator(framework2, { config: config2 }) {
179892
+ async function svelteKitGenerator(framework2, { config: config3 }) {
179794
179893
  if (framework2 !== "kit") {
179795
179894
  return;
179796
179895
  }
179797
- await walk_routes(config2, framework2, {
179896
+ await walk_routes(config3, framework2, {
179798
179897
  async route({
179799
179898
  dirpath,
179800
179899
  svelteTypeFilePath,
@@ -179803,9 +179902,9 @@ async function svelteKitGenerator(framework2, { config: config2 }) {
179803
179902
  layoutExports,
179804
179903
  pageExports
179805
179904
  }) {
179806
- const relativePath = path_exports.relative(config2.routesDir, dirpath);
179807
- const target = path_exports.join(type_route_dir(config2), relativePath, config2.typeRootFile);
179808
- const houdiniRelative = path_exports.relative(target, config2.typeRootDir);
179905
+ const relativePath = path_exports.relative(config3.routesDir, dirpath);
179906
+ const target = path_exports.join(type_route_dir(config3), relativePath, config3.typeRootFile);
179907
+ const houdiniRelative = path_exports.relative(target, config3.typeRootDir);
179809
179908
  const queryNames = [];
179810
179909
  const uniquePageQueries = [];
179811
179910
  for (const query of pageQueries) {
@@ -179824,26 +179923,26 @@ async function svelteKitGenerator(framework2, { config: config2 }) {
179824
179923
  }
179825
179924
  let skTypeString = await fs_exports.readFile(svelteTypeFilePath);
179826
179925
  if (skTypeString) {
179827
- const pageTypeImports = getTypeImports(houdiniRelative, config2, uniquePageQueries);
179926
+ const pageTypeImports = getTypeImports(houdiniRelative, config3, uniquePageQueries);
179828
179927
  const layoutTypeImports = getTypeImports(
179829
179928
  houdiniRelative,
179830
- config2,
179929
+ config3,
179831
179930
  uniqueLayoutQueries
179832
179931
  );
179833
- const afterPageLoad = pageExports.includes("afterLoad");
179834
- const beforePageLoad = pageExports.includes("beforeLoad");
179835
- const onPageError = pageExports.includes("onError");
179836
- const afterLayoutLoad = layoutExports.includes("afterLoad");
179837
- const beforeLayoutLoad = layoutExports.includes("beforeLoad");
179838
- const onLayoutError = layoutExports.includes("onError");
179932
+ const beforePageLoad = pageExports.includes(houdini_before_load_fn);
179933
+ const afterPageLoad = pageExports.includes(houdini_after_load_fn);
179934
+ const onPageError = pageExports.includes(houdini_on_error_fn);
179935
+ const beforeLayoutLoad = layoutExports.includes(houdini_before_load_fn);
179936
+ const afterLayoutLoad = layoutExports.includes(houdini_after_load_fn);
179937
+ const onLayoutError = layoutExports.includes(houdini_on_error_fn);
179839
179938
  const layout_append_VariablesFunction = append_VariablesFunction(
179840
179939
  "Layout",
179841
- config2,
179940
+ config3,
179842
179941
  uniqueLayoutQueries
179843
179942
  );
179844
179943
  const page_append_VariablesFunction = append_VariablesFunction(
179845
179944
  "Page",
179846
- config2,
179945
+ config3,
179847
179946
  uniquePageQueries
179848
179947
  );
179849
179948
  const layout_append_beforeLoad = append_beforeLoad(beforeLayoutLoad, "Layout");
@@ -179890,7 +179989,7 @@ import type { ${functionImportsToBring.join(
179890
179989
  /(?<=LayoutData = )([\s\S]*?)(?=;)/,
179891
179990
  `Expand<$1 & { ${layoutQueries.map((query) => {
179892
179991
  const name2 = query.name.value;
179893
- return [name2, name2 + store_suffix(config2)].join(": ");
179992
+ return [name2, name2 + store_suffix(config3)].join(": ");
179894
179993
  }).join("; ")} }${internal_append_TypeDataExtra(
179895
179994
  beforeLayoutLoad,
179896
179995
  afterLayoutLoad,
@@ -179900,7 +179999,7 @@ import type { ${functionImportsToBring.join(
179900
179999
  /(?<=PageData = )([\s\S]*?)(?=;)/,
179901
180000
  `Expand<$1 & { ${pageQueries.map((query) => {
179902
180001
  const name2 = query.name.value;
179903
- return [name2, name2 + store_suffix(config2)].join(": ");
180002
+ return [name2, name2 + store_suffix(config3)].join(": ");
179904
180003
  }).join("; ")} }${internal_append_TypeDataExtra(
179905
180004
  beforePageLoad,
179906
180005
  afterPageLoad,
@@ -179923,22 +180022,22 @@ import type { ${functionImportsToBring.join(
179923
180022
  }
179924
180023
  });
179925
180024
  }
179926
- function getTypeImports(houdiniRelative, config2, queries) {
180025
+ function getTypeImports(houdiniRelative, config3, queries) {
179927
180026
  return queries.map((query) => {
179928
180027
  const name2 = query.name.value;
179929
180028
  return `
179930
- import { ${name2}$result, ${name2}$input } from '${houdiniRelative}/${config2.artifactDirectoryName}/${name2}';
180029
+ import { ${name2}$result, ${name2}$input } from '${houdiniRelative}/${config3.artifactDirectoryName}/${name2}';
179931
180030
  import { ${name2}Store } from '${houdiniRelative}/plugins/houdini-svelte/${stores_directory_name()}/${name2}';`;
179932
180031
  }).join("\n");
179933
180032
  }
179934
- function append_VariablesFunction(type, config2, queries) {
180033
+ function append_VariablesFunction(type, config3, queries) {
179935
180034
  return queries.map((query) => {
179936
180035
  const name2 = query.name.value;
179937
180036
  if (!query.variableDefinitions?.length) {
179938
180037
  return "";
179939
180038
  }
179940
180039
  return `
179941
- export type ${config2.variableFunctionName(
180040
+ export type ${config3.variableFunctionName(
179942
180041
  name2
179943
180042
  )} = VariableFunction<${type}Params, ${name2}$input>;`;
179944
180043
  }).join("\n");
@@ -179999,11 +180098,11 @@ function store_import2(cfg, which) {
179999
180098
  }
180000
180099
 
180001
180100
  // src/plugin/codegen/stores/fragment.ts
180002
- async function fragmentStore({ config: config2, plugin_root }, doc) {
180101
+ async function fragmentStore({ config: config3, plugin_root }, doc) {
180003
180102
  const fileName = doc.name;
180004
180103
  const artifactName = `${doc.name}`;
180005
- const storeName = store_name({ config: config2, name: doc.name });
180006
- const globalStoreName = global_store_name({ config: config2, name: doc.name });
180104
+ const storeName = store_name({ config: config3, name: doc.name });
180105
+ const globalStoreName = global_store_name({ config: config3, name: doc.name });
180007
180106
  const paginationMethod = doc.refetch?.method;
180008
180107
  let which = "fragment";
180009
180108
  if (paginationMethod === "cursor") {
@@ -180011,11 +180110,11 @@ async function fragmentStore({ config: config2, plugin_root }, doc) {
180011
180110
  } else if (paginationMethod === "offset") {
180012
180111
  which = "fragmentOffset";
180013
180112
  }
180014
- const { statement, store_class } = store_import2(config2, which);
180113
+ const { statement, store_class } = store_import2(config3, which);
180015
180114
  const storeContent = `${statement}
180016
180115
  import artifact from '$houdini/artifacts/${artifactName}'
180017
- ${paginationMethod ? `import _PaginationArtifact from '${config2.artifactImportPath(
180018
- config2.paginationQueryName(doc.name)
180116
+ ${paginationMethod ? `import _PaginationArtifact from '${config3.artifactImportPath(
180117
+ config3.paginationQueryName(doc.name)
180019
180118
  )}'` : ""}
180020
180119
 
180021
180120
  // create the fragment store
@@ -180059,12 +180158,12 @@ export default ${storeName}
180059
180158
  }
180060
180159
 
180061
180160
  // src/plugin/codegen/stores/mutation.ts
180062
- async function mutationStore({ config: config2, plugin_root }, doc) {
180161
+ async function mutationStore({ config: config3, plugin_root }, doc) {
180063
180162
  const fileName = doc.name;
180064
- const storeName = store_name({ config: config2, name: doc.name });
180065
- const globalStoreName = global_store_name({ config: config2, name: doc.name });
180163
+ const storeName = store_name({ config: config3, name: doc.name });
180164
+ const globalStoreName = global_store_name({ config: config3, name: doc.name });
180066
180165
  const artifactName = `${doc.name}`;
180067
- const { statement, store_class } = store_import2(config2, "mutation");
180166
+ const { statement, store_class } = store_import2(config3, "mutation");
180068
180167
  const storeData = `import artifact from '$houdini/artifacts/${artifactName}'
180069
180168
  ${statement}
180070
180169
 
@@ -180104,11 +180203,11 @@ export default ${storeName}
180104
180203
  }
180105
180204
 
180106
180205
  // src/plugin/codegen/stores/query.ts
180107
- async function queryStore({ config: config2, plugin_root }, doc) {
180206
+ async function queryStore({ config: config3, plugin_root }, doc) {
180108
180207
  const fileName = doc.name;
180109
180208
  const artifactName = `${doc.name}`;
180110
- const storeName = store_name({ config: config2, name: doc.name });
180111
- const globalStoreName = global_store_name({ config: config2, name: doc.name });
180209
+ const storeName = store_name({ config: config3, name: doc.name });
180210
+ const globalStoreName = global_store_name({ config: config3, name: doc.name });
180112
180211
  let variables = false;
180113
180212
  const operation = doc.originalDocument.definitions.find(
180114
180213
  (defn) => defn.kind === "OperationDefinition" && defn.operation === "query"
@@ -180123,7 +180222,7 @@ async function queryStore({ config: config2, plugin_root }, doc) {
180123
180222
  } else if (paginationMethod === "offset") {
180124
180223
  which = "queryOffset";
180125
180224
  }
180126
- const { store_class, statement } = store_import2(config2, which);
180225
+ const { store_class, statement } = store_import2(config3, which);
180127
180226
  const storeData = `${statement}
180128
180227
  import artifact from '$houdini/artifacts/${artifactName}'
180129
180228
 
@@ -180238,12 +180337,12 @@ export default ${storeName}
180238
180337
  }
180239
180338
 
180240
180339
  // src/plugin/codegen/stores/subscription.ts
180241
- async function subscriptionStore({ config: config2, plugin_root }, doc) {
180340
+ async function subscriptionStore({ config: config3, plugin_root }, doc) {
180242
180341
  const fileName = doc.name;
180243
- const storeName = store_name({ config: config2, name: doc.name });
180244
- const globalStoreName = global_store_name({ config: config2, name: doc.name });
180342
+ const storeName = store_name({ config: config3, name: doc.name });
180343
+ const globalStoreName = global_store_name({ config: config3, name: doc.name });
180245
180344
  const artifactName = `${doc.name}`;
180246
- const { store_class, statement } = store_import2(config2, "subscription");
180345
+ const { store_class, statement } = store_import2(config3, "subscription");
180247
180346
  const storeContent = `import artifact from '$houdini/artifacts/${artifactName}'
180248
180347
  ${statement}
180249
180348
 
@@ -180283,7 +180382,7 @@ export default ${storeName}
180283
180382
 
180284
180383
  // src/plugin/codegen/stores/index.ts
180285
180384
  async function storesGenerator(input) {
180286
- const { config: config2, documents } = input;
180385
+ const { config: config3, documents } = input;
180287
180386
  const listOfStores = [];
180288
180387
  await Promise.all(
180289
180388
  documents.map(async (doc) => {
@@ -180336,33 +180435,33 @@ async function codegen_default(input) {
180336
180435
  // src/plugin/fsPatch.ts
180337
180436
  var import_fs = __toESM(require("fs"), 1);
180338
180437
  var fsPatch_default = (getFramwork) => ({
180339
- async resolveId(filepath, _, { config: config2, isEntry }) {
180438
+ async resolveId(filepath, _, { config: config3, isEntry }) {
180340
180439
  if (!isEntry) {
180341
180440
  const match = filepath.match("^((../)+)src/routes");
180342
180441
  if (match) {
180343
- return path_exports.join(config2.projectRoot, filepath.substring(match[1].length));
180442
+ return path_exports.join(config3.projectRoot, filepath.substring(match[1].length));
180344
180443
  }
180345
180444
  return;
180346
180445
  }
180347
180446
  filepath = path_exports.posixify(filepath.toString());
180348
- if (is_route_script(getFramwork(), filepath) || is_root_layout(config2, filepath) || is_root_layout_server(config2, filepath)) {
180447
+ if (is_route_script(getFramwork(), filepath) || is_root_layout(config3, filepath) || is_root_layout_server(config3, filepath)) {
180349
180448
  return {
180350
- id: resolve_relative(config2, filepath)
180449
+ id: resolve_relative(config3, filepath)
180351
180450
  };
180352
180451
  }
180353
180452
  },
180354
- load: async (filepath, { config: config2 }) => {
180453
+ load: async (filepath, { config: config3 }) => {
180355
180454
  filepath = path_exports.posixify(filepath.toString());
180356
- if (is_route_script(getFramwork(), filepath) || is_root_layout_server(config2, filepath)) {
180357
- filepath = resolve_relative(config2, filepath);
180455
+ if (is_route_script(getFramwork(), filepath) || is_root_layout_server(config3, filepath)) {
180456
+ filepath = resolve_relative(config3, filepath);
180358
180457
  return {
180359
- code: await fs_exports.readFile(filepath) || await fs_exports.readFile(path_exports.join(config2.projectRoot, filepath)) || ""
180458
+ code: await fs_exports.readFile(filepath) || await fs_exports.readFile(path_exports.join(config3.projectRoot, filepath)) || ""
180360
180459
  };
180361
180460
  }
180362
- if (is_root_layout(config2, filepath)) {
180363
- filepath = resolve_relative(config2, filepath);
180461
+ if (is_root_layout(config3, filepath)) {
180462
+ filepath = resolve_relative(config3, filepath);
180364
180463
  return {
180365
- code: await fs_exports.readFile(filepath) || await fs_exports.readFile(path_exports.join(config2.projectRoot, filepath)) || empty_layout
180464
+ code: await fs_exports.readFile(filepath) || await fs_exports.readFile(path_exports.join(config3.projectRoot, filepath)) || empty_layout
180366
180465
  };
180367
180466
  }
180368
180467
  }
@@ -180539,6 +180638,37 @@ async function kit_init(page2) {
180539
180638
  );
180540
180639
  }
180541
180640
 
180641
+ // ../../node_modules/.pnpm/@kitql+helper@0.5.0/node_modules/@kitql/helper/index.mjs
180642
+ var config2 = {
180643
+ reset: {
180644
+ node: `\x1B[37m\x1B[0m`,
180645
+ browser: ""
180646
+ },
180647
+ green: {
180648
+ node: `\x1B[32m`,
180649
+ browser: "color: green"
180650
+ },
180651
+ magneta: {
180652
+ node: `\x1B[35m`,
180653
+ browser: "color: #ff00ff"
180654
+ },
180655
+ red: {
180656
+ node: `\x1B[31m`,
180657
+ browser: "color: red"
180658
+ },
180659
+ cyan: {
180660
+ node: `\x1B[36m`,
180661
+ browser: "color: cyan"
180662
+ },
180663
+ yellow: {
180664
+ node: `\x1B[33m`,
180665
+ browser: "color: yellow"
180666
+ }
180667
+ };
180668
+ function logYellow(str) {
180669
+ return `${config2.yellow.node}${str}${config2.reset.node}`;
180670
+ }
180671
+
180542
180672
  // src/plugin/transforms/kit/load.ts
180543
180673
  var graphql29 = __toESM(require_graphql4(), 1);
180544
180674
  var recast15 = __toESM(require_main5(), 1);
@@ -180546,8 +180676,8 @@ var recast15 = __toESM(require_main5(), 1);
180546
180676
  // src/plugin/transforms/query.ts
180547
180677
  var recast14 = __toESM(require_main5(), 1);
180548
180678
  var AST14 = recast14.types.builders;
180549
- async function QueryProcessor(config2, page2) {
180550
- if (!is_component(config2, page2.framework, page2.filepath)) {
180679
+ async function QueryProcessor(config3, page2) {
180680
+ if (!is_component(config3, page2.framework, page2.filepath)) {
180551
180681
  return;
180552
180682
  }
180553
180683
  const store_id = (name2) => {
@@ -180590,7 +180720,7 @@ async function QueryProcessor(config2, page2) {
180590
180720
  script: page2.script,
180591
180721
  config: page2.config,
180592
180722
  import: [`${query.name}Store`],
180593
- sourceModule: store_import_path({ config: config2, name: query.name })
180723
+ sourceModule: store_import_path({ config: config3, name: query.name })
180594
180724
  }).ids[0];
180595
180725
  page2.script.body.splice(
180596
180726
  find_insert_index(page2.script),
@@ -180604,6 +180734,14 @@ async function QueryProcessor(config2, page2) {
180604
180734
  ...queries.flatMap((query) => {
180605
180735
  const variable_fn = query_variable_fn(query.name);
180606
180736
  const has_variables = find_exported_fn(page2.script.body, variable_fn);
180737
+ if (query.variables && has_variables === null) {
180738
+ formatErrors({
180739
+ filepath: page2.filepath,
180740
+ message: `Could not find required variable function: ${logYellow(
180741
+ variable_fn
180742
+ )}. maybe its not exported? `
180743
+ });
180744
+ }
180607
180745
  return [
180608
180746
  AST14.labeledStatement(
180609
180747
  AST14.identifier("$"),
@@ -180699,9 +180837,7 @@ async function find_inline_queries(page2, parsed, store_id) {
180699
180837
  return false;
180700
180838
  }
180701
180839
  return !queryOperation.directives?.find(
180702
- (directive) => directive.name.value === page2.config.houdiniDirective && directive.arguments?.find(
180703
- (arg) => arg.name.value === "load" && arg.value.kind === "BooleanValue" && !arg.value.value
180704
- )
180840
+ (directive) => directive.name.value === page2.config.manualLoadDirective
180705
180841
  );
180706
180842
  },
180707
180843
  dependency: page2.watch_file,
@@ -180723,9 +180859,6 @@ async function find_inline_queries(page2, parsed, store_id) {
180723
180859
  };
180724
180860
  });
180725
180861
  }
180726
- function query_variable_fn(name2) {
180727
- return `${name2}Variables`;
180728
- }
180729
180862
  var local_input_id = (name2) => AST14.identifier(`_${name2}_Input`);
180730
180863
 
180731
180864
  // src/plugin/transforms/kit/load.ts
@@ -180757,7 +180890,7 @@ async function kit_load_generator(page2) {
180757
180890
  houdini_load_queries.push({
180758
180891
  name: target.name.value,
180759
180892
  variables: operation_requires_variables(target),
180760
- store_id: AST15.memberExpression(AST15.identifier("houdini_load"), AST15.literal(i3))
180893
+ store_id: AST15.memberExpression(AST15.identifier(houdini_load_fn), AST15.literal(i3))
180761
180894
  });
180762
180895
  }
180763
180896
  if (script) {
@@ -180810,7 +180943,9 @@ function add_load({
180810
180943
  if (!page_info.exports.includes(variable_fn) && query.variables) {
180811
180944
  formatErrors({
180812
180945
  filepath: page2.filepath,
180813
- message: `Could not find required variable function: ${variable_fn}. maybe its not exported? `
180946
+ message: `Could not find required variable function: ${logYellow(
180947
+ variable_fn
180948
+ )}. maybe its not exported? `
180814
180949
  });
180815
180950
  invalid2 = true;
180816
180951
  }
@@ -180830,9 +180965,9 @@ function add_load({
180830
180965
  import: ["getCurrentConfig"],
180831
180966
  sourceModule: "$houdini/runtime/lib/config"
180832
180967
  });
180833
- let before_load = page_info.exports.includes("beforeLoad");
180834
- let after_load = page_info.exports.includes("afterLoad");
180835
- let on_error = page_info.exports.includes("onError");
180968
+ let before_load = page_info.exports.includes(houdini_before_load_fn);
180969
+ let after_load = page_info.exports.includes(houdini_after_load_fn);
180970
+ let on_error = page_info.exports.includes(houdini_on_error_fn);
180836
180971
  const request_context = AST15.identifier("houdini_context");
180837
180972
  const promise_list = AST15.identifier("promises");
180838
180973
  const return_value = AST15.memberExpression(request_context, AST15.identifier("returnValue"));
@@ -180994,7 +181129,7 @@ function add_load({
180994
181129
  ),
180995
181130
  AST15.objectProperty(
180996
181131
  AST15.literal("hookFn"),
180997
- AST15.identifier("onError")
181132
+ AST15.identifier(houdini_on_error_fn)
180998
181133
  ),
180999
181134
  AST15.objectProperty(
181000
181135
  AST15.literal("error"),
@@ -181012,14 +181147,14 @@ function add_load({
181012
181147
  );
181013
181148
  if (before_load) {
181014
181149
  if (before_load) {
181015
- preload_fn.body.body.splice(1, 0, load_hook_statements("beforeLoad", ...args));
181150
+ preload_fn.body.body.splice(1, 0, load_hook_statements("before", ...args));
181016
181151
  }
181017
181152
  }
181018
181153
  if (after_load) {
181019
181154
  preload_fn.body.body.splice(
181020
181155
  preload_fn.body.body.length - 1,
181021
181156
  0,
181022
- load_hook_statements("afterLoad", ...args)
181157
+ load_hook_statements("after", ...args)
181023
181158
  );
181024
181159
  }
181025
181160
  }
@@ -181054,12 +181189,14 @@ function load_hook_statements(name2, request_context, input_id, result_id) {
181054
181189
  AST15.memberExpression(request_context, AST15.identifier("invokeLoadHook")),
181055
181190
  [
181056
181191
  AST15.objectExpression([
181192
+ AST15.objectProperty(AST15.literal("variant"), AST15.stringLiteral(name2)),
181057
181193
  AST15.objectProperty(
181058
- AST15.literal("variant"),
181059
- AST15.stringLiteral(name2 === "afterLoad" ? "after" : "before")
181194
+ AST15.literal("hookFn"),
181195
+ AST15.identifier(
181196
+ name2 === "before" ? houdini_before_load_fn : houdini_after_load_fn
181197
+ )
181060
181198
  ),
181061
- AST15.objectProperty(AST15.literal("hookFn"), AST15.identifier(name2)),
181062
- ...name2 === "afterLoad" ? [
181199
+ ...name2 === "after" ? [
181063
181200
  AST15.objectProperty(AST15.literal("input"), input_id),
181064
181201
  AST15.objectProperty(AST15.literal("data"), result_id)
181065
181202
  ] : []
@@ -181189,7 +181326,7 @@ function modify_load(page2, cb) {
181189
181326
  }
181190
181327
 
181191
181328
  // src/plugin/transforms/kit/index.ts
181192
- async function SvelteKitProcessor(config2, page2) {
181329
+ async function SvelteKitProcessor(config3, page2) {
181193
181330
  if (page2.framework !== "kit") {
181194
181331
  return;
181195
181332
  }
@@ -181312,8 +181449,8 @@ function walk2(ast, { enter, leave }) {
181312
181449
  // src/plugin/transforms/reactive.ts
181313
181450
  var recast17 = __toESM(require_main5(), 1);
181314
181451
  var AST17 = recast17.types.builders;
181315
- async function ReactiveProcessor(config2, page2) {
181316
- if (!is_component(config2, page2.framework, page2.filepath) && !is_route(config2, page2.framework, page2.filepath)) {
181452
+ async function ReactiveProcessor(config3, page2) {
181453
+ if (!is_component(config3, page2.framework, page2.filepath) && !is_route(config3, page2.framework, page2.filepath)) {
181317
181454
  return;
181318
181455
  }
181319
181456
  const magicFunctions = ["query", "graphql", "fragment", "paginatedFragment", "paginatedQuery"];
@@ -181375,12 +181512,12 @@ function filterTaggedTemplate(expr) {
181375
181512
  }
181376
181513
 
181377
181514
  // src/plugin/transforms/tags.ts
181378
- async function GraphQLTagProcessor(config2, page2) {
181379
- await find_graphql(config2, page2.script, {
181515
+ async function GraphQLTagProcessor(config3, page2) {
181516
+ await find_graphql(config3, page2.script, {
181380
181517
  dependency: page2.watch_file,
181381
181518
  tag(tag2) {
181382
181519
  const { node: node2, parsedDocument } = tag2;
181383
- const operation = config2.extractDefinition(parsedDocument);
181520
+ const operation = config3.extractDefinition(parsedDocument);
181384
181521
  node2.replaceWith(store_import({ page: page2, artifact: { name: operation.name.value } }).id);
181385
181522
  }
181386
181523
  });
@@ -181435,7 +181572,7 @@ var replace_between = (origin, startIndex, endIndex, insertion) => origin.substr
181435
181572
 
181436
181573
  // src/plugin/validate.ts
181437
181574
  async function validateDocuments({
181438
- config: config2,
181575
+ config: config3,
181439
181576
  documents
181440
181577
  }) {
181441
181578
  const forbiddenNames = [
@@ -181448,13 +181585,13 @@ async function validateDocuments({
181448
181585
  const errors = [];
181449
181586
  for (let i3 = 0; i3 < documents.length; i3++) {
181450
181587
  const doc = documents[i3];
181451
- if (forbiddenNames.includes(store_name({ config: config2, name: doc.name }))) {
181588
+ if (forbiddenNames.includes(store_name({ config: config3, name: doc.name }))) {
181452
181589
  errors.push(
181453
181590
  new HoudiniError({
181454
181591
  filepath: doc.filename,
181455
181592
  message: `Operation name "${doc.name}" forbidden (as Houdini uses "${store_name(
181456
181593
  {
181457
- config: config2,
181594
+ config: config3,
181458
181595
  name: doc.name
181459
181596
  }
181460
181597
  )}" internally), please change it to something else.`
@@ -181476,19 +181613,19 @@ var framework = "svelte";
181476
181613
  var HoudiniSveltePlugin = async () => ({
181477
181614
  extensions: [".svelte"],
181478
181615
  transform_runtime: {
181479
- "network.js": ({ config: config2, content }) => {
181616
+ "network.js": ({ config: config3, content }) => {
181480
181617
  const networkFilePath = path_exports.join(
181481
- config2.pluginRuntimeDirectory("houdini-svelte"),
181618
+ config3.pluginRuntimeDirectory("houdini-svelte"),
181482
181619
  "network.js"
181483
181620
  );
181484
181621
  const relativePath = path_exports.relative(
181485
181622
  path_exports.dirname(networkFilePath),
181486
- path_exports.join(config2.projectRoot, plugin_config(config2).client)
181623
+ path_exports.join(config3.projectRoot, plugin_config(config3).client)
181487
181624
  );
181488
181625
  return content.replace("HOUDINI_CLIENT_PATH", relativePath);
181489
181626
  },
181490
181627
  "adapter.js": ({ content }) => {
181491
- const sveltekit_adapter = `import { browser, prerendering } from '$app/environment'
181628
+ const sveltekit_adapter = `import { browser, building } from '$app/environment'
181492
181629
  import { error as svelteKitError } from '@sveltejs/kit'
181493
181630
 
181494
181631
  export const isBrowser = browser
@@ -181499,7 +181636,7 @@ export function setClientStarted() {
181499
181636
  clientStarted = true
181500
181637
  }
181501
181638
 
181502
- export const isPrerender = prerendering
181639
+ export const isPrerender = building
181503
181640
 
181504
181641
  export const error = svelteKitError
181505
181642
  `;
@@ -181514,15 +181651,15 @@ export const error = svelteKitError
181514
181651
  framework
181515
181652
  });
181516
181653
  },
181517
- index_file({ config: config2, content, export_star_from, plugin_root }) {
181518
- const storesDir = "./" + path_exports.relative(config2.rootDir, stores_directory(plugin_root)).split(path_exports.sep).join("/");
181654
+ index_file({ config: config3, content, export_star_from, plugin_root }) {
181655
+ const storesDir = "./" + path_exports.relative(config3.rootDir, stores_directory(plugin_root)).split(path_exports.sep).join("/");
181519
181656
  return content + export_star_from({ module: storesDir });
181520
181657
  },
181521
181658
  transform_file(page2) {
181522
181659
  return apply_transforms(framework, page2);
181523
181660
  },
181524
- include(config2, filepath) {
181525
- return config2.includeFile(resolve_relative(config2, filepath), { ignore_plugins: true });
181661
+ include(config3, filepath) {
181662
+ return config3.includeFile(resolve_relative(config3, filepath), { ignore_plugins: true });
181526
181663
  },
181527
181664
  vite: {
181528
181665
  ...fsPatch_default(() => framework)
@@ -181535,11 +181672,21 @@ export const error = svelteKitError
181535
181672
  description: `Here, both gives: ${store_name({ config: cfg, name: "QueryName" })}`
181536
181673
  });
181537
181674
  }
181538
- if (!cfg.configFile.plugins?.["houdini-svelte"].client) {
181675
+ const cfgPlugin = plugin_config(cfg);
181676
+ let client_file_exists = false;
181677
+ if (path_exports.extname(cfgPlugin.client)) {
181678
+ client_file_exists = !!await fs_exports.readFile(cfgPlugin.client);
181679
+ } else {
181680
+ client_file_exists = (await Promise.all([
181681
+ fs_exports.readFile(cfgPlugin.client + ".ts"),
181682
+ fs_exports.readFile(cfgPlugin.client + ".js")
181683
+ ])).some(Boolean);
181684
+ }
181685
+ if (!client_file_exists) {
181539
181686
  throw new HoudiniError({
181540
- filepath: cfg.filepath,
181541
- message: "Invalid config file: missing client value.",
181542
- 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."
181687
+ filepath: cfgPlugin.client,
181688
+ 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.`,
181689
+ 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."
181543
181690
  });
181544
181691
  }
181545
181692
  try {