houdini 1.0.0-next.1 → 1.0.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cmd/generate.d.ts +0 -1
- package/build/cmd-cjs/index.js +1400 -2836
- package/build/cmd-esm/index.js +1400 -2836
- package/build/codegen/generators/artifacts/fieldKey.d.ts +1 -1
- package/build/codegen/generators/artifacts/index.d.ts +1 -1
- package/build/codegen/generators/artifacts/indexFile.d.ts +1 -1
- package/build/codegen/generators/artifacts/inputs.d.ts +2 -2
- package/build/codegen/generators/artifacts/operations.d.ts +2 -2
- package/build/codegen/generators/artifacts/selection.d.ts +1 -1
- package/build/codegen/generators/artifacts/utils.d.ts +1 -1
- package/build/codegen/generators/definitions/enums.d.ts +1 -1
- package/build/codegen/generators/definitions/index.d.ts +1 -1
- package/build/codegen/generators/indexFile/index.d.ts +1 -1
- package/build/codegen/generators/persistedQueries/index.d.ts +1 -1
- package/build/codegen/generators/runtime/graphqlFunction.d.ts +2 -0
- package/build/codegen/generators/runtime/index.d.ts +1 -1
- package/build/codegen/generators/runtime/injectPlugins.d.ts +7 -0
- package/build/codegen/generators/runtime/pluginIndex.d.ts +5 -0
- package/build/codegen/generators/typescript/addReferencedInputTypes.d.ts +1 -1
- package/build/codegen/generators/typescript/documentTypes.d.ts +2 -0
- package/build/codegen/generators/typescript/{imperativeCache.d.ts → imperativeTypeDef.d.ts} +1 -1
- package/build/codegen/generators/typescript/index.d.ts +1 -1
- package/build/codegen/generators/typescript/inlineType.d.ts +1 -1
- package/build/codegen/generators/typescript/typeReference.d.ts +1 -1
- package/build/codegen/generators/typescript/types.d.ts +1 -1
- package/build/codegen/index.d.ts +1 -1
- package/build/codegen/transforms/addID.d.ts +1 -1
- package/build/codegen/transforms/composeQueries.d.ts +2 -2
- package/build/codegen/transforms/fragmentVariables.d.ts +3 -2
- package/build/codegen/transforms/list.d.ts +1 -1
- package/build/codegen/transforms/paginate.d.ts +1 -1
- package/build/codegen/transforms/schema.d.ts +1 -1
- package/build/codegen/transforms/typename.d.ts +1 -1
- package/build/codegen/utils/commonjs.d.ts +2 -0
- package/build/codegen/utils/flattenSelections.d.ts +2 -2
- package/build/codegen/utils/moduleExport.d.ts +1 -1
- package/build/codegen/utils/objectIdentificationSelection.d.ts +1 -1
- package/build/codegen/validators/noIDAlias.d.ts +1 -1
- package/build/codegen/validators/typeCheck.d.ts +1 -1
- package/build/codegen-cjs/index.js +1320 -2779
- package/build/codegen-esm/index.js +1320 -2779
- package/build/lib/config.d.ts +9 -4
- package/build/lib/fs.d.ts +1 -1
- package/build/lib/graphql.d.ts +1 -1
- package/build/lib/imports.d.ts +1 -1
- package/build/lib/types.d.ts +3 -3
- package/build/lib/walk.d.ts +8 -5
- package/build/lib-cjs/index.js +155 -1856
- package/build/lib-esm/index.js +155 -1856
- package/build/runtime/cache/cache.d.ts +10 -8
- package/build/runtime/cache/gc.d.ts +1 -1
- package/build/runtime/cache/lists.d.ts +3 -2
- package/build/runtime/cache/schema.d.ts +2 -2
- package/build/runtime/cache/stuff.d.ts +2 -2
- package/build/runtime/cache/subscription.d.ts +19 -11
- package/build/runtime/client/documentStore.d.ts +87 -0
- package/build/runtime/client/index.d.ts +25 -0
- package/build/runtime/client/plugins/cache.d.ts +8 -0
- package/build/runtime/client/plugins/fetch.d.ts +37 -0
- package/build/runtime/client/plugins/fetchParams.d.ts +9 -0
- package/build/runtime/client/plugins/index.d.ts +7 -0
- package/build/runtime/client/plugins/injectedPlugins.d.ts +3 -0
- package/build/runtime/client/plugins/mutation.d.ts +1 -0
- package/build/runtime/client/plugins/query.d.ts +2 -0
- package/build/runtime/client/plugins/subscription.d.ts +18 -0
- package/build/runtime/client/plugins/throwOnError.d.ts +7 -0
- package/build/runtime/client/utils/documentPlugins.d.ts +3 -0
- package/build/runtime/client/utils/index.d.ts +1 -0
- package/build/runtime/generated.d.ts +1 -0
- package/build/runtime/imports/config.d.ts +3 -0
- package/build/runtime/index.d.ts +3 -2
- package/build/runtime/lib/config.d.ts +26 -25
- package/build/runtime/lib/index.d.ts +1 -2
- package/build/runtime/lib/scalars.d.ts +6 -5
- package/build/runtime/lib/selection.d.ts +1 -1
- package/build/runtime/lib/store.d.ts +19 -0
- package/build/runtime/lib/types.d.ts +22 -9
- package/build/runtime/public/cache.d.ts +20 -7
- package/build/runtime/public/list.d.ts +2 -2
- package/build/runtime/public/record.d.ts +18 -18
- package/build/runtime/public/tests/test.d.ts +44 -1
- package/build/runtime/public/types.d.ts +8 -0
- package/build/runtime-cjs/cache/cache.d.ts +10 -8
- package/build/runtime-cjs/cache/cache.js +5 -11
- package/build/runtime-cjs/cache/gc.d.ts +1 -1
- package/build/runtime-cjs/cache/lists.d.ts +3 -2
- package/build/runtime-cjs/cache/lists.js +5 -2
- package/build/runtime-cjs/cache/schema.d.ts +2 -2
- package/build/runtime-cjs/cache/stuff.d.ts +2 -2
- package/build/runtime-cjs/cache/subscription.d.ts +19 -11
- package/build/runtime-cjs/cache/subscription.js +95 -56
- package/build/runtime-cjs/client/documentStore.d.ts +87 -0
- package/build/runtime-cjs/client/documentStore.js +360 -0
- package/build/runtime-cjs/client/index.d.ts +25 -0
- package/build/runtime-cjs/client/index.js +87 -0
- package/build/runtime-cjs/client/plugins/cache.d.ts +8 -0
- package/build/runtime-cjs/client/plugins/cache.js +99 -0
- package/build/runtime-cjs/client/plugins/fetch.d.ts +37 -0
- package/build/runtime-cjs/{lib/networkUtils.js → client/plugins/fetch.js} +95 -3
- package/build/runtime-cjs/client/plugins/fetchParams.d.ts +9 -0
- package/build/runtime-cjs/client/plugins/fetchParams.js +40 -0
- package/build/runtime-cjs/client/plugins/index.d.ts +7 -0
- package/build/runtime-cjs/client/plugins/index.js +24 -0
- package/build/runtime-cjs/client/plugins/injectedPlugins.d.ts +3 -0
- package/build/runtime-cjs/{lib/errors.js → client/plugins/injectedPlugins.js} +7 -15
- package/build/runtime-cjs/client/plugins/mutation.d.ts +1 -0
- package/build/runtime-cjs/client/plugins/mutation.js +86 -0
- package/build/runtime-cjs/client/plugins/query.d.ts +2 -0
- package/build/runtime-cjs/client/plugins/query.js +83 -0
- package/build/runtime-cjs/client/plugins/subscription.d.ts +18 -0
- package/build/runtime-cjs/client/plugins/subscription.js +98 -0
- package/build/runtime-cjs/client/plugins/throwOnError.d.ts +7 -0
- package/build/runtime-cjs/client/plugins/throwOnError.js +47 -0
- package/build/runtime-cjs/client/utils/documentPlugins.d.ts +3 -0
- package/build/runtime-cjs/client/utils/documentPlugins.js +56 -0
- package/build/runtime-cjs/client/utils/index.d.ts +1 -0
- package/build/runtime-cjs/client/utils/index.js +18 -0
- package/build/runtime-cjs/generated.d.ts +1 -0
- package/build/runtime-cjs/imports/config.d.ts +3 -0
- package/build/runtime-cjs/imports/config.js +26 -0
- package/build/runtime-cjs/index.d.ts +3 -2
- package/build/runtime-cjs/index.js +1 -0
- package/build/runtime-cjs/lib/config.d.ts +26 -25
- package/build/runtime-cjs/lib/config.js +5 -4
- package/build/runtime-cjs/lib/index.d.ts +1 -2
- package/build/runtime-cjs/lib/index.js +1 -2
- package/build/runtime-cjs/lib/scalars.d.ts +6 -5
- package/build/runtime-cjs/lib/scalars.js +20 -24
- package/build/runtime-cjs/lib/selection.d.ts +1 -1
- package/build/runtime-cjs/lib/store.d.ts +19 -0
- package/build/runtime-cjs/lib/store.js +81 -0
- package/build/runtime-cjs/lib/types.d.ts +22 -9
- package/build/runtime-cjs/public/cache.d.ts +20 -7
- package/build/runtime-cjs/public/cache.js +29 -32
- package/build/runtime-cjs/public/list.d.ts +2 -2
- package/build/runtime-cjs/public/list.js +6 -28
- package/build/runtime-cjs/public/record.d.ts +18 -18
- package/build/runtime-cjs/public/record.js +23 -189
- package/build/runtime-cjs/public/tests/test.d.ts +44 -1
- package/build/runtime-cjs/public/tests/test.js +27 -2
- package/build/runtime-cjs/public/types.d.ts +8 -0
- package/build/runtime-esm/cache/cache.d.ts +10 -8
- package/build/runtime-esm/cache/cache.js +5 -11
- package/build/runtime-esm/cache/gc.d.ts +1 -1
- package/build/runtime-esm/cache/lists.d.ts +3 -2
- package/build/runtime-esm/cache/lists.js +5 -2
- package/build/runtime-esm/cache/schema.d.ts +2 -2
- package/build/runtime-esm/cache/stuff.d.ts +2 -2
- package/build/runtime-esm/cache/subscription.d.ts +19 -11
- package/build/runtime-esm/cache/subscription.js +95 -56
- package/build/runtime-esm/client/documentStore.d.ts +87 -0
- package/build/runtime-esm/client/documentStore.js +336 -0
- package/build/runtime-esm/client/index.d.ts +25 -0
- package/build/runtime-esm/client/index.js +58 -0
- package/build/runtime-esm/client/plugins/cache.d.ts +8 -0
- package/build/runtime-esm/client/plugins/cache.js +69 -0
- package/build/runtime-esm/client/plugins/fetch.d.ts +37 -0
- package/build/runtime-esm/client/plugins/fetch.js +151 -0
- package/build/runtime-esm/client/plugins/fetchParams.d.ts +9 -0
- package/build/runtime-esm/client/plugins/fetchParams.js +16 -0
- package/build/runtime-esm/client/plugins/index.d.ts +7 -0
- package/build/runtime-esm/client/plugins/index.js +7 -0
- package/build/runtime-esm/client/plugins/injectedPlugins.d.ts +3 -0
- package/build/runtime-esm/client/plugins/injectedPlugins.js +5 -0
- package/build/runtime-esm/client/plugins/mutation.d.ts +1 -0
- package/build/runtime-esm/client/plugins/mutation.js +56 -0
- package/build/runtime-esm/client/plugins/query.d.ts +2 -0
- package/build/runtime-esm/client/plugins/query.js +53 -0
- package/build/runtime-esm/client/plugins/subscription.d.ts +18 -0
- package/build/runtime-esm/client/plugins/subscription.js +74 -0
- package/build/runtime-esm/client/plugins/throwOnError.d.ts +7 -0
- package/build/runtime-esm/client/plugins/throwOnError.js +23 -0
- package/build/runtime-esm/client/utils/documentPlugins.d.ts +3 -0
- package/build/runtime-esm/client/utils/documentPlugins.js +32 -0
- package/build/runtime-esm/client/utils/index.d.ts +1 -0
- package/build/runtime-esm/client/utils/index.js +1 -0
- package/build/runtime-esm/generated.d.ts +1 -0
- package/build/runtime-esm/imports/config.d.ts +3 -0
- package/build/runtime-esm/imports/config.js +4 -0
- package/build/runtime-esm/index.d.ts +3 -2
- package/build/runtime-esm/index.js +1 -0
- package/build/runtime-esm/lib/config.d.ts +26 -25
- package/build/runtime-esm/lib/config.js +5 -4
- package/build/runtime-esm/lib/index.d.ts +1 -2
- package/build/runtime-esm/lib/index.js +1 -2
- package/build/runtime-esm/lib/scalars.d.ts +6 -5
- package/build/runtime-esm/lib/scalars.js +20 -24
- package/build/runtime-esm/lib/selection.d.ts +1 -1
- package/build/runtime-esm/lib/store.d.ts +19 -0
- package/build/runtime-esm/lib/store.js +57 -0
- package/build/runtime-esm/lib/types.d.ts +22 -9
- package/build/runtime-esm/public/cache.d.ts +20 -7
- package/build/runtime-esm/public/cache.js +28 -30
- package/build/runtime-esm/public/list.d.ts +2 -2
- package/build/runtime-esm/public/list.js +6 -28
- package/build/runtime-esm/public/record.d.ts +18 -18
- package/build/runtime-esm/public/record.js +22 -185
- package/build/runtime-esm/public/tests/test.d.ts +44 -1
- package/build/runtime-esm/public/tests/test.js +26 -1
- package/build/runtime-esm/public/types.d.ts +8 -0
- package/build/test/index.d.ts +4 -3
- package/build/test-cjs/index.js +1334 -2766
- package/build/test-esm/index.js +1334 -2766
- package/build/vite/ast.d.ts +1 -1
- package/build/vite/houdini.d.ts +1 -1
- package/build/vite/imports.d.ts +3 -3
- package/build/vite/index.d.ts +1 -1
- package/build/vite/schema.d.ts +1 -1
- package/build/vite-cjs/index.js +1395 -2821
- package/build/vite-esm/index.js +1395 -2821
- package/package.json +1 -1
- package/build/runtime/lib/errors.d.ts +0 -3
- package/build/runtime/lib/network.d.ts +0 -79
- package/build/runtime/lib/networkUtils.d.ts +0 -8
- package/build/runtime-cjs/lib/errors.d.ts +0 -3
- package/build/runtime-cjs/lib/network.d.ts +0 -79
- package/build/runtime-cjs/lib/network.js +0 -200
- package/build/runtime-cjs/lib/networkUtils.d.ts +0 -8
- package/build/runtime-esm/lib/errors.d.ts +0 -3
- package/build/runtime-esm/lib/errors.js +0 -11
- package/build/runtime-esm/lib/network.d.ts +0 -79
- package/build/runtime-esm/lib/network.js +0 -170
- package/build/runtime-esm/lib/networkUtils.d.ts +0 -8
- package/build/runtime-esm/lib/networkUtils.js +0 -60
package/build/lib-cjs/index.js
CHANGED
|
@@ -9518,18 +9518,18 @@ var require_execute = __commonJS({
|
|
|
9518
9518
|
}
|
|
9519
9519
|
var returnType = fieldDef.type;
|
|
9520
9520
|
var resolveFn = (_fieldDef$resolve = fieldDef.resolve) !== null && _fieldDef$resolve !== void 0 ? _fieldDef$resolve : exeContext.fieldResolver;
|
|
9521
|
-
var
|
|
9521
|
+
var info = buildResolveInfo(exeContext, fieldDef, fieldNodes, parentType, path2);
|
|
9522
9522
|
try {
|
|
9523
9523
|
var args = (0, _values.getArgumentValues)(fieldDef, fieldNodes[0], exeContext.variableValues);
|
|
9524
9524
|
var _contextValue = exeContext.contextValue;
|
|
9525
|
-
var result = resolveFn(source, args, _contextValue,
|
|
9525
|
+
var result = resolveFn(source, args, _contextValue, info);
|
|
9526
9526
|
var completed;
|
|
9527
9527
|
if ((0, _isPromise.default)(result)) {
|
|
9528
9528
|
completed = result.then(function(resolved) {
|
|
9529
|
-
return completeValue(exeContext, returnType, fieldNodes,
|
|
9529
|
+
return completeValue(exeContext, returnType, fieldNodes, info, path2, resolved);
|
|
9530
9530
|
});
|
|
9531
9531
|
} else {
|
|
9532
|
-
completed = completeValue(exeContext, returnType, fieldNodes,
|
|
9532
|
+
completed = completeValue(exeContext, returnType, fieldNodes, info, path2, result);
|
|
9533
9533
|
}
|
|
9534
9534
|
if ((0, _isPromise.default)(completed)) {
|
|
9535
9535
|
return completed.then(void 0, function(rawError) {
|
|
@@ -9564,14 +9564,14 @@ var require_execute = __commonJS({
|
|
|
9564
9564
|
exeContext.errors.push(error);
|
|
9565
9565
|
return null;
|
|
9566
9566
|
}
|
|
9567
|
-
function completeValue(exeContext, returnType, fieldNodes,
|
|
9567
|
+
function completeValue(exeContext, returnType, fieldNodes, info, path2, result) {
|
|
9568
9568
|
if (result instanceof Error) {
|
|
9569
9569
|
throw result;
|
|
9570
9570
|
}
|
|
9571
9571
|
if ((0, _definition.isNonNullType)(returnType)) {
|
|
9572
|
-
var completed = completeValue(exeContext, returnType.ofType, fieldNodes,
|
|
9572
|
+
var completed = completeValue(exeContext, returnType.ofType, fieldNodes, info, path2, result);
|
|
9573
9573
|
if (completed === null) {
|
|
9574
|
-
throw new Error("Cannot return null for non-nullable field ".concat(
|
|
9574
|
+
throw new Error("Cannot return null for non-nullable field ".concat(info.parentType.name, ".").concat(info.fieldName, "."));
|
|
9575
9575
|
}
|
|
9576
9576
|
return completed;
|
|
9577
9577
|
}
|
|
@@ -9579,20 +9579,20 @@ var require_execute = __commonJS({
|
|
|
9579
9579
|
return null;
|
|
9580
9580
|
}
|
|
9581
9581
|
if ((0, _definition.isListType)(returnType)) {
|
|
9582
|
-
return completeListValue(exeContext, returnType, fieldNodes,
|
|
9582
|
+
return completeListValue(exeContext, returnType, fieldNodes, info, path2, result);
|
|
9583
9583
|
}
|
|
9584
9584
|
if ((0, _definition.isLeafType)(returnType)) {
|
|
9585
9585
|
return completeLeafValue(returnType, result);
|
|
9586
9586
|
}
|
|
9587
9587
|
if ((0, _definition.isAbstractType)(returnType)) {
|
|
9588
|
-
return completeAbstractValue(exeContext, returnType, fieldNodes,
|
|
9588
|
+
return completeAbstractValue(exeContext, returnType, fieldNodes, info, path2, result);
|
|
9589
9589
|
}
|
|
9590
9590
|
if ((0, _definition.isObjectType)(returnType)) {
|
|
9591
|
-
return completeObjectValue(exeContext, returnType, fieldNodes,
|
|
9591
|
+
return completeObjectValue(exeContext, returnType, fieldNodes, info, path2, result);
|
|
9592
9592
|
}
|
|
9593
9593
|
(0, _invariant.default)(0, "Cannot complete value of unexpected output type: " + (0, _inspect.default)(returnType));
|
|
9594
9594
|
}
|
|
9595
|
-
function completeListValue(exeContext, returnType, fieldNodes,
|
|
9595
|
+
function completeListValue(exeContext, returnType, fieldNodes, info, path2, result) {
|
|
9596
9596
|
var itemType = returnType.ofType;
|
|
9597
9597
|
var containsPromise = false;
|
|
9598
9598
|
var completedResults = (0, _safeArrayFrom.default)(result, function(item, index) {
|
|
@@ -9601,10 +9601,10 @@ var require_execute = __commonJS({
|
|
|
9601
9601
|
var completedItem;
|
|
9602
9602
|
if ((0, _isPromise.default)(item)) {
|
|
9603
9603
|
completedItem = item.then(function(resolved) {
|
|
9604
|
-
return completeValue(exeContext, itemType, fieldNodes,
|
|
9604
|
+
return completeValue(exeContext, itemType, fieldNodes, info, itemPath, resolved);
|
|
9605
9605
|
});
|
|
9606
9606
|
} else {
|
|
9607
|
-
completedItem = completeValue(exeContext, itemType, fieldNodes,
|
|
9607
|
+
completedItem = completeValue(exeContext, itemType, fieldNodes, info, itemPath, item);
|
|
9608
9608
|
}
|
|
9609
9609
|
if ((0, _isPromise.default)(completedItem)) {
|
|
9610
9610
|
containsPromise = true;
|
|
@@ -9620,7 +9620,7 @@ var require_execute = __commonJS({
|
|
|
9620
9620
|
}
|
|
9621
9621
|
});
|
|
9622
9622
|
if (completedResults == null) {
|
|
9623
|
-
throw new _GraphQLError.GraphQLError('Expected Iterable, but did not find one for field "'.concat(
|
|
9623
|
+
throw new _GraphQLError.GraphQLError('Expected Iterable, but did not find one for field "'.concat(info.parentType.name, ".").concat(info.fieldName, '".'));
|
|
9624
9624
|
}
|
|
9625
9625
|
return containsPromise ? Promise.all(completedResults) : completedResults;
|
|
9626
9626
|
}
|
|
@@ -9631,25 +9631,25 @@ var require_execute = __commonJS({
|
|
|
9631
9631
|
}
|
|
9632
9632
|
return serializedResult;
|
|
9633
9633
|
}
|
|
9634
|
-
function completeAbstractValue(exeContext, returnType, fieldNodes,
|
|
9634
|
+
function completeAbstractValue(exeContext, returnType, fieldNodes, info, path2, result) {
|
|
9635
9635
|
var _returnType$resolveTy;
|
|
9636
9636
|
var resolveTypeFn = (_returnType$resolveTy = returnType.resolveType) !== null && _returnType$resolveTy !== void 0 ? _returnType$resolveTy : exeContext.typeResolver;
|
|
9637
9637
|
var contextValue = exeContext.contextValue;
|
|
9638
|
-
var runtimeType = resolveTypeFn(result, contextValue,
|
|
9638
|
+
var runtimeType = resolveTypeFn(result, contextValue, info, returnType);
|
|
9639
9639
|
if ((0, _isPromise.default)(runtimeType)) {
|
|
9640
9640
|
return runtimeType.then(function(resolvedRuntimeType) {
|
|
9641
|
-
return completeObjectValue(exeContext, ensureValidRuntimeType(resolvedRuntimeType, exeContext, returnType, fieldNodes,
|
|
9641
|
+
return completeObjectValue(exeContext, ensureValidRuntimeType(resolvedRuntimeType, exeContext, returnType, fieldNodes, info, result), fieldNodes, info, path2, result);
|
|
9642
9642
|
});
|
|
9643
9643
|
}
|
|
9644
|
-
return completeObjectValue(exeContext, ensureValidRuntimeType(runtimeType, exeContext, returnType, fieldNodes,
|
|
9644
|
+
return completeObjectValue(exeContext, ensureValidRuntimeType(runtimeType, exeContext, returnType, fieldNodes, info, result), fieldNodes, info, path2, result);
|
|
9645
9645
|
}
|
|
9646
|
-
function ensureValidRuntimeType(runtimeTypeOrName, exeContext, returnType, fieldNodes,
|
|
9646
|
+
function ensureValidRuntimeType(runtimeTypeOrName, exeContext, returnType, fieldNodes, info, result) {
|
|
9647
9647
|
if (runtimeTypeOrName == null) {
|
|
9648
|
-
throw new _GraphQLError.GraphQLError('Abstract type "'.concat(returnType.name, '" must resolve to an Object type at runtime for field "').concat(
|
|
9648
|
+
throw new _GraphQLError.GraphQLError('Abstract type "'.concat(returnType.name, '" must resolve to an Object type at runtime for field "').concat(info.parentType.name, ".").concat(info.fieldName, '". Either the "').concat(returnType.name, '" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.'), fieldNodes);
|
|
9649
9649
|
}
|
|
9650
9650
|
var runtimeTypeName = (0, _definition.isNamedType)(runtimeTypeOrName) ? runtimeTypeOrName.name : runtimeTypeOrName;
|
|
9651
9651
|
if (typeof runtimeTypeName !== "string") {
|
|
9652
|
-
throw new _GraphQLError.GraphQLError('Abstract type "'.concat(returnType.name, '" must resolve to an Object type at runtime for field "').concat(
|
|
9652
|
+
throw new _GraphQLError.GraphQLError('Abstract type "'.concat(returnType.name, '" must resolve to an Object type at runtime for field "').concat(info.parentType.name, ".").concat(info.fieldName, '" with ') + "value ".concat((0, _inspect.default)(result), ', received "').concat((0, _inspect.default)(runtimeTypeOrName), '".'));
|
|
9653
9653
|
}
|
|
9654
9654
|
var runtimeType = exeContext.schema.getType(runtimeTypeName);
|
|
9655
9655
|
if (runtimeType == null) {
|
|
@@ -9663,9 +9663,9 @@ var require_execute = __commonJS({
|
|
|
9663
9663
|
}
|
|
9664
9664
|
return runtimeType;
|
|
9665
9665
|
}
|
|
9666
|
-
function completeObjectValue(exeContext, returnType, fieldNodes,
|
|
9666
|
+
function completeObjectValue(exeContext, returnType, fieldNodes, info, path2, result) {
|
|
9667
9667
|
if (returnType.isTypeOf) {
|
|
9668
|
-
var isTypeOf = returnType.isTypeOf(result, exeContext.contextValue,
|
|
9668
|
+
var isTypeOf = returnType.isTypeOf(result, exeContext.contextValue, info);
|
|
9669
9669
|
if ((0, _isPromise.default)(isTypeOf)) {
|
|
9670
9670
|
return isTypeOf.then(function(resolvedIsTypeOf) {
|
|
9671
9671
|
if (!resolvedIsTypeOf) {
|
|
@@ -9699,16 +9699,16 @@ var require_execute = __commonJS({
|
|
|
9699
9699
|
}
|
|
9700
9700
|
return subFieldNodes;
|
|
9701
9701
|
}
|
|
9702
|
-
var defaultTypeResolver = function defaultTypeResolver2(value, contextValue,
|
|
9702
|
+
var defaultTypeResolver = function defaultTypeResolver2(value, contextValue, info, abstractType) {
|
|
9703
9703
|
if ((0, _isObjectLike.default)(value) && typeof value.__typename === "string") {
|
|
9704
9704
|
return value.__typename;
|
|
9705
9705
|
}
|
|
9706
|
-
var possibleTypes =
|
|
9706
|
+
var possibleTypes = info.schema.getPossibleTypes(abstractType);
|
|
9707
9707
|
var promisedIsTypeOfResults = [];
|
|
9708
9708
|
for (var i2 = 0; i2 < possibleTypes.length; i2++) {
|
|
9709
9709
|
var type = possibleTypes[i2];
|
|
9710
9710
|
if (type.isTypeOf) {
|
|
9711
|
-
var isTypeOfResult = type.isTypeOf(value, contextValue,
|
|
9711
|
+
var isTypeOfResult = type.isTypeOf(value, contextValue, info);
|
|
9712
9712
|
if ((0, _isPromise.default)(isTypeOfResult)) {
|
|
9713
9713
|
promisedIsTypeOfResults[i2] = isTypeOfResult;
|
|
9714
9714
|
} else if (isTypeOfResult) {
|
|
@@ -9727,11 +9727,11 @@ var require_execute = __commonJS({
|
|
|
9727
9727
|
}
|
|
9728
9728
|
};
|
|
9729
9729
|
exports.defaultTypeResolver = defaultTypeResolver;
|
|
9730
|
-
var defaultFieldResolver = function defaultFieldResolver2(source, args, contextValue,
|
|
9730
|
+
var defaultFieldResolver = function defaultFieldResolver2(source, args, contextValue, info) {
|
|
9731
9731
|
if ((0, _isObjectLike.default)(source) || typeof source === "function") {
|
|
9732
|
-
var property = source[
|
|
9732
|
+
var property = source[info.fieldName];
|
|
9733
9733
|
if (typeof property === "function") {
|
|
9734
|
-
return source[
|
|
9734
|
+
return source[info.fieldName](args, contextValue, info);
|
|
9735
9735
|
}
|
|
9736
9736
|
return property;
|
|
9737
9737
|
}
|
|
@@ -10751,13 +10751,13 @@ var require_subscribe = __commonJS({
|
|
|
10751
10751
|
throw new _GraphQLError.GraphQLError('The subscription field "'.concat(fieldName, '" is not defined.'), fieldNodes);
|
|
10752
10752
|
}
|
|
10753
10753
|
var path2 = (0, _Path.addPath)(void 0, responseName, type.name);
|
|
10754
|
-
var
|
|
10754
|
+
var info = (0, _execute.buildResolveInfo)(exeContext, fieldDef, fieldNodes, type, path2);
|
|
10755
10755
|
return new Promise(function(resolveResult) {
|
|
10756
10756
|
var _fieldDef$subscribe;
|
|
10757
10757
|
var args = (0, _values.getArgumentValues)(fieldDef, fieldNodes[0], variableValues);
|
|
10758
10758
|
var contextValue = exeContext.contextValue;
|
|
10759
10759
|
var resolveFn = (_fieldDef$subscribe = fieldDef.subscribe) !== null && _fieldDef$subscribe !== void 0 ? _fieldDef$subscribe : exeContext.fieldResolver;
|
|
10760
|
-
resolveResult(resolveFn(rootValue, args, contextValue,
|
|
10760
|
+
resolveResult(resolveFn(rootValue, args, contextValue, info));
|
|
10761
10761
|
}).then(function(eventStream) {
|
|
10762
10762
|
if (eventStream instanceof Error) {
|
|
10763
10763
|
throw (0, _locatedError.locatedError)(eventStream, fieldNodes, (0, _Path.pathToArray)(path2));
|
|
@@ -20565,42 +20565,42 @@ var require_node = __commonJS({
|
|
|
20565
20565
|
return Link2;
|
|
20566
20566
|
}(events_1.EventEmitter);
|
|
20567
20567
|
exports.Link = Link;
|
|
20568
|
-
var
|
|
20569
|
-
function
|
|
20568
|
+
var File3 = function() {
|
|
20569
|
+
function File4(link, node, flags, fd) {
|
|
20570
20570
|
this.position = 0;
|
|
20571
20571
|
this.link = link;
|
|
20572
20572
|
this.node = node;
|
|
20573
20573
|
this.flags = flags;
|
|
20574
20574
|
this.fd = fd;
|
|
20575
20575
|
}
|
|
20576
|
-
|
|
20576
|
+
File4.prototype.getString = function(encoding) {
|
|
20577
20577
|
if (encoding === void 0) {
|
|
20578
20578
|
encoding = "utf8";
|
|
20579
20579
|
}
|
|
20580
20580
|
return this.node.getString();
|
|
20581
20581
|
};
|
|
20582
|
-
|
|
20582
|
+
File4.prototype.setString = function(str) {
|
|
20583
20583
|
this.node.setString(str);
|
|
20584
20584
|
};
|
|
20585
|
-
|
|
20585
|
+
File4.prototype.getBuffer = function() {
|
|
20586
20586
|
return this.node.getBuffer();
|
|
20587
20587
|
};
|
|
20588
|
-
|
|
20588
|
+
File4.prototype.setBuffer = function(buf) {
|
|
20589
20589
|
this.node.setBuffer(buf);
|
|
20590
20590
|
};
|
|
20591
|
-
|
|
20591
|
+
File4.prototype.getSize = function() {
|
|
20592
20592
|
return this.node.getSize();
|
|
20593
20593
|
};
|
|
20594
|
-
|
|
20594
|
+
File4.prototype.truncate = function(len) {
|
|
20595
20595
|
this.node.truncate(len);
|
|
20596
20596
|
};
|
|
20597
|
-
|
|
20597
|
+
File4.prototype.seekTo = function(position) {
|
|
20598
20598
|
this.position = position;
|
|
20599
20599
|
};
|
|
20600
|
-
|
|
20600
|
+
File4.prototype.stats = function() {
|
|
20601
20601
|
return Stats_1.default.build(this.node);
|
|
20602
20602
|
};
|
|
20603
|
-
|
|
20603
|
+
File4.prototype.write = function(buf, offset, length, position) {
|
|
20604
20604
|
if (offset === void 0) {
|
|
20605
20605
|
offset = 0;
|
|
20606
20606
|
}
|
|
@@ -20615,7 +20615,7 @@ var require_node = __commonJS({
|
|
|
20615
20615
|
this.position = position + bytes;
|
|
20616
20616
|
return bytes;
|
|
20617
20617
|
};
|
|
20618
|
-
|
|
20618
|
+
File4.prototype.read = function(buf, offset, length, position) {
|
|
20619
20619
|
if (offset === void 0) {
|
|
20620
20620
|
offset = 0;
|
|
20621
20621
|
}
|
|
@@ -20628,15 +20628,15 @@ var require_node = __commonJS({
|
|
|
20628
20628
|
this.position = position + bytes;
|
|
20629
20629
|
return bytes;
|
|
20630
20630
|
};
|
|
20631
|
-
|
|
20631
|
+
File4.prototype.chmod = function(perm) {
|
|
20632
20632
|
this.node.chmod(perm);
|
|
20633
20633
|
};
|
|
20634
|
-
|
|
20634
|
+
File4.prototype.chown = function(uid, gid) {
|
|
20635
20635
|
this.node.chown(uid, gid);
|
|
20636
20636
|
};
|
|
20637
|
-
return
|
|
20637
|
+
return File4;
|
|
20638
20638
|
}();
|
|
20639
|
-
exports.File =
|
|
20639
|
+
exports.File = File3;
|
|
20640
20640
|
}
|
|
20641
20641
|
});
|
|
20642
20642
|
|
|
@@ -26745,9 +26745,9 @@ var require_streams = __commonJS({
|
|
|
26745
26745
|
}
|
|
26746
26746
|
}
|
|
26747
26747
|
try {
|
|
26748
|
-
const { Blob:
|
|
26749
|
-
if (
|
|
26750
|
-
|
|
26748
|
+
const { Blob: Blob3 } = require("buffer");
|
|
26749
|
+
if (Blob3 && !Blob3.prototype.stream) {
|
|
26750
|
+
Blob3.prototype.stream = function name(params) {
|
|
26751
26751
|
let position = 0;
|
|
26752
26752
|
const blob = this;
|
|
26753
26753
|
return new ReadableStream({
|
|
@@ -26798,12 +26798,12 @@ async function* toIterator(parts, clone2 = true) {
|
|
|
26798
26798
|
}
|
|
26799
26799
|
}
|
|
26800
26800
|
}
|
|
26801
|
-
var import_streams, POOL_SIZE, _Blob,
|
|
26801
|
+
var import_streams, POOL_SIZE, _Blob, Blob2, fetch_blob_default;
|
|
26802
26802
|
var init_fetch_blob = __esm({
|
|
26803
26803
|
"../../node_modules/.pnpm/fetch-blob@3.2.0/node_modules/fetch-blob/index.js"() {
|
|
26804
26804
|
import_streams = __toESM(require_streams(), 1);
|
|
26805
26805
|
POOL_SIZE = 65536;
|
|
26806
|
-
_Blob = class
|
|
26806
|
+
_Blob = class Blob {
|
|
26807
26807
|
#parts = [];
|
|
26808
26808
|
#type = "";
|
|
26809
26809
|
#size = 0;
|
|
@@ -26827,7 +26827,7 @@ var init_fetch_blob = __esm({
|
|
|
26827
26827
|
part = new Uint8Array(element.buffer.slice(element.byteOffset, element.byteOffset + element.byteLength));
|
|
26828
26828
|
} else if (element instanceof ArrayBuffer) {
|
|
26829
26829
|
part = new Uint8Array(element.slice(0));
|
|
26830
|
-
} else if (element instanceof
|
|
26830
|
+
} else if (element instanceof Blob) {
|
|
26831
26831
|
part = element;
|
|
26832
26832
|
} else {
|
|
26833
26833
|
part = encoder.encode(`${element}`);
|
|
@@ -26906,7 +26906,7 @@ var init_fetch_blob = __esm({
|
|
|
26906
26906
|
relativeStart = 0;
|
|
26907
26907
|
}
|
|
26908
26908
|
}
|
|
26909
|
-
const blob = new
|
|
26909
|
+
const blob = new Blob([], { type: String(type).toLowerCase() });
|
|
26910
26910
|
blob.#size = span;
|
|
26911
26911
|
blob.#parts = blobParts;
|
|
26912
26912
|
return blob;
|
|
@@ -26923,17 +26923,17 @@ var init_fetch_blob = __esm({
|
|
|
26923
26923
|
type: { enumerable: true },
|
|
26924
26924
|
slice: { enumerable: true }
|
|
26925
26925
|
});
|
|
26926
|
-
|
|
26927
|
-
fetch_blob_default =
|
|
26926
|
+
Blob2 = _Blob;
|
|
26927
|
+
fetch_blob_default = Blob2;
|
|
26928
26928
|
}
|
|
26929
26929
|
});
|
|
26930
26930
|
|
|
26931
26931
|
// ../../node_modules/.pnpm/fetch-blob@3.2.0/node_modules/fetch-blob/file.js
|
|
26932
|
-
var _File,
|
|
26932
|
+
var _File, File2, file_default;
|
|
26933
26933
|
var init_file = __esm({
|
|
26934
26934
|
"../../node_modules/.pnpm/fetch-blob@3.2.0/node_modules/fetch-blob/file.js"() {
|
|
26935
26935
|
init_fetch_blob();
|
|
26936
|
-
_File = class
|
|
26936
|
+
_File = class File extends fetch_blob_default {
|
|
26937
26937
|
#lastModified = 0;
|
|
26938
26938
|
#name = "";
|
|
26939
26939
|
constructor(fileBits, fileName, options = {}) {
|
|
@@ -26962,8 +26962,8 @@ var init_file = __esm({
|
|
|
26962
26962
|
return !!object && object instanceof fetch_blob_default && /^(File)$/.test(object[Symbol.toStringTag]);
|
|
26963
26963
|
}
|
|
26964
26964
|
};
|
|
26965
|
-
|
|
26966
|
-
file_default =
|
|
26965
|
+
File2 = _File;
|
|
26966
|
+
file_default = File2;
|
|
26967
26967
|
}
|
|
26968
26968
|
});
|
|
26969
26969
|
|
|
@@ -26981,7 +26981,7 @@ Content-Type: ${v.type || "application/octet-stream"}\r
|
|
|
26981
26981
|
c.push(`--${b}--`);
|
|
26982
26982
|
return new B(c, { type: "multipart/form-data; boundary=" + b });
|
|
26983
26983
|
}
|
|
26984
|
-
var t, i, h, r, m, f, e, x,
|
|
26984
|
+
var t, i, h, r, m, f, e, x, FormData;
|
|
26985
26985
|
var init_esm_min = __esm({
|
|
26986
26986
|
"../../node_modules/.pnpm/formdata-polyfill@4.0.10/node_modules/formdata-polyfill/esm.min.js"() {
|
|
26987
26987
|
init_fetch_blob();
|
|
@@ -26996,7 +26996,7 @@ var init_esm_min = __esm({
|
|
|
26996
26996
|
throw new TypeError(`Failed to execute '${n}' on 'FormData': ${e2} arguments required, but only ${a.length} present.`);
|
|
26997
26997
|
}
|
|
26998
26998
|
};
|
|
26999
|
-
|
|
26999
|
+
FormData = class FormData2 {
|
|
27000
27000
|
#d = [];
|
|
27001
27001
|
constructor(...a) {
|
|
27002
27002
|
if (a.length)
|
|
@@ -27162,7 +27162,7 @@ async function toFormData(Body2, ct) {
|
|
|
27162
27162
|
let contentType;
|
|
27163
27163
|
let filename;
|
|
27164
27164
|
const entryChunks = [];
|
|
27165
|
-
const formData = new
|
|
27165
|
+
const formData = new FormData();
|
|
27166
27166
|
const onPartData = (ui8a) => {
|
|
27167
27167
|
entryValue += decoder.decode(ui8a, { stream: true });
|
|
27168
27168
|
};
|
|
@@ -54373,18 +54373,18 @@ var require_lines = __commonJS({
|
|
|
54373
54373
|
assert_1.default.strictEqual(typeof pos, "object");
|
|
54374
54374
|
assert_1.default.strictEqual(typeof pos.line, "number");
|
|
54375
54375
|
assert_1.default.strictEqual(typeof pos.column, "number");
|
|
54376
|
-
var line = pos.line, column = pos.column, secret = this, infos = secret.infos,
|
|
54377
|
-
if (typeof
|
|
54376
|
+
var line = pos.line, column = pos.column, secret = this, infos = secret.infos, info = infos[line - 1], c = column;
|
|
54377
|
+
if (typeof info === "undefined" || c < 0)
|
|
54378
54378
|
return "";
|
|
54379
54379
|
var indent2 = this.getIndentAt(line);
|
|
54380
54380
|
if (c < indent2)
|
|
54381
54381
|
return " ";
|
|
54382
|
-
c +=
|
|
54383
|
-
if (c ===
|
|
54382
|
+
c += info.sliceStart - indent2;
|
|
54383
|
+
if (c === info.sliceEnd && line < this.length)
|
|
54384
54384
|
return "\n";
|
|
54385
|
-
if (c >=
|
|
54385
|
+
if (c >= info.sliceEnd)
|
|
54386
54386
|
return "";
|
|
54387
|
-
return
|
|
54387
|
+
return info.line.charAt(c);
|
|
54388
54388
|
};
|
|
54389
54389
|
Lines2.prototype.stripMargin = function(width, skipFirstLine) {
|
|
54390
54390
|
if (width === 0)
|
|
@@ -54392,11 +54392,11 @@ var require_lines = __commonJS({
|
|
|
54392
54392
|
assert_1.default.ok(width > 0, "negative margin: " + width);
|
|
54393
54393
|
if (skipFirstLine && this.length === 1)
|
|
54394
54394
|
return this;
|
|
54395
|
-
var lines = new Lines2(this.infos.map(function(
|
|
54396
|
-
if (
|
|
54397
|
-
|
|
54395
|
+
var lines = new Lines2(this.infos.map(function(info, i2) {
|
|
54396
|
+
if (info.line && (i2 > 0 || !skipFirstLine)) {
|
|
54397
|
+
info = tslib_1.__assign(tslib_1.__assign({}, info), { indent: Math.max(0, info.indent - width) });
|
|
54398
54398
|
}
|
|
54399
|
-
return
|
|
54399
|
+
return info;
|
|
54400
54400
|
}));
|
|
54401
54401
|
if (this.mappings.length > 0) {
|
|
54402
54402
|
var newMappings_1 = lines.mappings;
|
|
@@ -54411,11 +54411,11 @@ var require_lines = __commonJS({
|
|
|
54411
54411
|
if (by === 0) {
|
|
54412
54412
|
return this;
|
|
54413
54413
|
}
|
|
54414
|
-
var lines = new Lines2(this.infos.map(function(
|
|
54415
|
-
if (
|
|
54416
|
-
|
|
54414
|
+
var lines = new Lines2(this.infos.map(function(info) {
|
|
54415
|
+
if (info.line && !info.locked) {
|
|
54416
|
+
info = tslib_1.__assign(tslib_1.__assign({}, info), { indent: info.indent + by });
|
|
54417
54417
|
}
|
|
54418
|
-
return
|
|
54418
|
+
return info;
|
|
54419
54419
|
}));
|
|
54420
54420
|
if (this.mappings.length > 0) {
|
|
54421
54421
|
var newMappings_2 = lines.mappings;
|
|
@@ -54433,11 +54433,11 @@ var require_lines = __commonJS({
|
|
|
54433
54433
|
if (this.length < 2) {
|
|
54434
54434
|
return this;
|
|
54435
54435
|
}
|
|
54436
|
-
var lines = new Lines2(this.infos.map(function(
|
|
54437
|
-
if (i2 > 0 &&
|
|
54438
|
-
|
|
54436
|
+
var lines = new Lines2(this.infos.map(function(info, i2) {
|
|
54437
|
+
if (i2 > 0 && info.line && !info.locked) {
|
|
54438
|
+
info = tslib_1.__assign(tslib_1.__assign({}, info), { indent: info.indent + by });
|
|
54439
54439
|
}
|
|
54440
|
-
return
|
|
54440
|
+
return info;
|
|
54441
54441
|
}));
|
|
54442
54442
|
if (this.mappings.length > 0) {
|
|
54443
54443
|
var newMappings_3 = lines.mappings;
|
|
@@ -54452,8 +54452,8 @@ var require_lines = __commonJS({
|
|
|
54452
54452
|
if (this.length < 2) {
|
|
54453
54453
|
return this;
|
|
54454
54454
|
}
|
|
54455
|
-
return new Lines2(this.infos.map(function(
|
|
54456
|
-
return tslib_1.__assign(tslib_1.__assign({},
|
|
54455
|
+
return new Lines2(this.infos.map(function(info, i2) {
|
|
54456
|
+
return tslib_1.__assign(tslib_1.__assign({}, info), { locked: i2 > 0 });
|
|
54457
54457
|
}));
|
|
54458
54458
|
};
|
|
54459
54459
|
Lines2.prototype.getIndentAt = function(line) {
|
|
@@ -54467,14 +54467,14 @@ var require_lines = __commonJS({
|
|
|
54467
54467
|
var counts = [];
|
|
54468
54468
|
var lastIndent = 0;
|
|
54469
54469
|
for (var line = 1, last = this.length; line <= last; ++line) {
|
|
54470
|
-
var
|
|
54471
|
-
var sliced =
|
|
54470
|
+
var info = this.infos[line - 1];
|
|
54471
|
+
var sliced = info.line.slice(info.sliceStart, info.sliceEnd);
|
|
54472
54472
|
if (isOnlyWhitespace(sliced)) {
|
|
54473
54473
|
continue;
|
|
54474
54474
|
}
|
|
54475
|
-
var diff = Math.abs(
|
|
54475
|
+
var diff = Math.abs(info.indent - lastIndent);
|
|
54476
54476
|
counts[diff] = ~~counts[diff] + 1;
|
|
54477
|
-
lastIndent =
|
|
54477
|
+
lastIndent = info.indent;
|
|
54478
54478
|
}
|
|
54479
54479
|
var maxCount = -1;
|
|
54480
54480
|
var result = 2;
|
|
@@ -54497,20 +54497,20 @@ var require_lines = __commonJS({
|
|
|
54497
54497
|
return isOnlyWhitespace(this.toString());
|
|
54498
54498
|
};
|
|
54499
54499
|
Lines2.prototype.isPrecededOnlyByWhitespace = function(pos) {
|
|
54500
|
-
var
|
|
54501
|
-
var indent2 = Math.max(
|
|
54500
|
+
var info = this.infos[pos.line - 1];
|
|
54501
|
+
var indent2 = Math.max(info.indent, 0);
|
|
54502
54502
|
var diff = pos.column - indent2;
|
|
54503
54503
|
if (diff <= 0) {
|
|
54504
54504
|
return true;
|
|
54505
54505
|
}
|
|
54506
|
-
var start =
|
|
54507
|
-
var end = Math.min(start + diff,
|
|
54508
|
-
var prefix =
|
|
54506
|
+
var start = info.sliceStart;
|
|
54507
|
+
var end = Math.min(start + diff, info.sliceEnd);
|
|
54508
|
+
var prefix = info.line.slice(start, end);
|
|
54509
54509
|
return isOnlyWhitespace(prefix);
|
|
54510
54510
|
};
|
|
54511
54511
|
Lines2.prototype.getLineLength = function(line) {
|
|
54512
|
-
var
|
|
54513
|
-
return this.getIndentAt(line) +
|
|
54512
|
+
var info = this.infos[line - 1];
|
|
54513
|
+
return this.getIndentAt(line) + info.sliceEnd - info.sliceStart;
|
|
54514
54514
|
};
|
|
54515
54515
|
Lines2.prototype.nextPos = function(pos, skipSpaces) {
|
|
54516
54516
|
if (skipSpaces === void 0) {
|
|
@@ -54676,20 +54676,20 @@ var require_lines = __commonJS({
|
|
|
54676
54676
|
var _a = (0, options_1.normalize)(options), tabWidth = _a.tabWidth, useTabs = _a.useTabs, reuseWhitespace = _a.reuseWhitespace, lineTerminator = _a.lineTerminator;
|
|
54677
54677
|
var parts = [];
|
|
54678
54678
|
for (var line = start.line; line <= end.line; ++line) {
|
|
54679
|
-
var
|
|
54679
|
+
var info = this.infos[line - 1];
|
|
54680
54680
|
if (line === start.line) {
|
|
54681
54681
|
if (line === end.line) {
|
|
54682
|
-
|
|
54682
|
+
info = sliceInfo(info, start.column, end.column);
|
|
54683
54683
|
} else {
|
|
54684
|
-
|
|
54684
|
+
info = sliceInfo(info, start.column);
|
|
54685
54685
|
}
|
|
54686
54686
|
} else if (line === end.line) {
|
|
54687
|
-
|
|
54687
|
+
info = sliceInfo(info, 0, end.column);
|
|
54688
54688
|
}
|
|
54689
|
-
var indent2 = Math.max(
|
|
54690
|
-
var before_1 =
|
|
54689
|
+
var indent2 = Math.max(info.indent, 0);
|
|
54690
|
+
var before_1 = info.line.slice(0, info.sliceStart);
|
|
54691
54691
|
if (reuseWhitespace && isOnlyWhitespace(before_1) && countSpaces(before_1, tabWidth) === indent2) {
|
|
54692
|
-
parts.push(
|
|
54692
|
+
parts.push(info.line.slice(0, info.sliceEnd));
|
|
54693
54693
|
continue;
|
|
54694
54694
|
}
|
|
54695
54695
|
var tabs = 0;
|
|
@@ -54705,7 +54705,7 @@ var require_lines = __commonJS({
|
|
|
54705
54705
|
if (spaces > 0) {
|
|
54706
54706
|
result += new Array(spaces + 1).join(" ");
|
|
54707
54707
|
}
|
|
54708
|
-
result +=
|
|
54708
|
+
result += info.line.slice(info.sliceStart, info.sliceEnd);
|
|
54709
54709
|
parts.push(result);
|
|
54710
54710
|
}
|
|
54711
54711
|
return parts.join(lineTerminator);
|
|
@@ -54723,12 +54723,12 @@ var require_lines = __commonJS({
|
|
|
54723
54723
|
return;
|
|
54724
54724
|
}
|
|
54725
54725
|
if (prevInfo) {
|
|
54726
|
-
var
|
|
54727
|
-
var indent2 = new Array(
|
|
54726
|
+
var info = linesOrNull.infos[0];
|
|
54727
|
+
var indent2 = new Array(info.indent + 1).join(" ");
|
|
54728
54728
|
var prevLine_1 = infos.length;
|
|
54729
54729
|
var prevColumn_1 = Math.max(prevInfo.indent, 0) + prevInfo.sliceEnd - prevInfo.sliceStart;
|
|
54730
|
-
prevInfo.line = prevInfo.line.slice(0, prevInfo.sliceEnd) + indent2 +
|
|
54731
|
-
prevInfo.locked = prevInfo.locked ||
|
|
54730
|
+
prevInfo.line = prevInfo.line.slice(0, prevInfo.sliceEnd) + indent2 + info.line.slice(info.sliceStart, info.sliceEnd);
|
|
54731
|
+
prevInfo.locked = prevInfo.locked || info.locked;
|
|
54732
54732
|
prevInfo.sliceEnd = prevInfo.line.length;
|
|
54733
54733
|
if (linesOrNull.mappings.length > 0) {
|
|
54734
54734
|
linesOrNull.mappings.forEach(function(mapping) {
|
|
@@ -54738,9 +54738,9 @@ var require_lines = __commonJS({
|
|
|
54738
54738
|
} else if (linesOrNull.mappings.length > 0) {
|
|
54739
54739
|
mappings.push.apply(mappings, linesOrNull.mappings);
|
|
54740
54740
|
}
|
|
54741
|
-
linesOrNull.infos.forEach(function(
|
|
54741
|
+
linesOrNull.infos.forEach(function(info2, i2) {
|
|
54742
54742
|
if (!prevInfo || i2 > 0) {
|
|
54743
|
-
prevInfo = tslib_1.__assign({},
|
|
54743
|
+
prevInfo = tslib_1.__assign({}, info2);
|
|
54744
54744
|
infos.push(prevInfo);
|
|
54745
54745
|
}
|
|
54746
54746
|
});
|
|
@@ -54844,10 +54844,10 @@ var require_lines = __commonJS({
|
|
|
54844
54844
|
function isOnlyWhitespace(string) {
|
|
54845
54845
|
return !/\S/.test(string);
|
|
54846
54846
|
}
|
|
54847
|
-
function sliceInfo(
|
|
54848
|
-
var sliceStart =
|
|
54849
|
-
var sliceEnd =
|
|
54850
|
-
var indent2 = Math.max(
|
|
54847
|
+
function sliceInfo(info, startCol, endCol) {
|
|
54848
|
+
var sliceStart = info.sliceStart;
|
|
54849
|
+
var sliceEnd = info.sliceEnd;
|
|
54850
|
+
var indent2 = Math.max(info.indent, 0);
|
|
54851
54851
|
var lineLength = indent2 + sliceEnd - sliceStart;
|
|
54852
54852
|
if (typeof endCol === "undefined") {
|
|
54853
54853
|
endCol = lineLength;
|
|
@@ -54873,11 +54873,11 @@ var require_lines = __commonJS({
|
|
|
54873
54873
|
assert_1.default.ok(indent2 >= 0);
|
|
54874
54874
|
assert_1.default.ok(sliceStart <= sliceEnd);
|
|
54875
54875
|
assert_1.default.strictEqual(lineLength, indent2 + sliceEnd - sliceStart);
|
|
54876
|
-
if (
|
|
54877
|
-
return
|
|
54876
|
+
if (info.indent === indent2 && info.sliceStart === sliceStart && info.sliceEnd === sliceEnd) {
|
|
54877
|
+
return info;
|
|
54878
54878
|
}
|
|
54879
54879
|
return {
|
|
54880
|
-
line:
|
|
54880
|
+
line: info.line,
|
|
54881
54881
|
indent: indent2,
|
|
54882
54882
|
locked: false,
|
|
54883
54883
|
sliceStart,
|
|
@@ -57884,9 +57884,9 @@ var require_printer2 = __commonJS({
|
|
|
57884
57884
|
var prevTrailingSpace = null;
|
|
57885
57885
|
var len = filtered.length;
|
|
57886
57886
|
var parts = [];
|
|
57887
|
-
filtered.forEach(function(
|
|
57888
|
-
var printed =
|
|
57889
|
-
var stmt =
|
|
57887
|
+
filtered.forEach(function(info, i2) {
|
|
57888
|
+
var printed = info.printed;
|
|
57889
|
+
var stmt = info.node;
|
|
57890
57890
|
var multiLine = printed.length > 1;
|
|
57891
57891
|
var notFirst = i2 > 0;
|
|
57892
57892
|
var notLast = i2 < len - 1;
|
|
@@ -61459,6 +61459,9 @@ var graphql2 = __toESM(require_graphql2(), 1);
|
|
|
61459
61459
|
var import_minimatch = __toESM(require_minimatch(), 1);
|
|
61460
61460
|
var import_url = require("url");
|
|
61461
61461
|
|
|
61462
|
+
// src/runtime/imports/config.ts
|
|
61463
|
+
var config_default = {};
|
|
61464
|
+
|
|
61462
61465
|
// src/runtime/lib/config.ts
|
|
61463
61466
|
var mockConfig = null;
|
|
61464
61467
|
function getMockConfig() {
|
|
@@ -61494,1726 +61497,13 @@ function computeID(configFile, type, data) {
|
|
|
61494
61497
|
}
|
|
61495
61498
|
return id.slice(0, -2);
|
|
61496
61499
|
}
|
|
61497
|
-
|
|
61500
|
+
function getCurrentConfig() {
|
|
61498
61501
|
const mockConfig2 = getMockConfig();
|
|
61499
61502
|
if (mockConfig2) {
|
|
61500
61503
|
return mockConfig2;
|
|
61501
61504
|
}
|
|
61502
|
-
return defaultConfigValues(
|
|
61503
|
-
}
|
|
61504
|
-
|
|
61505
|
-
// src/runtime/lib/deepEquals.ts
|
|
61506
|
-
function deepEquals(objA, objB, map = /* @__PURE__ */ new WeakMap()) {
|
|
61507
|
-
if (Object.is(objA, objB))
|
|
61508
|
-
return true;
|
|
61509
|
-
if (objA instanceof Date && objB instanceof Date) {
|
|
61510
|
-
return objA.getTime() === objB.getTime();
|
|
61511
|
-
}
|
|
61512
|
-
if (objA instanceof RegExp && objB instanceof RegExp) {
|
|
61513
|
-
return objA.toString() === objB.toString();
|
|
61514
|
-
}
|
|
61515
|
-
if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
|
|
61516
|
-
return false;
|
|
61517
|
-
}
|
|
61518
|
-
if (map.get(objA) === objB)
|
|
61519
|
-
return true;
|
|
61520
|
-
map.set(objA, objB);
|
|
61521
|
-
const keysA = Reflect.ownKeys(objA);
|
|
61522
|
-
const keysB = Reflect.ownKeys(objB);
|
|
61523
|
-
if (keysA.length !== keysB.length) {
|
|
61524
|
-
return false;
|
|
61525
|
-
}
|
|
61526
|
-
for (let i2 = 0; i2 < keysA.length; i2++) {
|
|
61527
|
-
if (!Reflect.has(objB, keysA[i2]) || !deepEquals(objA[keysA[i2]], objB[keysA[i2]], map)) {
|
|
61528
|
-
return false;
|
|
61529
|
-
}
|
|
61530
|
-
}
|
|
61531
|
-
return true;
|
|
61532
|
-
}
|
|
61533
|
-
|
|
61534
|
-
// src/runtime/lib/selection.ts
|
|
61535
|
-
function getFieldsForType(selection, __typename) {
|
|
61536
|
-
let targetSelection = selection.fields || {};
|
|
61537
|
-
if (selection.abstractFields && __typename) {
|
|
61538
|
-
const mappedType = selection.abstractFields.typeMap[__typename];
|
|
61539
|
-
if (mappedType) {
|
|
61540
|
-
targetSelection = selection.abstractFields.fields[mappedType];
|
|
61541
|
-
} else if (selection.abstractFields.fields[__typename]) {
|
|
61542
|
-
targetSelection = selection.abstractFields.fields[__typename];
|
|
61543
|
-
}
|
|
61544
|
-
}
|
|
61545
|
-
return targetSelection;
|
|
61546
|
-
}
|
|
61547
|
-
|
|
61548
|
-
// src/runtime/cache/gc.ts
|
|
61549
|
-
var GarbageCollector = class {
|
|
61550
|
-
cache;
|
|
61551
|
-
lifetimes = /* @__PURE__ */ new Map();
|
|
61552
|
-
get cacheBufferSize() {
|
|
61553
|
-
return this.cache._internal_unstable.config.cacheBufferSize ?? 10;
|
|
61554
|
-
}
|
|
61555
|
-
constructor(cache) {
|
|
61556
|
-
this.cache = cache;
|
|
61557
|
-
}
|
|
61558
|
-
resetLifetime(id, field) {
|
|
61559
|
-
if (!this.lifetimes.get(id)) {
|
|
61560
|
-
this.lifetimes.set(id, /* @__PURE__ */ new Map());
|
|
61561
|
-
}
|
|
61562
|
-
this.lifetimes.get(id).set(field, 0);
|
|
61563
|
-
}
|
|
61564
|
-
tick() {
|
|
61565
|
-
for (const [id, fieldMap] of this.lifetimes.entries()) {
|
|
61566
|
-
for (const [field, lifetime] of fieldMap.entries()) {
|
|
61567
|
-
if (this.cache._internal_unstable.subscriptions.get(id, field).length > 0) {
|
|
61568
|
-
continue;
|
|
61569
|
-
}
|
|
61570
|
-
fieldMap.set(field, lifetime + 1);
|
|
61571
|
-
if (fieldMap.get(field) > this.cacheBufferSize) {
|
|
61572
|
-
this.cache._internal_unstable.storage.deleteField(id, field);
|
|
61573
|
-
this.cache._internal_unstable.lists.deleteField(id, field);
|
|
61574
|
-
fieldMap.delete(field);
|
|
61575
|
-
if ([...fieldMap.keys()].length === 0) {
|
|
61576
|
-
this.lifetimes.delete(id);
|
|
61577
|
-
}
|
|
61578
|
-
}
|
|
61579
|
-
}
|
|
61580
|
-
}
|
|
61581
|
-
}
|
|
61582
|
-
};
|
|
61583
|
-
|
|
61584
|
-
// src/runtime/cache/stuff.ts
|
|
61585
|
-
function flattenList(source) {
|
|
61586
|
-
const flat = [];
|
|
61587
|
-
const unvisited = [source || []];
|
|
61588
|
-
while (unvisited.length > 0) {
|
|
61589
|
-
const target = unvisited.shift();
|
|
61590
|
-
for (const id of target) {
|
|
61591
|
-
if (Array.isArray(id)) {
|
|
61592
|
-
unvisited.push(id);
|
|
61593
|
-
continue;
|
|
61594
|
-
}
|
|
61595
|
-
flat.push(id);
|
|
61596
|
-
}
|
|
61597
|
-
}
|
|
61598
|
-
return flat;
|
|
61599
|
-
}
|
|
61600
|
-
function evaluateKey(key, variables = {}) {
|
|
61601
|
-
let evaluated = "";
|
|
61602
|
-
let varName = "";
|
|
61603
|
-
let inString = false;
|
|
61604
|
-
for (const char of key) {
|
|
61605
|
-
if (varName) {
|
|
61606
|
-
if (varChars.includes(char)) {
|
|
61607
|
-
varName += char;
|
|
61608
|
-
continue;
|
|
61609
|
-
}
|
|
61610
|
-
const value = variables[varName.slice(1)];
|
|
61611
|
-
evaluated += typeof value !== "undefined" ? JSON.stringify(value) : "undefined";
|
|
61612
|
-
varName = "";
|
|
61613
|
-
}
|
|
61614
|
-
if (char === "$" && !inString) {
|
|
61615
|
-
varName = "$";
|
|
61616
|
-
continue;
|
|
61617
|
-
}
|
|
61618
|
-
if (char === '"') {
|
|
61619
|
-
inString = !inString;
|
|
61620
|
-
}
|
|
61621
|
-
evaluated += char;
|
|
61622
|
-
}
|
|
61623
|
-
return evaluated;
|
|
61624
|
-
}
|
|
61625
|
-
var varChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789";
|
|
61626
|
-
|
|
61627
|
-
// src/runtime/cache/lists.ts
|
|
61628
|
-
var ListManager = class {
|
|
61629
|
-
rootID;
|
|
61630
|
-
cache;
|
|
61631
|
-
constructor(cache, rootID2) {
|
|
61632
|
-
this.rootID = rootID2;
|
|
61633
|
-
this.cache = cache;
|
|
61634
|
-
}
|
|
61635
|
-
lists = /* @__PURE__ */ new Map();
|
|
61636
|
-
listsByField = /* @__PURE__ */ new Map();
|
|
61637
|
-
get(listName, id, allLists) {
|
|
61638
|
-
const matches = this.lists.get(listName);
|
|
61639
|
-
if (!matches || matches.size === 0) {
|
|
61640
|
-
return null;
|
|
61641
|
-
}
|
|
61642
|
-
if (allLists) {
|
|
61643
|
-
return new ListCollection(
|
|
61644
|
-
Array.from(matches, ([key, value]) => [...value.lists]).flat()
|
|
61645
|
-
);
|
|
61646
|
-
}
|
|
61647
|
-
const head = [...matches.values()][0];
|
|
61648
|
-
const { recordType } = head.lists[0];
|
|
61649
|
-
const parentID = id ? this.cache._internal_unstable.id(recordType || "", id) : this.rootID;
|
|
61650
|
-
if (matches?.size === 1) {
|
|
61651
|
-
if (!id) {
|
|
61652
|
-
return head;
|
|
61653
|
-
}
|
|
61654
|
-
return parentID === Array.from(matches.keys())[0] ? head : null;
|
|
61655
|
-
}
|
|
61656
|
-
if (!id) {
|
|
61657
|
-
console.error(
|
|
61658
|
-
`Found multiple instances of "${listName}". Please provide one of @parentID or @allLists directives to help identify which list you want modify. For more information, visit this guide: https://www.houdinigraphql.com/api/graphql#parentidvalue-string `
|
|
61659
|
-
);
|
|
61660
|
-
return null;
|
|
61661
|
-
}
|
|
61662
|
-
return this.lists.get(listName)?.get(parentID);
|
|
61663
|
-
}
|
|
61664
|
-
remove(listName, id) {
|
|
61665
|
-
this.lists.get(listName)?.delete(id || this.rootID);
|
|
61666
|
-
}
|
|
61667
|
-
add(list) {
|
|
61668
|
-
if (!this.lists.has(list.name)) {
|
|
61669
|
-
this.lists.set(list.name, /* @__PURE__ */ new Map());
|
|
61670
|
-
}
|
|
61671
|
-
const name = list.name;
|
|
61672
|
-
const parentID = list.recordID || this.rootID;
|
|
61673
|
-
if (this.lists.get(name)?.get(parentID)?.includes(list.key)) {
|
|
61674
|
-
return;
|
|
61675
|
-
}
|
|
61676
|
-
if (!this.lists.has(name)) {
|
|
61677
|
-
this.lists.set(name, /* @__PURE__ */ new Map());
|
|
61678
|
-
}
|
|
61679
|
-
if (!this.lists.get(name).has(parentID)) {
|
|
61680
|
-
this.lists.get(name).set(parentID, new ListCollection([]));
|
|
61681
|
-
}
|
|
61682
|
-
if (!this.listsByField.has(parentID)) {
|
|
61683
|
-
this.listsByField.set(parentID, /* @__PURE__ */ new Map());
|
|
61684
|
-
}
|
|
61685
|
-
if (!this.listsByField.get(parentID).has(list.key)) {
|
|
61686
|
-
this.listsByField.get(parentID)?.set(list.key, []);
|
|
61687
|
-
}
|
|
61688
|
-
const handler = new List({ ...list, manager: this });
|
|
61689
|
-
this.lists.get(list.name).get(parentID).lists.push(handler);
|
|
61690
|
-
this.listsByField.get(parentID).get(list.key).push(handler);
|
|
61691
|
-
}
|
|
61692
|
-
removeIDFromAllLists(id) {
|
|
61693
|
-
for (const fieldMap of this.lists.values()) {
|
|
61694
|
-
for (const list of fieldMap.values()) {
|
|
61695
|
-
list.removeID(id);
|
|
61696
|
-
}
|
|
61697
|
-
}
|
|
61698
|
-
}
|
|
61699
|
-
deleteField(parentID, field) {
|
|
61700
|
-
if (!this.listsByField.get(parentID)?.has(field)) {
|
|
61701
|
-
return;
|
|
61702
|
-
}
|
|
61703
|
-
for (const list of this.listsByField.get(parentID).get(field)) {
|
|
61704
|
-
this.lists.get(list.name)?.get(list.recordID)?.deleteListWithKey(field);
|
|
61705
|
-
if (this.lists.get(list.name)?.get(list.recordID)?.lists.length === 0) {
|
|
61706
|
-
this.lists.get(list.name)?.delete(list.recordID);
|
|
61707
|
-
}
|
|
61708
|
-
}
|
|
61709
|
-
this.listsByField.get(parentID).delete(field);
|
|
61710
|
-
}
|
|
61711
|
-
};
|
|
61712
|
-
var List = class {
|
|
61713
|
-
recordID;
|
|
61714
|
-
recordType;
|
|
61715
|
-
key;
|
|
61716
|
-
type;
|
|
61717
|
-
cache;
|
|
61718
|
-
selection;
|
|
61719
|
-
_when;
|
|
61720
|
-
filters;
|
|
61721
|
-
name;
|
|
61722
|
-
connection;
|
|
61723
|
-
manager;
|
|
61724
|
-
abstract;
|
|
61725
|
-
constructor({
|
|
61726
|
-
name,
|
|
61727
|
-
recordID,
|
|
61728
|
-
recordType,
|
|
61729
|
-
key,
|
|
61730
|
-
listType,
|
|
61731
|
-
selection,
|
|
61732
|
-
when,
|
|
61733
|
-
filters,
|
|
61734
|
-
connection,
|
|
61735
|
-
manager,
|
|
61736
|
-
abstract
|
|
61737
|
-
}) {
|
|
61738
|
-
this.recordID = recordID || rootID;
|
|
61739
|
-
this.recordType = recordType;
|
|
61740
|
-
this.key = key;
|
|
61741
|
-
this.type = listType;
|
|
61742
|
-
this.cache = manager.cache;
|
|
61743
|
-
this.selection = selection;
|
|
61744
|
-
this._when = when;
|
|
61745
|
-
this.filters = filters;
|
|
61746
|
-
this.name = name;
|
|
61747
|
-
this.connection = connection;
|
|
61748
|
-
this.manager = manager;
|
|
61749
|
-
this.abstract = abstract;
|
|
61750
|
-
}
|
|
61751
|
-
when(when) {
|
|
61752
|
-
return this.manager.lists.get(this.name).get(this.recordID).when(when);
|
|
61753
|
-
}
|
|
61754
|
-
append(selection, data, variables = {}) {
|
|
61755
|
-
return this.addToList(selection, data, variables, "last");
|
|
61756
|
-
}
|
|
61757
|
-
prepend(selection, data, variables = {}) {
|
|
61758
|
-
return this.addToList(selection, data, variables, "first");
|
|
61759
|
-
}
|
|
61760
|
-
addToList(selection, data, variables = {}, where) {
|
|
61761
|
-
const listType = this.listType(data);
|
|
61762
|
-
const dataID = this.cache._internal_unstable.id(listType, data);
|
|
61763
|
-
if (!this.validateWhen() || !dataID) {
|
|
61764
|
-
return;
|
|
61765
|
-
}
|
|
61766
|
-
let insertSelection = selection;
|
|
61767
|
-
let insertData = data;
|
|
61768
|
-
if (this.connection) {
|
|
61769
|
-
insertSelection = {
|
|
61770
|
-
fields: {
|
|
61771
|
-
newEntry: {
|
|
61772
|
-
keyRaw: this.key,
|
|
61773
|
-
type: "Connection",
|
|
61774
|
-
selection: {
|
|
61775
|
-
fields: {
|
|
61776
|
-
edges: {
|
|
61777
|
-
keyRaw: "edges",
|
|
61778
|
-
type: "ConnectionEdge",
|
|
61779
|
-
update: where === "first" ? "prepend" : "append",
|
|
61780
|
-
selection: {
|
|
61781
|
-
fields: {
|
|
61782
|
-
node: {
|
|
61783
|
-
type: listType,
|
|
61784
|
-
keyRaw: "node",
|
|
61785
|
-
selection: {
|
|
61786
|
-
...selection,
|
|
61787
|
-
fields: {
|
|
61788
|
-
...selection.fields,
|
|
61789
|
-
__typename: {
|
|
61790
|
-
keyRaw: "__typename",
|
|
61791
|
-
type: "String"
|
|
61792
|
-
}
|
|
61793
|
-
}
|
|
61794
|
-
}
|
|
61795
|
-
}
|
|
61796
|
-
}
|
|
61797
|
-
}
|
|
61798
|
-
}
|
|
61799
|
-
}
|
|
61800
|
-
}
|
|
61801
|
-
}
|
|
61802
|
-
}
|
|
61803
|
-
};
|
|
61804
|
-
insertData = {
|
|
61805
|
-
newEntry: {
|
|
61806
|
-
edges: [{ node: { ...data, __typename: listType } }]
|
|
61807
|
-
}
|
|
61808
|
-
};
|
|
61809
|
-
} else {
|
|
61810
|
-
insertSelection = {
|
|
61811
|
-
fields: {
|
|
61812
|
-
newEntries: {
|
|
61813
|
-
keyRaw: this.key,
|
|
61814
|
-
type: listType,
|
|
61815
|
-
update: where === "first" ? "prepend" : "append",
|
|
61816
|
-
selection: {
|
|
61817
|
-
...selection,
|
|
61818
|
-
fields: {
|
|
61819
|
-
...selection.fields,
|
|
61820
|
-
__typename: {
|
|
61821
|
-
keyRaw: "__typename",
|
|
61822
|
-
type: "String"
|
|
61823
|
-
}
|
|
61824
|
-
}
|
|
61825
|
-
}
|
|
61826
|
-
}
|
|
61827
|
-
}
|
|
61828
|
-
};
|
|
61829
|
-
insertData = {
|
|
61830
|
-
newEntries: [{ ...data, __typename: listType }]
|
|
61831
|
-
};
|
|
61832
|
-
}
|
|
61833
|
-
this.cache.write({
|
|
61834
|
-
selection: insertSelection,
|
|
61835
|
-
data: insertData,
|
|
61836
|
-
variables,
|
|
61837
|
-
parent: this.recordID,
|
|
61838
|
-
applyUpdates: true
|
|
61839
|
-
});
|
|
61840
|
-
}
|
|
61841
|
-
removeID(id, variables = {}) {
|
|
61842
|
-
if (!this.validateWhen()) {
|
|
61843
|
-
return;
|
|
61844
|
-
}
|
|
61845
|
-
let parentID = this.recordID;
|
|
61846
|
-
let targetID = id;
|
|
61847
|
-
let targetKey = this.key;
|
|
61848
|
-
if (this.connection) {
|
|
61849
|
-
const { value: embeddedConnection } = this.cache._internal_unstable.storage.get(
|
|
61850
|
-
this.recordID,
|
|
61851
|
-
this.key
|
|
61852
|
-
);
|
|
61853
|
-
if (!embeddedConnection) {
|
|
61854
|
-
return;
|
|
61855
|
-
}
|
|
61856
|
-
const embeddedConnectionID = embeddedConnection;
|
|
61857
|
-
const { value: edges } = this.cache._internal_unstable.storage.get(
|
|
61858
|
-
embeddedConnectionID,
|
|
61859
|
-
"edges"
|
|
61860
|
-
);
|
|
61861
|
-
for (const edge of flattenList(edges) || []) {
|
|
61862
|
-
if (!edge) {
|
|
61863
|
-
continue;
|
|
61864
|
-
}
|
|
61865
|
-
const edgeID = edge;
|
|
61866
|
-
const { value: nodeID } = this.cache._internal_unstable.storage.get(edgeID, "node");
|
|
61867
|
-
if (!nodeID) {
|
|
61868
|
-
continue;
|
|
61869
|
-
}
|
|
61870
|
-
if (nodeID === id) {
|
|
61871
|
-
targetID = edgeID;
|
|
61872
|
-
}
|
|
61873
|
-
}
|
|
61874
|
-
parentID = embeddedConnectionID;
|
|
61875
|
-
targetKey = "edges";
|
|
61876
|
-
}
|
|
61877
|
-
let value = this.cache._internal_unstable.storage.get(parentID, targetKey).value;
|
|
61878
|
-
if (!value || !value.includes(targetID)) {
|
|
61879
|
-
return;
|
|
61880
|
-
}
|
|
61881
|
-
const subscribers = this.cache._internal_unstable.subscriptions.get(this.recordID, this.key);
|
|
61882
|
-
this.cache._internal_unstable.subscriptions.remove(
|
|
61883
|
-
targetID,
|
|
61884
|
-
this.connection ? this.selection.fields.edges.selection : this.selection,
|
|
61885
|
-
subscribers,
|
|
61886
|
-
variables
|
|
61887
|
-
);
|
|
61888
|
-
this.cache._internal_unstable.storage.remove(parentID, targetKey, targetID);
|
|
61889
|
-
for (const spec of subscribers) {
|
|
61890
|
-
spec.set(
|
|
61891
|
-
this.cache._internal_unstable.getSelection({
|
|
61892
|
-
parent: spec.parentID || this.manager.rootID,
|
|
61893
|
-
selection: spec.selection,
|
|
61894
|
-
variables: spec.variables?.() || {}
|
|
61895
|
-
}).data
|
|
61896
|
-
);
|
|
61897
|
-
}
|
|
61898
|
-
return true;
|
|
61899
|
-
}
|
|
61900
|
-
remove(data, variables = {}) {
|
|
61901
|
-
const targetID = this.cache._internal_unstable.id(this.listType(data), data);
|
|
61902
|
-
if (!targetID) {
|
|
61903
|
-
return;
|
|
61904
|
-
}
|
|
61905
|
-
return this.removeID(targetID, variables);
|
|
61906
|
-
}
|
|
61907
|
-
listType(data) {
|
|
61908
|
-
return data.__typename || this.type;
|
|
61909
|
-
}
|
|
61910
|
-
validateWhen(when) {
|
|
61911
|
-
let filters = when || this._when;
|
|
61912
|
-
let ok = true;
|
|
61913
|
-
if (filters) {
|
|
61914
|
-
const targets = this.filters;
|
|
61915
|
-
if (filters.must && targets) {
|
|
61916
|
-
ok = Object.entries(filters.must).reduce(
|
|
61917
|
-
(prev, [key, value]) => Boolean(prev && targets[key] == value),
|
|
61918
|
-
ok
|
|
61919
|
-
);
|
|
61920
|
-
}
|
|
61921
|
-
if (filters.must_not) {
|
|
61922
|
-
ok = !targets || Object.entries(filters.must_not).reduce(
|
|
61923
|
-
(prev, [key, value]) => Boolean(prev && targets[key] != value),
|
|
61924
|
-
ok
|
|
61925
|
-
);
|
|
61926
|
-
}
|
|
61927
|
-
}
|
|
61928
|
-
return ok;
|
|
61929
|
-
}
|
|
61930
|
-
toggleElement(selection, data, variables = {}, where) {
|
|
61931
|
-
if (!this.remove(data, variables)) {
|
|
61932
|
-
this.addToList(selection, data, variables, where);
|
|
61933
|
-
}
|
|
61934
|
-
}
|
|
61935
|
-
*[Symbol.iterator]() {
|
|
61936
|
-
let entries = [];
|
|
61937
|
-
let value = this.cache._internal_unstable.storage.get(this.recordID, this.key).value;
|
|
61938
|
-
if (!this.connection) {
|
|
61939
|
-
entries = flattenList(value);
|
|
61940
|
-
} else {
|
|
61941
|
-
entries = this.cache._internal_unstable.storage.get(value, "edges").value;
|
|
61942
|
-
}
|
|
61943
|
-
for (let record of entries) {
|
|
61944
|
-
yield record;
|
|
61945
|
-
}
|
|
61946
|
-
}
|
|
61947
|
-
};
|
|
61948
|
-
var ListCollection = class {
|
|
61949
|
-
lists = [];
|
|
61950
|
-
constructor(lists) {
|
|
61951
|
-
this.lists = lists;
|
|
61952
|
-
}
|
|
61953
|
-
append(...args) {
|
|
61954
|
-
this.lists.forEach((list) => list.append(...args));
|
|
61955
|
-
}
|
|
61956
|
-
prepend(...args) {
|
|
61957
|
-
this.lists.forEach((list) => list.prepend(...args));
|
|
61958
|
-
}
|
|
61959
|
-
addToList(...args) {
|
|
61960
|
-
this.lists.forEach((list) => list.addToList(...args));
|
|
61961
|
-
}
|
|
61962
|
-
removeID(...args) {
|
|
61963
|
-
this.lists.forEach((list) => list.removeID(...args));
|
|
61964
|
-
}
|
|
61965
|
-
remove(...args) {
|
|
61966
|
-
this.lists.forEach((list) => list.remove(...args));
|
|
61967
|
-
}
|
|
61968
|
-
toggleElement(...args) {
|
|
61969
|
-
this.lists.forEach((list) => list.toggleElement(...args));
|
|
61970
|
-
}
|
|
61971
|
-
when(when) {
|
|
61972
|
-
return new ListCollection(
|
|
61973
|
-
this.lists.filter((list) => {
|
|
61974
|
-
return list.validateWhen(when);
|
|
61975
|
-
})
|
|
61976
|
-
);
|
|
61977
|
-
}
|
|
61978
|
-
includes(key) {
|
|
61979
|
-
return !!this.lists.find((list) => list.key === key);
|
|
61980
|
-
}
|
|
61981
|
-
deleteListWithKey(key) {
|
|
61982
|
-
return this.lists = this.lists.filter((list) => list.key !== key);
|
|
61983
|
-
}
|
|
61984
|
-
*[Symbol.iterator]() {
|
|
61985
|
-
for (let list of this.lists) {
|
|
61986
|
-
for (const entry of list) {
|
|
61987
|
-
yield entry;
|
|
61988
|
-
}
|
|
61989
|
-
}
|
|
61990
|
-
}
|
|
61991
|
-
};
|
|
61992
|
-
|
|
61993
|
-
// src/runtime/cache/schema.ts
|
|
61994
|
-
var SchemaManager = class {
|
|
61995
|
-
cache;
|
|
61996
|
-
fieldTypes = {};
|
|
61997
|
-
constructor(cache) {
|
|
61998
|
-
this.cache = cache;
|
|
61999
|
-
}
|
|
62000
|
-
setFieldType({
|
|
62001
|
-
parent,
|
|
62002
|
-
key,
|
|
62003
|
-
type,
|
|
62004
|
-
nullable = false,
|
|
62005
|
-
link
|
|
62006
|
-
}) {
|
|
62007
|
-
let parensIndex = key.indexOf("(");
|
|
62008
|
-
if (parensIndex !== -1) {
|
|
62009
|
-
key = key.substring(0, parensIndex);
|
|
62010
|
-
}
|
|
62011
|
-
if (parent === rootID) {
|
|
62012
|
-
parent = "Query";
|
|
62013
|
-
} else if (parent.includes(":")) {
|
|
62014
|
-
parent = parent.substring(0, parent.indexOf(":"));
|
|
62015
|
-
}
|
|
62016
|
-
if (!this.fieldTypes[parent]) {
|
|
62017
|
-
this.fieldTypes[parent] = {};
|
|
62018
|
-
}
|
|
62019
|
-
this.fieldTypes[parent][key] = {
|
|
62020
|
-
type,
|
|
62021
|
-
nullable,
|
|
62022
|
-
link: !!link
|
|
62023
|
-
};
|
|
62024
|
-
}
|
|
62025
|
-
fieldType(type, field) {
|
|
62026
|
-
return this.fieldTypes[type]?.[field] || null;
|
|
62027
|
-
}
|
|
62028
|
-
get config() {
|
|
62029
|
-
return this.cache._internal_unstable.config;
|
|
62030
|
-
}
|
|
62031
|
-
};
|
|
62032
|
-
|
|
62033
|
-
// src/runtime/cache/storage.ts
|
|
62034
|
-
var InMemoryStorage = class {
|
|
62035
|
-
data;
|
|
62036
|
-
idCount = 0;
|
|
62037
|
-
rank = 0;
|
|
62038
|
-
constructor() {
|
|
62039
|
-
this.data = [];
|
|
62040
|
-
}
|
|
62041
|
-
get layerCount() {
|
|
62042
|
-
return this.data.length;
|
|
62043
|
-
}
|
|
62044
|
-
get nextRank() {
|
|
62045
|
-
return this.rank++;
|
|
62046
|
-
}
|
|
62047
|
-
createLayer(optimistic = false) {
|
|
62048
|
-
const layer = new Layer(this.idCount++);
|
|
62049
|
-
layer.optimistic = optimistic;
|
|
62050
|
-
this.data.push(layer);
|
|
62051
|
-
return layer;
|
|
62052
|
-
}
|
|
62053
|
-
insert(id, field, location, target) {
|
|
62054
|
-
return this.topLayer.insert(id, field, location, target);
|
|
62055
|
-
}
|
|
62056
|
-
remove(id, field, target) {
|
|
62057
|
-
return this.topLayer.remove(id, field, target);
|
|
62058
|
-
}
|
|
62059
|
-
delete(id) {
|
|
62060
|
-
return this.topLayer.delete(id);
|
|
62061
|
-
}
|
|
62062
|
-
deleteField(id, field) {
|
|
62063
|
-
return this.topLayer.deleteField(id, field);
|
|
62064
|
-
}
|
|
62065
|
-
getLayer(id) {
|
|
62066
|
-
for (const layer of this.data) {
|
|
62067
|
-
if (layer.id === id) {
|
|
62068
|
-
return layer;
|
|
62069
|
-
}
|
|
62070
|
-
}
|
|
62071
|
-
throw new Error("Could not find layer with id: " + id);
|
|
62072
|
-
}
|
|
62073
|
-
replaceID(replacement) {
|
|
62074
|
-
for (const layer of this.data) {
|
|
62075
|
-
layer.replaceID(replacement);
|
|
62076
|
-
}
|
|
62077
|
-
}
|
|
62078
|
-
get(id, field) {
|
|
62079
|
-
const operations = {
|
|
62080
|
-
[OperationKind.insert]: {
|
|
62081
|
-
[OperationLocation.start]: [],
|
|
62082
|
-
[OperationLocation.end]: []
|
|
62083
|
-
},
|
|
62084
|
-
[OperationKind.remove]: /* @__PURE__ */ new Set()
|
|
62085
|
-
};
|
|
62086
|
-
const layerIDs = [];
|
|
62087
|
-
for (let i2 = this.data.length - 1; i2 >= 0; i2--) {
|
|
62088
|
-
const layer = this.data[i2];
|
|
62089
|
-
const [layerValue, kind] = layer.get(id, field);
|
|
62090
|
-
const layerOperations = layer.getOperations(id, field) || [];
|
|
62091
|
-
layer.deletedIDs.forEach((v) => {
|
|
62092
|
-
if (layer.operations[v]?.undoDeletesInList?.includes(field)) {
|
|
62093
|
-
return;
|
|
62094
|
-
}
|
|
62095
|
-
operations.remove.add(v);
|
|
62096
|
-
});
|
|
62097
|
-
if (typeof layerValue === "undefined" && layerOperations.length === 0) {
|
|
62098
|
-
if (layer.deletedIDs.size > 0) {
|
|
62099
|
-
layerIDs.push(layer.id);
|
|
62100
|
-
}
|
|
62101
|
-
continue;
|
|
62102
|
-
}
|
|
62103
|
-
if (typeof layerValue !== "undefined" && !Array.isArray(layerValue)) {
|
|
62104
|
-
return {
|
|
62105
|
-
value: layerValue,
|
|
62106
|
-
kind,
|
|
62107
|
-
displayLayers: [layer.id]
|
|
62108
|
-
};
|
|
62109
|
-
}
|
|
62110
|
-
layerIDs.push(layer.id);
|
|
62111
|
-
if (layerOperations.length > 0) {
|
|
62112
|
-
for (const op of layerOperations) {
|
|
62113
|
-
if (isRemoveOperation(op)) {
|
|
62114
|
-
operations.remove.add(op.id);
|
|
62115
|
-
}
|
|
62116
|
-
if (isInsertOperation(op)) {
|
|
62117
|
-
operations.insert[op.location].unshift(op.id);
|
|
62118
|
-
}
|
|
62119
|
-
if (isDeleteOperation(op)) {
|
|
62120
|
-
return {
|
|
62121
|
-
value: void 0,
|
|
62122
|
-
kind: "unknown",
|
|
62123
|
-
displayLayers: []
|
|
62124
|
-
};
|
|
62125
|
-
}
|
|
62126
|
-
}
|
|
62127
|
-
}
|
|
62128
|
-
if (typeof layerValue === "undefined") {
|
|
62129
|
-
continue;
|
|
62130
|
-
}
|
|
62131
|
-
if (!operations.remove.size && !operations.insert.start.length && !operations.insert.end.length) {
|
|
62132
|
-
return { value: layerValue, displayLayers: layerIDs, kind: "link" };
|
|
62133
|
-
}
|
|
62134
|
-
return {
|
|
62135
|
-
value: [...operations.insert.start, ...layerValue, ...operations.insert.end].filter(
|
|
62136
|
-
(value) => !operations.remove.has(value)
|
|
62137
|
-
),
|
|
62138
|
-
displayLayers: layerIDs,
|
|
62139
|
-
kind
|
|
62140
|
-
};
|
|
62141
|
-
}
|
|
62142
|
-
return {
|
|
62143
|
-
value: void 0,
|
|
62144
|
-
kind: "unknown",
|
|
62145
|
-
displayLayers: []
|
|
62146
|
-
};
|
|
62147
|
-
}
|
|
62148
|
-
writeLink(id, field, value) {
|
|
62149
|
-
return this.topLayer.writeLink(id, field, value);
|
|
62150
|
-
}
|
|
62151
|
-
writeField(id, field, value) {
|
|
62152
|
-
return this.topLayer.writeField(id, field, value);
|
|
62153
|
-
}
|
|
62154
|
-
resolveLayer(id) {
|
|
62155
|
-
let startingIndex = null;
|
|
62156
|
-
for (const [index, layer] of this.data.entries()) {
|
|
62157
|
-
if (layer.id !== id) {
|
|
62158
|
-
continue;
|
|
62159
|
-
}
|
|
62160
|
-
startingIndex = index - 1;
|
|
62161
|
-
this.data[index].optimistic = false;
|
|
62162
|
-
break;
|
|
62163
|
-
}
|
|
62164
|
-
if (startingIndex === null) {
|
|
62165
|
-
throw new Error("could not find layer with id: " + id);
|
|
62166
|
-
}
|
|
62167
|
-
if (startingIndex === -1) {
|
|
62168
|
-
startingIndex = 0;
|
|
62169
|
-
}
|
|
62170
|
-
if (this.data[startingIndex].optimistic) {
|
|
62171
|
-
startingIndex++;
|
|
62172
|
-
}
|
|
62173
|
-
const baseLayer = this.data[startingIndex];
|
|
62174
|
-
let layerIndex = startingIndex;
|
|
62175
|
-
while (layerIndex < this.data.length) {
|
|
62176
|
-
const layer = this.data[layerIndex++];
|
|
62177
|
-
if (layer.optimistic) {
|
|
62178
|
-
layerIndex--;
|
|
62179
|
-
break;
|
|
62180
|
-
}
|
|
62181
|
-
baseLayer.writeLayer(layer);
|
|
62182
|
-
}
|
|
62183
|
-
this.data.splice(startingIndex + 1, layerIndex - startingIndex - 1);
|
|
62184
|
-
}
|
|
62185
|
-
get topLayer() {
|
|
62186
|
-
if (this.data.length === 0) {
|
|
62187
|
-
this.createLayer();
|
|
62188
|
-
}
|
|
62189
|
-
if (this.data[this.data.length - 1]?.optimistic) {
|
|
62190
|
-
this.createLayer();
|
|
62191
|
-
}
|
|
62192
|
-
return this.data[this.data.length - 1];
|
|
62193
|
-
}
|
|
62194
|
-
};
|
|
62195
|
-
var Layer = class {
|
|
62196
|
-
id;
|
|
62197
|
-
optimistic = false;
|
|
62198
|
-
fields = {};
|
|
62199
|
-
links = {};
|
|
62200
|
-
operations = {};
|
|
62201
|
-
deletedIDs = /* @__PURE__ */ new Set();
|
|
62202
|
-
constructor(id) {
|
|
62203
|
-
this.id = id;
|
|
62204
|
-
}
|
|
62205
|
-
get(id, field) {
|
|
62206
|
-
if (typeof this.links[id]?.[field] !== "undefined") {
|
|
62207
|
-
return [this.links[id][field], "link"];
|
|
62208
|
-
}
|
|
62209
|
-
return [this.fields[id]?.[field], "scalar"];
|
|
62210
|
-
}
|
|
62211
|
-
getOperations(id, field) {
|
|
62212
|
-
if (this.operations[id]?.deleted) {
|
|
62213
|
-
return [
|
|
62214
|
-
{
|
|
62215
|
-
kind: OperationKind.delete,
|
|
62216
|
-
target: id
|
|
62217
|
-
}
|
|
62218
|
-
];
|
|
62219
|
-
}
|
|
62220
|
-
if (this.operations[id]?.fields?.[field]) {
|
|
62221
|
-
return this.operations[id].fields[field];
|
|
62222
|
-
}
|
|
62223
|
-
}
|
|
62224
|
-
writeField(id, field, value) {
|
|
62225
|
-
this.fields[id] = {
|
|
62226
|
-
...this.fields[id],
|
|
62227
|
-
[field]: value
|
|
62228
|
-
};
|
|
62229
|
-
return this.id;
|
|
62230
|
-
}
|
|
62231
|
-
writeLink(id, field, value) {
|
|
62232
|
-
const valueList = Array.isArray(value) ? value : [value];
|
|
62233
|
-
for (const value2 of flattenList(valueList)) {
|
|
62234
|
-
if (!value2) {
|
|
62235
|
-
continue;
|
|
62236
|
-
}
|
|
62237
|
-
const fieldOperations = this.operations[id]?.fields[field];
|
|
62238
|
-
if (this.operations[value2]?.deleted || this.deletedIDs.has(value2)) {
|
|
62239
|
-
this.operations[value2] = {
|
|
62240
|
-
...this.operations[value2],
|
|
62241
|
-
undoDeletesInList: [...this.operations[id]?.undoDeletesInList || [], field]
|
|
62242
|
-
};
|
|
62243
|
-
} else if (value2 && fieldOperations?.length > 0) {
|
|
62244
|
-
this.operations[id].fields[field] = fieldOperations.filter(
|
|
62245
|
-
(op) => op.kind !== "remove" || op.id !== value2
|
|
62246
|
-
);
|
|
62247
|
-
}
|
|
62248
|
-
}
|
|
62249
|
-
this.links[id] = {
|
|
62250
|
-
...this.links[id],
|
|
62251
|
-
[field]: value
|
|
62252
|
-
};
|
|
62253
|
-
return this.id;
|
|
62254
|
-
}
|
|
62255
|
-
isDisplayLayer(displayLayers) {
|
|
62256
|
-
return displayLayers.length === 0 || displayLayers.includes(this.id) || Math.max(...displayLayers) < this.id;
|
|
62257
|
-
}
|
|
62258
|
-
clear() {
|
|
62259
|
-
this.links = {};
|
|
62260
|
-
this.fields = {};
|
|
62261
|
-
this.operations = {};
|
|
62262
|
-
this.deletedIDs = /* @__PURE__ */ new Set();
|
|
62263
|
-
}
|
|
62264
|
-
replaceID({ from, to }) {
|
|
62265
|
-
this.fields[to] = this.fields[from];
|
|
62266
|
-
this.links[to] = this.links[from];
|
|
62267
|
-
this.operations[to] = this.operations[from] || { fields: {} };
|
|
62268
|
-
if (this.deletedIDs.has(from)) {
|
|
62269
|
-
this.deletedIDs.add(to);
|
|
62270
|
-
}
|
|
62271
|
-
}
|
|
62272
|
-
removeUndefinedFields() {
|
|
62273
|
-
for (const [id, fields] of Object.entries(this.fields)) {
|
|
62274
|
-
for (const [field, value] of Object.entries(fields)) {
|
|
62275
|
-
if (typeof value === "undefined") {
|
|
62276
|
-
try {
|
|
62277
|
-
delete this.fields[id][field];
|
|
62278
|
-
} catch {
|
|
62279
|
-
}
|
|
62280
|
-
try {
|
|
62281
|
-
delete this.links[id][field];
|
|
62282
|
-
} catch {
|
|
62283
|
-
}
|
|
62284
|
-
}
|
|
62285
|
-
}
|
|
62286
|
-
if (Object.keys(fields || {}).length === 0) {
|
|
62287
|
-
delete this.fields[id];
|
|
62288
|
-
}
|
|
62289
|
-
if (Object.keys(this.links[id] || {}).length === 0) {
|
|
62290
|
-
delete this.links[id];
|
|
62291
|
-
}
|
|
62292
|
-
}
|
|
62293
|
-
}
|
|
62294
|
-
delete(id) {
|
|
62295
|
-
this.operations = {
|
|
62296
|
-
...this.operations,
|
|
62297
|
-
[id]: {
|
|
62298
|
-
...this.operations[id],
|
|
62299
|
-
deleted: true,
|
|
62300
|
-
undoDeletesInList: []
|
|
62301
|
-
}
|
|
62302
|
-
};
|
|
62303
|
-
this.deletedIDs.add(id);
|
|
62304
|
-
}
|
|
62305
|
-
deleteField(id, field) {
|
|
62306
|
-
this.fields[id] = {
|
|
62307
|
-
...this.fields[id],
|
|
62308
|
-
[field]: void 0
|
|
62309
|
-
};
|
|
62310
|
-
}
|
|
62311
|
-
insert(id, field, where, target) {
|
|
62312
|
-
this.addFieldOperation(id, field, {
|
|
62313
|
-
kind: OperationKind.insert,
|
|
62314
|
-
id: target,
|
|
62315
|
-
location: where
|
|
62316
|
-
});
|
|
62317
|
-
}
|
|
62318
|
-
remove(id, field, target) {
|
|
62319
|
-
this.addFieldOperation(id, field, {
|
|
62320
|
-
kind: OperationKind.remove,
|
|
62321
|
-
id: target
|
|
62322
|
-
});
|
|
62323
|
-
}
|
|
62324
|
-
writeLayer(layer) {
|
|
62325
|
-
if (layer.id === this.id) {
|
|
62326
|
-
return;
|
|
62327
|
-
}
|
|
62328
|
-
for (const [id, ops] of Object.entries(layer.operations)) {
|
|
62329
|
-
const fields = {};
|
|
62330
|
-
for (const opMap of [this.operations[id], layer.operations[id]].filter(Boolean)) {
|
|
62331
|
-
for (const [fieldName, operations] of Object.entries(opMap.fields || {})) {
|
|
62332
|
-
fields[fieldName] = [...fields[fieldName] || [], ...operations];
|
|
62333
|
-
}
|
|
62334
|
-
}
|
|
62335
|
-
if (Object.keys(fields).length > 0) {
|
|
62336
|
-
this.operations[id] = {
|
|
62337
|
-
...this.operations[id],
|
|
62338
|
-
fields
|
|
62339
|
-
};
|
|
62340
|
-
}
|
|
62341
|
-
if (ops?.deleted) {
|
|
62342
|
-
delete this.fields[id];
|
|
62343
|
-
delete this.links[id];
|
|
62344
|
-
}
|
|
62345
|
-
}
|
|
62346
|
-
for (const [id, values] of Object.entries(layer.fields)) {
|
|
62347
|
-
if (!values) {
|
|
62348
|
-
continue;
|
|
62349
|
-
}
|
|
62350
|
-
for (const [field, value] of Object.entries(values)) {
|
|
62351
|
-
this.writeField(id, field, value);
|
|
62352
|
-
}
|
|
62353
|
-
}
|
|
62354
|
-
for (const [id, values] of Object.entries(layer.links)) {
|
|
62355
|
-
if (!values) {
|
|
62356
|
-
continue;
|
|
62357
|
-
}
|
|
62358
|
-
for (const [field, value] of Object.entries(values)) {
|
|
62359
|
-
this.writeLink(id, field, value);
|
|
62360
|
-
}
|
|
62361
|
-
}
|
|
62362
|
-
layer.deletedIDs.forEach((v) => this.deletedIDs.add(v));
|
|
62363
|
-
}
|
|
62364
|
-
addFieldOperation(id, field, operation) {
|
|
62365
|
-
this.operations = {
|
|
62366
|
-
...this.operations,
|
|
62367
|
-
[id]: {
|
|
62368
|
-
...this.operations[id],
|
|
62369
|
-
fields: {
|
|
62370
|
-
[field]: [...this.operations[id]?.fields[field] || [], operation]
|
|
62371
|
-
}
|
|
62372
|
-
}
|
|
62373
|
-
};
|
|
62374
|
-
}
|
|
62375
|
-
};
|
|
62376
|
-
function isDeleteOperation(value) {
|
|
62377
|
-
return !!value && value.kind === OperationKind.delete;
|
|
62378
|
-
}
|
|
62379
|
-
function isInsertOperation(value) {
|
|
62380
|
-
return !!value && value.kind === OperationKind.insert;
|
|
61505
|
+
return defaultConfigValues(config_default);
|
|
62381
61506
|
}
|
|
62382
|
-
function isRemoveOperation(value) {
|
|
62383
|
-
return !!value && value.kind === OperationKind.remove;
|
|
62384
|
-
}
|
|
62385
|
-
var OperationLocation = /* @__PURE__ */ ((OperationLocation2) => {
|
|
62386
|
-
OperationLocation2["start"] = "start";
|
|
62387
|
-
OperationLocation2["end"] = "end";
|
|
62388
|
-
return OperationLocation2;
|
|
62389
|
-
})(OperationLocation || {});
|
|
62390
|
-
var OperationKind = /* @__PURE__ */ ((OperationKind2) => {
|
|
62391
|
-
OperationKind2["delete"] = "delete";
|
|
62392
|
-
OperationKind2["insert"] = "insert";
|
|
62393
|
-
OperationKind2["remove"] = "remove";
|
|
62394
|
-
return OperationKind2;
|
|
62395
|
-
})(OperationKind || {});
|
|
62396
|
-
|
|
62397
|
-
// src/runtime/cache/subscription.ts
|
|
62398
|
-
var InMemorySubscriptions = class {
|
|
62399
|
-
cache;
|
|
62400
|
-
constructor(cache) {
|
|
62401
|
-
this.cache = cache;
|
|
62402
|
-
}
|
|
62403
|
-
subscribers = {};
|
|
62404
|
-
referenceCounts = {};
|
|
62405
|
-
keyVersions = {};
|
|
62406
|
-
add({
|
|
62407
|
-
parent,
|
|
62408
|
-
spec,
|
|
62409
|
-
selection,
|
|
62410
|
-
variables,
|
|
62411
|
-
parentType
|
|
62412
|
-
}) {
|
|
62413
|
-
const __typename = this.cache._internal_unstable.storage.get(parent, "__typename").value;
|
|
62414
|
-
let targetSelection = getFieldsForType(selection, __typename);
|
|
62415
|
-
for (const fieldSelection of Object.values(targetSelection || {})) {
|
|
62416
|
-
const { keyRaw, selection: innerSelection, type } = fieldSelection;
|
|
62417
|
-
const key = evaluateKey(keyRaw, variables);
|
|
62418
|
-
this.addFieldSubscription({
|
|
62419
|
-
id: parent,
|
|
62420
|
-
key,
|
|
62421
|
-
field: fieldSelection,
|
|
62422
|
-
spec,
|
|
62423
|
-
parentType: parentType || spec.rootType,
|
|
62424
|
-
variables
|
|
62425
|
-
});
|
|
62426
|
-
if (innerSelection) {
|
|
62427
|
-
const { value: linkedRecord } = this.cache._internal_unstable.storage.get(
|
|
62428
|
-
parent,
|
|
62429
|
-
key
|
|
62430
|
-
);
|
|
62431
|
-
let children = !Array.isArray(linkedRecord) ? [linkedRecord] : flattenList(linkedRecord) || [];
|
|
62432
|
-
for (const child of children) {
|
|
62433
|
-
if (!child) {
|
|
62434
|
-
continue;
|
|
62435
|
-
}
|
|
62436
|
-
this.add({
|
|
62437
|
-
parent: child,
|
|
62438
|
-
spec,
|
|
62439
|
-
selection: innerSelection,
|
|
62440
|
-
variables,
|
|
62441
|
-
parentType: type
|
|
62442
|
-
});
|
|
62443
|
-
}
|
|
62444
|
-
}
|
|
62445
|
-
}
|
|
62446
|
-
}
|
|
62447
|
-
addFieldSubscription({
|
|
62448
|
-
id,
|
|
62449
|
-
key,
|
|
62450
|
-
field,
|
|
62451
|
-
spec,
|
|
62452
|
-
parentType,
|
|
62453
|
-
variables
|
|
62454
|
-
}) {
|
|
62455
|
-
if (!this.subscribers[id]) {
|
|
62456
|
-
this.subscribers[id] = {};
|
|
62457
|
-
}
|
|
62458
|
-
if (!this.subscribers[id][key]) {
|
|
62459
|
-
this.subscribers[id][key] = [];
|
|
62460
|
-
}
|
|
62461
|
-
if (!this.keyVersions[key]) {
|
|
62462
|
-
this.keyVersions[key] = /* @__PURE__ */ new Set();
|
|
62463
|
-
}
|
|
62464
|
-
this.keyVersions[key].add(key);
|
|
62465
|
-
if (!this.subscribers[id][key].map(({ set }) => set).includes(spec.set)) {
|
|
62466
|
-
this.subscribers[id][key].push(spec);
|
|
62467
|
-
}
|
|
62468
|
-
if (!this.referenceCounts[id]) {
|
|
62469
|
-
this.referenceCounts[id] = {};
|
|
62470
|
-
}
|
|
62471
|
-
if (!this.referenceCounts[id][key]) {
|
|
62472
|
-
this.referenceCounts[id][key] = /* @__PURE__ */ new Map();
|
|
62473
|
-
}
|
|
62474
|
-
const counts = this.referenceCounts[id][key];
|
|
62475
|
-
counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
|
|
62476
|
-
this.cache._internal_unstable.lifetimes.resetLifetime(id, key);
|
|
62477
|
-
const { selection, list, filters } = field;
|
|
62478
|
-
if (selection && list) {
|
|
62479
|
-
this.cache._internal_unstable.lists.add({
|
|
62480
|
-
name: list.name,
|
|
62481
|
-
connection: list.connection,
|
|
62482
|
-
recordID: id,
|
|
62483
|
-
recordType: this.cache._internal_unstable.storage.get(id, "__typename")?.value || parentType,
|
|
62484
|
-
listType: list.type,
|
|
62485
|
-
key,
|
|
62486
|
-
selection,
|
|
62487
|
-
filters: Object.entries(filters || {}).reduce((acc, [key2, { kind, value }]) => {
|
|
62488
|
-
return {
|
|
62489
|
-
...acc,
|
|
62490
|
-
[key2]: kind !== "Variable" ? value : variables[value]
|
|
62491
|
-
};
|
|
62492
|
-
}, {})
|
|
62493
|
-
});
|
|
62494
|
-
}
|
|
62495
|
-
}
|
|
62496
|
-
addMany({
|
|
62497
|
-
parent,
|
|
62498
|
-
selection,
|
|
62499
|
-
variables,
|
|
62500
|
-
subscribers,
|
|
62501
|
-
parentType
|
|
62502
|
-
}) {
|
|
62503
|
-
let targetSelection = getFieldsForType(selection, parentType);
|
|
62504
|
-
for (const fieldSelection of Object.values(targetSelection)) {
|
|
62505
|
-
const { type: linkedType, keyRaw, selection: innerSelection } = fieldSelection;
|
|
62506
|
-
const key = evaluateKey(keyRaw, variables);
|
|
62507
|
-
for (const spec of subscribers) {
|
|
62508
|
-
this.addFieldSubscription({
|
|
62509
|
-
id: parent,
|
|
62510
|
-
key,
|
|
62511
|
-
field: fieldSelection,
|
|
62512
|
-
spec,
|
|
62513
|
-
parentType,
|
|
62514
|
-
variables
|
|
62515
|
-
});
|
|
62516
|
-
}
|
|
62517
|
-
if (innerSelection) {
|
|
62518
|
-
const { value: link } = this.cache._internal_unstable.storage.get(parent, key);
|
|
62519
|
-
const children = !Array.isArray(link) ? [link] : flattenList(link);
|
|
62520
|
-
for (const linkedRecord of children) {
|
|
62521
|
-
if (!linkedRecord) {
|
|
62522
|
-
continue;
|
|
62523
|
-
}
|
|
62524
|
-
this.addMany({
|
|
62525
|
-
parent: linkedRecord,
|
|
62526
|
-
selection: innerSelection,
|
|
62527
|
-
variables,
|
|
62528
|
-
subscribers,
|
|
62529
|
-
parentType: linkedType
|
|
62530
|
-
});
|
|
62531
|
-
}
|
|
62532
|
-
}
|
|
62533
|
-
}
|
|
62534
|
-
}
|
|
62535
|
-
get(id, field) {
|
|
62536
|
-
return this.subscribers[id]?.[field] || [];
|
|
62537
|
-
}
|
|
62538
|
-
remove(id, selection, targets, variables, visited = []) {
|
|
62539
|
-
visited.push(id);
|
|
62540
|
-
const linkedIDs = [];
|
|
62541
|
-
for (const fieldSelection of Object.values(selection.fields || {})) {
|
|
62542
|
-
const key = evaluateKey(fieldSelection.keyRaw, variables);
|
|
62543
|
-
this.removeSubscribers(id, key, targets);
|
|
62544
|
-
if (!fieldSelection.selection?.fields) {
|
|
62545
|
-
continue;
|
|
62546
|
-
}
|
|
62547
|
-
const { value: previousValue } = this.cache._internal_unstable.storage.get(id, key);
|
|
62548
|
-
const links = !Array.isArray(previousValue) ? [previousValue] : flattenList(previousValue);
|
|
62549
|
-
for (const link of links) {
|
|
62550
|
-
if (link !== null) {
|
|
62551
|
-
linkedIDs.push([link, fieldSelection.selection || {}]);
|
|
62552
|
-
}
|
|
62553
|
-
}
|
|
62554
|
-
}
|
|
62555
|
-
for (const [linkedRecordID, linkFields] of linkedIDs) {
|
|
62556
|
-
this.remove(linkedRecordID, linkFields, targets, visited);
|
|
62557
|
-
}
|
|
62558
|
-
}
|
|
62559
|
-
removeSubscribers(id, fieldName, specs) {
|
|
62560
|
-
let targets = [];
|
|
62561
|
-
for (const spec of specs) {
|
|
62562
|
-
if (!this.referenceCounts[id]?.[fieldName]?.has(spec.set)) {
|
|
62563
|
-
continue;
|
|
62564
|
-
}
|
|
62565
|
-
const counts = this.referenceCounts[id][fieldName];
|
|
62566
|
-
const newVal = (counts.get(spec.set) || 0) - 1;
|
|
62567
|
-
counts.set(spec.set, newVal);
|
|
62568
|
-
if (newVal <= 0) {
|
|
62569
|
-
targets.push(spec.set);
|
|
62570
|
-
counts.delete(spec.set);
|
|
62571
|
-
}
|
|
62572
|
-
}
|
|
62573
|
-
if (this.subscribers[id]) {
|
|
62574
|
-
this.subscribers[id][fieldName] = this.get(id, fieldName).filter(
|
|
62575
|
-
({ set }) => !targets.includes(set)
|
|
62576
|
-
);
|
|
62577
|
-
}
|
|
62578
|
-
}
|
|
62579
|
-
removeAllSubscribers(id, targets, visited = []) {
|
|
62580
|
-
visited.push(id);
|
|
62581
|
-
for (const field of Object.keys(this.subscribers[id] || [])) {
|
|
62582
|
-
const subscribers = targets || this.subscribers[id][field];
|
|
62583
|
-
this.removeSubscribers(id, field, subscribers);
|
|
62584
|
-
const { value, kind } = this.cache._internal_unstable.storage.get(id, field);
|
|
62585
|
-
if (kind === "scalar") {
|
|
62586
|
-
continue;
|
|
62587
|
-
}
|
|
62588
|
-
const nextTargets = Array.isArray(value) ? flattenList(value) : [value];
|
|
62589
|
-
for (const id2 of nextTargets) {
|
|
62590
|
-
if (visited.includes(id2)) {
|
|
62591
|
-
continue;
|
|
62592
|
-
}
|
|
62593
|
-
this.removeAllSubscribers(id2, subscribers, visited);
|
|
62594
|
-
}
|
|
62595
|
-
}
|
|
62596
|
-
}
|
|
62597
|
-
};
|
|
62598
|
-
|
|
62599
|
-
// src/runtime/cache/cache.ts
|
|
62600
|
-
var Cache3 = class {
|
|
62601
|
-
_internal_unstable;
|
|
62602
|
-
constructor(config) {
|
|
62603
|
-
this._internal_unstable = new CacheInternal({
|
|
62604
|
-
cache: this,
|
|
62605
|
-
storage: new InMemoryStorage(),
|
|
62606
|
-
subscriptions: new InMemorySubscriptions(this),
|
|
62607
|
-
lists: new ListManager(this, rootID),
|
|
62608
|
-
lifetimes: new GarbageCollector(this),
|
|
62609
|
-
schema: new SchemaManager(this)
|
|
62610
|
-
});
|
|
62611
|
-
if (config) {
|
|
62612
|
-
this.setConfig(defaultConfigValues(config));
|
|
62613
|
-
}
|
|
62614
|
-
}
|
|
62615
|
-
write({
|
|
62616
|
-
layer: layerID,
|
|
62617
|
-
notifySubscribers = [],
|
|
62618
|
-
...args
|
|
62619
|
-
}) {
|
|
62620
|
-
const layer = layerID ? this._internal_unstable.storage.getLayer(layerID) : this._internal_unstable.storage.topLayer;
|
|
62621
|
-
const subscribers = this._internal_unstable.writeSelection({ ...args, layer });
|
|
62622
|
-
const notified = [];
|
|
62623
|
-
for (const spec of subscribers.concat(notifySubscribers)) {
|
|
62624
|
-
if (!notified.includes(spec.set)) {
|
|
62625
|
-
notified.push(spec.set);
|
|
62626
|
-
spec.set(
|
|
62627
|
-
this._internal_unstable.getSelection({
|
|
62628
|
-
parent: spec.parentID || rootID,
|
|
62629
|
-
selection: spec.selection,
|
|
62630
|
-
variables: spec.variables?.() || {}
|
|
62631
|
-
}).data
|
|
62632
|
-
);
|
|
62633
|
-
}
|
|
62634
|
-
}
|
|
62635
|
-
return subscribers;
|
|
62636
|
-
}
|
|
62637
|
-
read(...args) {
|
|
62638
|
-
const { data, partial, hasData } = this._internal_unstable.getSelection(...args);
|
|
62639
|
-
if (!hasData) {
|
|
62640
|
-
return { data: null, partial: false };
|
|
62641
|
-
}
|
|
62642
|
-
return {
|
|
62643
|
-
data,
|
|
62644
|
-
partial
|
|
62645
|
-
};
|
|
62646
|
-
}
|
|
62647
|
-
subscribe(spec, variables = {}) {
|
|
62648
|
-
return this._internal_unstable.subscriptions.add({
|
|
62649
|
-
parent: spec.parentID || rootID,
|
|
62650
|
-
spec,
|
|
62651
|
-
selection: spec.selection,
|
|
62652
|
-
variables
|
|
62653
|
-
});
|
|
62654
|
-
}
|
|
62655
|
-
unsubscribe(spec, variables = {}) {
|
|
62656
|
-
return this._internal_unstable.subscriptions.remove(
|
|
62657
|
-
spec.parentID || rootID,
|
|
62658
|
-
spec.selection,
|
|
62659
|
-
[spec],
|
|
62660
|
-
variables
|
|
62661
|
-
);
|
|
62662
|
-
}
|
|
62663
|
-
list(name, parentID, allLists) {
|
|
62664
|
-
const handler = this._internal_unstable.lists.get(name, parentID, allLists);
|
|
62665
|
-
if (!handler) {
|
|
62666
|
-
throw new Error(
|
|
62667
|
-
`Cannot find list with name: ${name}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
62668
|
-
);
|
|
62669
|
-
}
|
|
62670
|
-
return handler;
|
|
62671
|
-
}
|
|
62672
|
-
delete(id) {
|
|
62673
|
-
this._internal_unstable.subscriptions.removeAllSubscribers(id);
|
|
62674
|
-
this._internal_unstable.lists.removeIDFromAllLists(id);
|
|
62675
|
-
this._internal_unstable.storage.delete(id);
|
|
62676
|
-
}
|
|
62677
|
-
setConfig(config) {
|
|
62678
|
-
this._internal_unstable.setConfig(config);
|
|
62679
|
-
}
|
|
62680
|
-
};
|
|
62681
|
-
var CacheInternal = class {
|
|
62682
|
-
_disabled = false;
|
|
62683
|
-
config = defaultConfigValues({
|
|
62684
|
-
plugins: {
|
|
62685
|
-
"houdini-svelte": {
|
|
62686
|
-
client: ""
|
|
62687
|
-
}
|
|
62688
|
-
}
|
|
62689
|
-
});
|
|
62690
|
-
storage;
|
|
62691
|
-
subscriptions;
|
|
62692
|
-
lists;
|
|
62693
|
-
cache;
|
|
62694
|
-
lifetimes;
|
|
62695
|
-
schema;
|
|
62696
|
-
constructor({
|
|
62697
|
-
storage,
|
|
62698
|
-
subscriptions,
|
|
62699
|
-
lists,
|
|
62700
|
-
cache,
|
|
62701
|
-
lifetimes,
|
|
62702
|
-
schema
|
|
62703
|
-
}) {
|
|
62704
|
-
this.storage = storage;
|
|
62705
|
-
this.subscriptions = subscriptions;
|
|
62706
|
-
this.lists = lists;
|
|
62707
|
-
this.cache = cache;
|
|
62708
|
-
this.lifetimes = lifetimes;
|
|
62709
|
-
this.schema = schema;
|
|
62710
|
-
this._disabled = typeof globalThis.window === "undefined";
|
|
62711
|
-
try {
|
|
62712
|
-
if (process.env.HOUDINI_TEST === "true") {
|
|
62713
|
-
this._disabled = false;
|
|
62714
|
-
}
|
|
62715
|
-
} catch {
|
|
62716
|
-
}
|
|
62717
|
-
}
|
|
62718
|
-
setConfig(config) {
|
|
62719
|
-
this.config = config;
|
|
62720
|
-
}
|
|
62721
|
-
writeSelection({
|
|
62722
|
-
data,
|
|
62723
|
-
selection,
|
|
62724
|
-
variables = {},
|
|
62725
|
-
parent = rootID,
|
|
62726
|
-
applyUpdates = false,
|
|
62727
|
-
layer,
|
|
62728
|
-
toNotify = [],
|
|
62729
|
-
forceNotify
|
|
62730
|
-
}) {
|
|
62731
|
-
if (this._disabled) {
|
|
62732
|
-
return [];
|
|
62733
|
-
}
|
|
62734
|
-
let targetSelection = getFieldsForType(selection, data["__typename"]);
|
|
62735
|
-
for (const [field, value] of Object.entries(data)) {
|
|
62736
|
-
if (!selection || !targetSelection[field]) {
|
|
62737
|
-
throw new Error(
|
|
62738
|
-
"Could not find field listing in selection for " + field + " @ " + JSON.stringify(selection)
|
|
62739
|
-
);
|
|
62740
|
-
}
|
|
62741
|
-
let {
|
|
62742
|
-
type: linkedType,
|
|
62743
|
-
keyRaw,
|
|
62744
|
-
selection: fieldSelection,
|
|
62745
|
-
operations,
|
|
62746
|
-
abstract: isAbstract,
|
|
62747
|
-
update,
|
|
62748
|
-
nullable
|
|
62749
|
-
} = targetSelection[field];
|
|
62750
|
-
const key = evaluateKey(keyRaw, variables);
|
|
62751
|
-
this.schema.setFieldType({
|
|
62752
|
-
parent,
|
|
62753
|
-
key: keyRaw,
|
|
62754
|
-
type: linkedType,
|
|
62755
|
-
nullable,
|
|
62756
|
-
link: !!fieldSelection
|
|
62757
|
-
});
|
|
62758
|
-
const currentSubscribers = this.subscriptions.get(parent, key);
|
|
62759
|
-
const { value: previousValue, displayLayers } = this.storage.get(parent, key);
|
|
62760
|
-
const displayLayer = layer.isDisplayLayer(displayLayers);
|
|
62761
|
-
if (displayLayer) {
|
|
62762
|
-
this.lifetimes.resetLifetime(parent, key);
|
|
62763
|
-
}
|
|
62764
|
-
if (!fieldSelection) {
|
|
62765
|
-
let newValue = value;
|
|
62766
|
-
if (Array.isArray(value) && applyUpdates && update) {
|
|
62767
|
-
if (update === "append") {
|
|
62768
|
-
newValue = (previousValue || []).concat(value);
|
|
62769
|
-
} else if (update === "prepend") {
|
|
62770
|
-
newValue = value.concat(previousValue || []);
|
|
62771
|
-
}
|
|
62772
|
-
}
|
|
62773
|
-
const valueChanged = !deepEquals(newValue, previousValue);
|
|
62774
|
-
if (displayLayer && (valueChanged || forceNotify)) {
|
|
62775
|
-
toNotify.push(...currentSubscribers);
|
|
62776
|
-
}
|
|
62777
|
-
layer.writeField(parent, key, newValue);
|
|
62778
|
-
} else if (value === null) {
|
|
62779
|
-
if (previousValue === null) {
|
|
62780
|
-
continue;
|
|
62781
|
-
}
|
|
62782
|
-
const previousLinks = flattenList([previousValue]);
|
|
62783
|
-
for (const link of previousLinks) {
|
|
62784
|
-
this.subscriptions.remove(link, fieldSelection, currentSubscribers, variables);
|
|
62785
|
-
}
|
|
62786
|
-
layer.writeLink(parent, key, null);
|
|
62787
|
-
toNotify.push(...currentSubscribers);
|
|
62788
|
-
} else if (value instanceof Object && !Array.isArray(value)) {
|
|
62789
|
-
if (isAbstract) {
|
|
62790
|
-
if (!value.__typename) {
|
|
62791
|
-
throw new Error(
|
|
62792
|
-
"Encountered interface type without __typename in the payload"
|
|
62793
|
-
);
|
|
62794
|
-
}
|
|
62795
|
-
linkedType = value.__typename;
|
|
62796
|
-
}
|
|
62797
|
-
const embedded = this.idFields(linkedType)?.filter(
|
|
62798
|
-
(field2) => typeof value[field2] === "undefined"
|
|
62799
|
-
).length > 0;
|
|
62800
|
-
let linkedID = null;
|
|
62801
|
-
if (value !== null) {
|
|
62802
|
-
linkedID = !embedded ? this.id(linkedType, value) : `${parent}.${key}`;
|
|
62803
|
-
}
|
|
62804
|
-
let linkChange = linkedID !== previousValue;
|
|
62805
|
-
layer.writeLink(parent, key, linkedID);
|
|
62806
|
-
if (linkedID && displayLayer && (linkChange || forceNotify)) {
|
|
62807
|
-
if (previousValue && typeof previousValue === "string") {
|
|
62808
|
-
this.subscriptions.remove(
|
|
62809
|
-
previousValue,
|
|
62810
|
-
fieldSelection,
|
|
62811
|
-
currentSubscribers,
|
|
62812
|
-
variables
|
|
62813
|
-
);
|
|
62814
|
-
}
|
|
62815
|
-
this.subscriptions.addMany({
|
|
62816
|
-
parent: linkedID,
|
|
62817
|
-
selection: fieldSelection,
|
|
62818
|
-
subscribers: currentSubscribers,
|
|
62819
|
-
variables,
|
|
62820
|
-
parentType: linkedType
|
|
62821
|
-
});
|
|
62822
|
-
toNotify.push(...currentSubscribers);
|
|
62823
|
-
}
|
|
62824
|
-
if (linkedID) {
|
|
62825
|
-
this.writeSelection({
|
|
62826
|
-
selection: fieldSelection,
|
|
62827
|
-
parent: linkedID,
|
|
62828
|
-
data: value,
|
|
62829
|
-
variables,
|
|
62830
|
-
toNotify,
|
|
62831
|
-
applyUpdates,
|
|
62832
|
-
layer,
|
|
62833
|
-
forceNotify
|
|
62834
|
-
});
|
|
62835
|
-
}
|
|
62836
|
-
} else if (Array.isArray(value) && (typeof previousValue === "undefined" || Array.isArray(previousValue))) {
|
|
62837
|
-
let oldIDs = [...previousValue || []];
|
|
62838
|
-
const emptyEdges = !update ? [] : oldIDs.map((id) => {
|
|
62839
|
-
if (!id) {
|
|
62840
|
-
return "";
|
|
62841
|
-
}
|
|
62842
|
-
const { value: cursorField } = this.storage.get(id, "cursor");
|
|
62843
|
-
if (cursorField) {
|
|
62844
|
-
return "";
|
|
62845
|
-
}
|
|
62846
|
-
const { value: node } = this.storage.get(id, "node");
|
|
62847
|
-
if (!node) {
|
|
62848
|
-
return "";
|
|
62849
|
-
}
|
|
62850
|
-
return node;
|
|
62851
|
-
});
|
|
62852
|
-
let linkedIDs = [];
|
|
62853
|
-
const { newIDs, nestedIDs } = this.extractNestedListIDs({
|
|
62854
|
-
value,
|
|
62855
|
-
abstract: Boolean(isAbstract),
|
|
62856
|
-
specs: toNotify,
|
|
62857
|
-
applyUpdates,
|
|
62858
|
-
recordID: parent,
|
|
62859
|
-
key,
|
|
62860
|
-
linkedType,
|
|
62861
|
-
variables,
|
|
62862
|
-
fields: fieldSelection,
|
|
62863
|
-
layer,
|
|
62864
|
-
forceNotify
|
|
62865
|
-
});
|
|
62866
|
-
if (applyUpdates && update) {
|
|
62867
|
-
if (key === "edges") {
|
|
62868
|
-
const newNodeIDs = [];
|
|
62869
|
-
for (const id of newIDs) {
|
|
62870
|
-
if (!id) {
|
|
62871
|
-
continue;
|
|
62872
|
-
}
|
|
62873
|
-
const { value: node } = this.storage.get(id, "node");
|
|
62874
|
-
if (typeof node !== "string") {
|
|
62875
|
-
continue;
|
|
62876
|
-
}
|
|
62877
|
-
if (!node || !this.storage.get(node, "__typename")) {
|
|
62878
|
-
continue;
|
|
62879
|
-
}
|
|
62880
|
-
newNodeIDs.push(node);
|
|
62881
|
-
}
|
|
62882
|
-
oldIDs = oldIDs.filter((id) => {
|
|
62883
|
-
if (!id) {
|
|
62884
|
-
return true;
|
|
62885
|
-
}
|
|
62886
|
-
const { value: value2 } = this.storage.get(id, "node");
|
|
62887
|
-
const node = value2;
|
|
62888
|
-
if (newNodeIDs.includes(node) && emptyEdges.includes(node)) {
|
|
62889
|
-
return false;
|
|
62890
|
-
}
|
|
62891
|
-
return true;
|
|
62892
|
-
});
|
|
62893
|
-
}
|
|
62894
|
-
if (update === "prepend") {
|
|
62895
|
-
linkedIDs = newIDs.concat(oldIDs);
|
|
62896
|
-
} else if (update === "append") {
|
|
62897
|
-
linkedIDs = oldIDs.concat(newIDs);
|
|
62898
|
-
} else if (update === "replace") {
|
|
62899
|
-
linkedIDs = newIDs;
|
|
62900
|
-
}
|
|
62901
|
-
} else {
|
|
62902
|
-
linkedIDs = nestedIDs;
|
|
62903
|
-
}
|
|
62904
|
-
const contentChanged = !deepEquals(linkedIDs, oldIDs);
|
|
62905
|
-
if (contentChanged || forceNotify) {
|
|
62906
|
-
toNotify.push(...currentSubscribers);
|
|
62907
|
-
}
|
|
62908
|
-
for (const lostID of oldIDs) {
|
|
62909
|
-
if (linkedIDs.includes(lostID) || !lostID) {
|
|
62910
|
-
continue;
|
|
62911
|
-
}
|
|
62912
|
-
this.subscriptions.remove(lostID, fieldSelection, currentSubscribers, variables);
|
|
62913
|
-
}
|
|
62914
|
-
if (contentChanged || oldIDs.length === 0 && newIDs.length === 0) {
|
|
62915
|
-
layer.writeLink(parent, key, linkedIDs);
|
|
62916
|
-
}
|
|
62917
|
-
for (const id of newIDs.filter((id2) => !oldIDs.includes(id2))) {
|
|
62918
|
-
if (id == null) {
|
|
62919
|
-
continue;
|
|
62920
|
-
}
|
|
62921
|
-
this.subscriptions.addMany({
|
|
62922
|
-
parent: id,
|
|
62923
|
-
selection: fieldSelection,
|
|
62924
|
-
subscribers: currentSubscribers,
|
|
62925
|
-
variables,
|
|
62926
|
-
parentType: linkedType
|
|
62927
|
-
});
|
|
62928
|
-
}
|
|
62929
|
-
}
|
|
62930
|
-
for (const operation of operations || []) {
|
|
62931
|
-
let parentID;
|
|
62932
|
-
if (operation.parentID) {
|
|
62933
|
-
if (operation.parentID.kind !== "Variable") {
|
|
62934
|
-
parentID = operation.parentID.value;
|
|
62935
|
-
} else {
|
|
62936
|
-
const id = variables[operation.parentID.value];
|
|
62937
|
-
if (typeof id !== "string") {
|
|
62938
|
-
throw new Error("parentID value must be a string");
|
|
62939
|
-
}
|
|
62940
|
-
parentID = id;
|
|
62941
|
-
}
|
|
62942
|
-
}
|
|
62943
|
-
if (operation.list && !this.lists.get(operation.list, parentID, operation.target === "all")) {
|
|
62944
|
-
continue;
|
|
62945
|
-
}
|
|
62946
|
-
const targets = Array.isArray(value) ? value : [value];
|
|
62947
|
-
for (const target of targets) {
|
|
62948
|
-
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
62949
|
-
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(
|
|
62950
|
-
fieldSelection,
|
|
62951
|
-
target,
|
|
62952
|
-
variables,
|
|
62953
|
-
operation.position || "last"
|
|
62954
|
-
);
|
|
62955
|
-
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
62956
|
-
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
|
|
62957
|
-
} else if (operation.action === "delete" && operation.type) {
|
|
62958
|
-
if (typeof target !== "string") {
|
|
62959
|
-
throw new Error("Cannot delete a record with a non-string ID");
|
|
62960
|
-
}
|
|
62961
|
-
const targetID = this.id(operation.type, target);
|
|
62962
|
-
if (!targetID) {
|
|
62963
|
-
continue;
|
|
62964
|
-
}
|
|
62965
|
-
this.cache.delete(targetID);
|
|
62966
|
-
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
62967
|
-
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(
|
|
62968
|
-
fieldSelection,
|
|
62969
|
-
target,
|
|
62970
|
-
variables,
|
|
62971
|
-
operation.position || "last"
|
|
62972
|
-
);
|
|
62973
|
-
}
|
|
62974
|
-
}
|
|
62975
|
-
}
|
|
62976
|
-
}
|
|
62977
|
-
return toNotify;
|
|
62978
|
-
}
|
|
62979
|
-
getSelection({
|
|
62980
|
-
selection,
|
|
62981
|
-
parent = rootID,
|
|
62982
|
-
variables,
|
|
62983
|
-
stepsFromConnection = null
|
|
62984
|
-
}) {
|
|
62985
|
-
if (parent === null) {
|
|
62986
|
-
return { data: null, partial: false, hasData: true };
|
|
62987
|
-
}
|
|
62988
|
-
const target = {};
|
|
62989
|
-
let hasData = false;
|
|
62990
|
-
let partial = false;
|
|
62991
|
-
let cascadeNull = false;
|
|
62992
|
-
const typename = this.storage.get(parent, "__typename").value;
|
|
62993
|
-
let targetSelection = getFieldsForType(selection, typename);
|
|
62994
|
-
for (const [
|
|
62995
|
-
attributeName,
|
|
62996
|
-
{ type, keyRaw, selection: fieldSelection, nullable, list }
|
|
62997
|
-
] of Object.entries(targetSelection)) {
|
|
62998
|
-
const key = evaluateKey(keyRaw, variables);
|
|
62999
|
-
const { value } = this.storage.get(parent, key);
|
|
63000
|
-
let nextStep = stepsFromConnection;
|
|
63001
|
-
if (nextStep !== null) {
|
|
63002
|
-
if (nextStep >= 2) {
|
|
63003
|
-
nextStep = null;
|
|
63004
|
-
} else {
|
|
63005
|
-
nextStep += 1;
|
|
63006
|
-
}
|
|
63007
|
-
}
|
|
63008
|
-
if (list?.connection) {
|
|
63009
|
-
nextStep = 0;
|
|
63010
|
-
}
|
|
63011
|
-
const embeddedCursor = key === "cursor" && stepsFromConnection === 1;
|
|
63012
|
-
if (typeof value === "undefined" && !embeddedCursor) {
|
|
63013
|
-
partial = true;
|
|
63014
|
-
}
|
|
63015
|
-
if (typeof value === "undefined" || value === null) {
|
|
63016
|
-
target[attributeName] = null;
|
|
63017
|
-
if (typeof value !== "undefined") {
|
|
63018
|
-
hasData = true;
|
|
63019
|
-
}
|
|
63020
|
-
} else if (!fieldSelection) {
|
|
63021
|
-
const fnUnmarshal = this.config?.scalars?.[type]?.unmarshal;
|
|
63022
|
-
if (fnUnmarshal) {
|
|
63023
|
-
target[attributeName] = fnUnmarshal(value);
|
|
63024
|
-
} else {
|
|
63025
|
-
target[attributeName] = value;
|
|
63026
|
-
}
|
|
63027
|
-
hasData = true;
|
|
63028
|
-
} else if (Array.isArray(value)) {
|
|
63029
|
-
const listValue = this.hydrateNestedList({
|
|
63030
|
-
fields: fieldSelection,
|
|
63031
|
-
variables,
|
|
63032
|
-
linkedList: value,
|
|
63033
|
-
stepsFromConnection: nextStep
|
|
63034
|
-
});
|
|
63035
|
-
target[attributeName] = listValue.data;
|
|
63036
|
-
if (listValue.partial) {
|
|
63037
|
-
partial = true;
|
|
63038
|
-
}
|
|
63039
|
-
if (listValue.hasData || value.length === 0) {
|
|
63040
|
-
hasData = true;
|
|
63041
|
-
}
|
|
63042
|
-
} else {
|
|
63043
|
-
const objectFields = this.getSelection({
|
|
63044
|
-
parent: value,
|
|
63045
|
-
selection: fieldSelection,
|
|
63046
|
-
variables,
|
|
63047
|
-
stepsFromConnection: nextStep
|
|
63048
|
-
});
|
|
63049
|
-
target[attributeName] = objectFields.data;
|
|
63050
|
-
if (objectFields.partial) {
|
|
63051
|
-
partial = true;
|
|
63052
|
-
}
|
|
63053
|
-
if (objectFields.hasData) {
|
|
63054
|
-
hasData = true;
|
|
63055
|
-
}
|
|
63056
|
-
}
|
|
63057
|
-
if (target[attributeName] === null && !nullable && !embeddedCursor) {
|
|
63058
|
-
cascadeNull = true;
|
|
63059
|
-
}
|
|
63060
|
-
}
|
|
63061
|
-
return {
|
|
63062
|
-
data: cascadeNull ? null : target,
|
|
63063
|
-
partial: hasData && partial,
|
|
63064
|
-
hasData
|
|
63065
|
-
};
|
|
63066
|
-
}
|
|
63067
|
-
id(type, data) {
|
|
63068
|
-
const id = typeof data === "string" ? data : this.computeID(type, data);
|
|
63069
|
-
if (!id) {
|
|
63070
|
-
return null;
|
|
63071
|
-
}
|
|
63072
|
-
if (!type) {
|
|
63073
|
-
return id;
|
|
63074
|
-
}
|
|
63075
|
-
return type + ":" + id;
|
|
63076
|
-
}
|
|
63077
|
-
idFields(type) {
|
|
63078
|
-
return keyFieldsForType(this.config, type);
|
|
63079
|
-
}
|
|
63080
|
-
computeID(type, data) {
|
|
63081
|
-
return computeID(this.config, type, data);
|
|
63082
|
-
}
|
|
63083
|
-
hydrateNestedList({
|
|
63084
|
-
fields,
|
|
63085
|
-
variables,
|
|
63086
|
-
linkedList,
|
|
63087
|
-
stepsFromConnection
|
|
63088
|
-
}) {
|
|
63089
|
-
const result = [];
|
|
63090
|
-
let partialData = false;
|
|
63091
|
-
let hasValues = false;
|
|
63092
|
-
for (const entry of linkedList) {
|
|
63093
|
-
if (Array.isArray(entry)) {
|
|
63094
|
-
const nestedValue = this.hydrateNestedList({
|
|
63095
|
-
fields,
|
|
63096
|
-
variables,
|
|
63097
|
-
linkedList: entry,
|
|
63098
|
-
stepsFromConnection
|
|
63099
|
-
});
|
|
63100
|
-
result.push(nestedValue.data);
|
|
63101
|
-
if (nestedValue.partial) {
|
|
63102
|
-
partialData = true;
|
|
63103
|
-
}
|
|
63104
|
-
continue;
|
|
63105
|
-
}
|
|
63106
|
-
if (entry === null) {
|
|
63107
|
-
result.push(entry);
|
|
63108
|
-
continue;
|
|
63109
|
-
}
|
|
63110
|
-
const { data, partial, hasData } = this.getSelection({
|
|
63111
|
-
parent: entry,
|
|
63112
|
-
selection: fields,
|
|
63113
|
-
variables,
|
|
63114
|
-
stepsFromConnection
|
|
63115
|
-
});
|
|
63116
|
-
result.push(data);
|
|
63117
|
-
if (partial) {
|
|
63118
|
-
partialData = true;
|
|
63119
|
-
}
|
|
63120
|
-
if (hasData) {
|
|
63121
|
-
hasValues = true;
|
|
63122
|
-
}
|
|
63123
|
-
}
|
|
63124
|
-
return {
|
|
63125
|
-
data: result,
|
|
63126
|
-
partial: partialData,
|
|
63127
|
-
hasData: hasValues
|
|
63128
|
-
};
|
|
63129
|
-
}
|
|
63130
|
-
extractNestedListIDs({
|
|
63131
|
-
value,
|
|
63132
|
-
abstract,
|
|
63133
|
-
recordID,
|
|
63134
|
-
key,
|
|
63135
|
-
linkedType,
|
|
63136
|
-
fields,
|
|
63137
|
-
variables,
|
|
63138
|
-
applyUpdates,
|
|
63139
|
-
specs,
|
|
63140
|
-
layer,
|
|
63141
|
-
forceNotify
|
|
63142
|
-
}) {
|
|
63143
|
-
const nestedIDs = [];
|
|
63144
|
-
const newIDs = [];
|
|
63145
|
-
for (const [i2, entry] of value.entries()) {
|
|
63146
|
-
if (Array.isArray(entry)) {
|
|
63147
|
-
const inner = this.extractNestedListIDs({
|
|
63148
|
-
value: entry,
|
|
63149
|
-
abstract,
|
|
63150
|
-
recordID,
|
|
63151
|
-
key,
|
|
63152
|
-
linkedType,
|
|
63153
|
-
fields,
|
|
63154
|
-
variables,
|
|
63155
|
-
applyUpdates,
|
|
63156
|
-
specs,
|
|
63157
|
-
layer,
|
|
63158
|
-
forceNotify
|
|
63159
|
-
});
|
|
63160
|
-
newIDs.push(...inner.newIDs);
|
|
63161
|
-
nestedIDs[i2] = inner.nestedIDs;
|
|
63162
|
-
continue;
|
|
63163
|
-
}
|
|
63164
|
-
if (entry === null || typeof entry === "undefined") {
|
|
63165
|
-
newIDs.push(null);
|
|
63166
|
-
nestedIDs[i2] = null;
|
|
63167
|
-
continue;
|
|
63168
|
-
}
|
|
63169
|
-
const entryObj = entry;
|
|
63170
|
-
let linkedID = `${recordID}.${key}[${this.storage.nextRank}]`;
|
|
63171
|
-
const embedded = this.idFields(linkedType)?.filter(
|
|
63172
|
-
(field) => typeof entry[field] === "undefined"
|
|
63173
|
-
).length > 0;
|
|
63174
|
-
const typename = entryObj.__typename;
|
|
63175
|
-
let innerType = linkedType;
|
|
63176
|
-
if (abstract) {
|
|
63177
|
-
if (!typename) {
|
|
63178
|
-
throw new Error("Encountered interface type without __typename in the payload");
|
|
63179
|
-
}
|
|
63180
|
-
innerType = typename;
|
|
63181
|
-
}
|
|
63182
|
-
if (!embedded) {
|
|
63183
|
-
const id = this.id(innerType, entry);
|
|
63184
|
-
if (id) {
|
|
63185
|
-
linkedID = id;
|
|
63186
|
-
} else {
|
|
63187
|
-
continue;
|
|
63188
|
-
}
|
|
63189
|
-
}
|
|
63190
|
-
this.writeSelection({
|
|
63191
|
-
root: rootID,
|
|
63192
|
-
selection: fields,
|
|
63193
|
-
parent: linkedID,
|
|
63194
|
-
data: entryObj,
|
|
63195
|
-
variables,
|
|
63196
|
-
toNotify: specs,
|
|
63197
|
-
applyUpdates,
|
|
63198
|
-
layer,
|
|
63199
|
-
forceNotify
|
|
63200
|
-
});
|
|
63201
|
-
newIDs.push(linkedID);
|
|
63202
|
-
nestedIDs[i2] = linkedID;
|
|
63203
|
-
}
|
|
63204
|
-
return { newIDs, nestedIDs };
|
|
63205
|
-
}
|
|
63206
|
-
collectGarbage() {
|
|
63207
|
-
this.lifetimes.tick();
|
|
63208
|
-
if (this.storage.layerCount === 1) {
|
|
63209
|
-
this.storage.topLayer.removeUndefinedFields();
|
|
63210
|
-
}
|
|
63211
|
-
}
|
|
63212
|
-
};
|
|
63213
|
-
var rootID = "_ROOT_";
|
|
63214
|
-
|
|
63215
|
-
// src/runtime/cache/index.ts
|
|
63216
|
-
var cache_default = new Cache3();
|
|
63217
61507
|
|
|
63218
61508
|
// src/runtime/lib/types.ts
|
|
63219
61509
|
var CachePolicy = /* @__PURE__ */ ((CachePolicy2) => {
|
|
@@ -63538,7 +61828,7 @@ async function recursiveCopy(source, target, transforms, notRoot) {
|
|
|
63538
61828
|
const targetPath = join2(parentDir, child);
|
|
63539
61829
|
let original = await readFile(childPath) || "";
|
|
63540
61830
|
if (transforms?.[childPath]) {
|
|
63541
|
-
original = transforms[childPath](original);
|
|
61831
|
+
original = await transforms[childPath](original, childPath);
|
|
63542
61832
|
}
|
|
63543
61833
|
await writeFile(targetPath, original);
|
|
63544
61834
|
}
|
|
@@ -63674,7 +61964,7 @@ var Body = class {
|
|
|
63674
61964
|
} else if (ArrayBuffer.isView(body)) {
|
|
63675
61965
|
body = import_node_buffer.Buffer.from(body.buffer, body.byteOffset, body.byteLength);
|
|
63676
61966
|
} else if (body instanceof import_node_stream.default) {
|
|
63677
|
-
} else if (body instanceof
|
|
61967
|
+
} else if (body instanceof FormData) {
|
|
63678
61968
|
body = formDataToBlob(body);
|
|
63679
61969
|
boundary = body.type.split("=")[1];
|
|
63680
61970
|
} else {
|
|
@@ -63714,7 +62004,7 @@ var Body = class {
|
|
|
63714
62004
|
async formData() {
|
|
63715
62005
|
const ct = this.headers.get("content-type");
|
|
63716
62006
|
if (ct.startsWith("application/x-www-form-urlencoded")) {
|
|
63717
|
-
const formData = new
|
|
62007
|
+
const formData = new FormData();
|
|
63718
62008
|
const parameters = new URLSearchParams(await this.text());
|
|
63719
62009
|
for (const [name, value] of parameters) {
|
|
63720
62010
|
formData.append(name, value);
|
|
@@ -63840,7 +62130,7 @@ var extractContentType = (body, request) => {
|
|
|
63840
62130
|
if (import_node_buffer.Buffer.isBuffer(body) || import_node_util.types.isAnyArrayBuffer(body) || ArrayBuffer.isView(body)) {
|
|
63841
62131
|
return null;
|
|
63842
62132
|
}
|
|
63843
|
-
if (body instanceof
|
|
62133
|
+
if (body instanceof FormData) {
|
|
63844
62134
|
return `multipart/form-data; boundary=${request[INTERNALS].boundary}`;
|
|
63845
62135
|
}
|
|
63846
62136
|
if (body && typeof body.getBoundary === "function") {
|
|
@@ -64850,8 +63140,7 @@ var Config = class {
|
|
|
64850
63140
|
types: types4 = {},
|
|
64851
63141
|
logLevel,
|
|
64852
63142
|
defaultFragmentMasking = "enable",
|
|
64853
|
-
|
|
64854
|
-
schemaPollHeaders = {},
|
|
63143
|
+
watchSchema,
|
|
64855
63144
|
projectDir
|
|
64856
63145
|
} = this.configFile;
|
|
64857
63146
|
if (typeof schema === "string") {
|
|
@@ -64884,8 +63173,8 @@ var Config = class {
|
|
|
64884
63173
|
this.logLevel = (logLevel || LogLevel.Summary).toLowerCase();
|
|
64885
63174
|
this.defaultFragmentMasking = defaultFragmentMasking;
|
|
64886
63175
|
this.routesDir = join2(this.projectRoot, "src", "routes");
|
|
64887
|
-
this.schemaPollInterval =
|
|
64888
|
-
this.schemaPollHeaders =
|
|
63176
|
+
this.schemaPollInterval = watchSchema?.interval ?? 2e3;
|
|
63177
|
+
this.schemaPollHeaders = watchSchema?.headers ?? {};
|
|
64889
63178
|
this.rootDir = join2(this.projectRoot, "$houdini");
|
|
64890
63179
|
if (defaultKeys) {
|
|
64891
63180
|
this.defaultKeys = defaultKeys;
|
|
@@ -64898,11 +63187,12 @@ var Config = class {
|
|
|
64898
63187
|
}
|
|
64899
63188
|
}
|
|
64900
63189
|
async apiURL() {
|
|
64901
|
-
|
|
63190
|
+
const apiURL = this.configFile.watchSchema?.url;
|
|
63191
|
+
if (!apiURL) {
|
|
64902
63192
|
return "";
|
|
64903
63193
|
}
|
|
64904
63194
|
const env = await this.getEnv();
|
|
64905
|
-
return this.processEnvValues(env,
|
|
63195
|
+
return this.processEnvValues(env, apiURL);
|
|
64906
63196
|
}
|
|
64907
63197
|
get include() {
|
|
64908
63198
|
if (this.configFile.include) {
|
|
@@ -65100,11 +63390,14 @@ var Config = class {
|
|
|
65100
63390
|
pluginRuntimeDirectory(name) {
|
|
65101
63391
|
return join2(this.pluginDirectory(name), "runtime");
|
|
65102
63392
|
}
|
|
63393
|
+
get pluginRootDirectory() {
|
|
63394
|
+
return houdini_mode.is_testing ? "../../../" : join2(this.rootDir, "plugins");
|
|
63395
|
+
}
|
|
65103
63396
|
pluginDirectory(name) {
|
|
65104
|
-
return
|
|
63397
|
+
return join2(this.pluginRootDirectory, name);
|
|
65105
63398
|
}
|
|
65106
|
-
get
|
|
65107
|
-
return "
|
|
63399
|
+
get loadDirective() {
|
|
63400
|
+
return "load";
|
|
65108
63401
|
}
|
|
65109
63402
|
get maskEnableDirective() {
|
|
65110
63403
|
return "mask_enable";
|
|
@@ -65151,6 +63444,9 @@ var Config = class {
|
|
|
65151
63444
|
get whenNotDirective() {
|
|
65152
63445
|
return this.whenDirective + "_not";
|
|
65153
63446
|
}
|
|
63447
|
+
get liveDirective() {
|
|
63448
|
+
return "live";
|
|
63449
|
+
}
|
|
65154
63450
|
get argumentsDirective() {
|
|
65155
63451
|
return "arguments";
|
|
65156
63452
|
}
|
|
@@ -65218,7 +63514,7 @@ var Config = class {
|
|
|
65218
63514
|
this.withDirective,
|
|
65219
63515
|
this.paginateDirective,
|
|
65220
63516
|
this.cacheDirective,
|
|
65221
|
-
this.
|
|
63517
|
+
this.loadDirective,
|
|
65222
63518
|
this.maskEnableDirective,
|
|
65223
63519
|
this.maskDisableDirective
|
|
65224
63520
|
].includes(name.value) || this.isDeleteDirective(name.value);
|
|
@@ -65346,7 +63642,9 @@ async function getConfig({
|
|
|
65346
63642
|
resolve2 = res;
|
|
65347
63643
|
reject = rej;
|
|
65348
63644
|
});
|
|
65349
|
-
let configFile =
|
|
63645
|
+
let configFile = {
|
|
63646
|
+
...await readConfigFile(configPath)
|
|
63647
|
+
};
|
|
65350
63648
|
if (!configFile.plugins) {
|
|
65351
63649
|
throw new HoudiniError({
|
|
65352
63650
|
message: "Welcome to 0.17.0! Please following the migration guide here: http://www.houdinigraphql.com/guides/release-notes#0170"
|
|
@@ -65401,13 +63699,14 @@ This will prevent your schema from being pulled.`
|
|
|
65401
63699
|
version = packageJSON.version;
|
|
65402
63700
|
} catch {
|
|
65403
63701
|
}
|
|
65404
|
-
|
|
65405
|
-
|
|
65406
|
-
|
|
65407
|
-
|
|
65408
|
-
|
|
65409
|
-
|
|
65410
|
-
|
|
63702
|
+
if (typeof plugin_config)
|
|
63703
|
+
plugins.push({
|
|
63704
|
+
...await pluginFactory(plugin_config),
|
|
63705
|
+
name: pluginName,
|
|
63706
|
+
include_runtime,
|
|
63707
|
+
version,
|
|
63708
|
+
directory: pluginDirectory
|
|
63709
|
+
});
|
|
65411
63710
|
} catch (e2) {
|
|
65412
63711
|
throw new Error(
|
|
65413
63712
|
`Could not find plugin: ${pluginName}. Are you sure its installed? If so, please open a ticket on GitHub.`
|
|
@@ -65825,7 +64124,7 @@ async function find_graphql(config, parsedScript, walker) {
|
|
|
65825
64124
|
return;
|
|
65826
64125
|
}
|
|
65827
64126
|
const parsedTag = graphql4.parse(documentString);
|
|
65828
|
-
if (walker.where && !walker.where(parsedTag)) {
|
|
64127
|
+
if (walker.where && !walker.where(parsedTag, { node, parent })) {
|
|
65829
64128
|
return;
|
|
65830
64129
|
}
|
|
65831
64130
|
const definition = config.extractDefinition(parsedTag);
|