@salesforce/lds-adapters-uiapi 1.157.2 → 1.158.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -435,26 +435,8 @@ function buildSelectionForNode$12(source, reader, parentNode, selectionNode, var
435
435
  }
436
436
  function select$1b(field, variables, fragments) {
437
437
  return (source, reader, parentRecordId) => {
438
- var _a;
439
438
  const sink = {};
440
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
441
- const builtSelection = buildSelectionForNode$12(source, reader, field, sel, variables, fragments, parentRecordId);
442
- if (builtSelection !== undefined) {
443
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
444
- Object.keys(builtSelection).forEach((key, value) => {
445
- // We only assign a field selection in the fragment if it doesn't already exist in sink
446
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
447
- if (sink[key] === undefined) {
448
- sink[key] = builtSelection[key];
449
- }
450
- });
451
- }
452
- else {
453
- Object.assign(sink, builtSelection);
454
- }
455
- }
456
- });
457
- return sink;
439
+ return selectCalculateSink(sink, field, buildSelectionForNode$12, source, reader, variables, fragments, parentRecordId);
458
440
  };
459
441
  }
460
442
  function getTypeCacheKeys$16(astNode, state) {
@@ -597,26 +579,8 @@ function buildSelectionForNode$11(source, reader, parentNode, selectionNode, var
597
579
  }
598
580
  function select$1a(field, variables, fragments) {
599
581
  return (source, reader, parentRecordId) => {
600
- var _a;
601
582
  const sink = {};
602
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
603
- const builtSelection = buildSelectionForNode$11(source, reader, field, sel, variables, fragments, parentRecordId);
604
- if (builtSelection !== undefined) {
605
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
606
- Object.keys(builtSelection).forEach((key, value) => {
607
- // We only assign a field selection in the fragment if it doesn't already exist in sink
608
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
609
- if (sink[key] === undefined) {
610
- sink[key] = builtSelection[key];
611
- }
612
- });
613
- }
614
- else {
615
- Object.assign(sink, builtSelection);
616
- }
617
- }
618
- });
619
- return sink;
583
+ return selectCalculateSink(sink, field, buildSelectionForNode$11, source, reader, variables, fragments, parentRecordId);
620
584
  };
621
585
  }
622
586
  function getTypeCacheKeys$15(astNode, state) {
@@ -759,26 +723,8 @@ function buildSelectionForNode$10(source, reader, parentNode, selectionNode, var
759
723
  }
760
724
  function select$19(field, variables, fragments) {
761
725
  return (source, reader, parentRecordId) => {
762
- var _a;
763
726
  const sink = {};
764
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
765
- const builtSelection = buildSelectionForNode$10(source, reader, field, sel, variables, fragments, parentRecordId);
766
- if (builtSelection !== undefined) {
767
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
768
- Object.keys(builtSelection).forEach((key, value) => {
769
- // We only assign a field selection in the fragment if it doesn't already exist in sink
770
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
771
- if (sink[key] === undefined) {
772
- sink[key] = builtSelection[key];
773
- }
774
- });
775
- }
776
- else {
777
- Object.assign(sink, builtSelection);
778
- }
779
- }
780
- });
781
- return sink;
727
+ return selectCalculateSink(sink, field, buildSelectionForNode$10, source, reader, variables, fragments, parentRecordId);
782
728
  };
783
729
  }
784
730
  function getTypeCacheKeys$14(astNode, state) {
@@ -933,26 +879,8 @@ function buildSelectionForNode$$(source, reader, parentNode, selectionNode, vari
933
879
  }
934
880
  function select$18(field, variables, fragments) {
935
881
  return (source, reader, parentRecordId) => {
936
- var _a;
937
882
  const sink = {};
938
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
939
- const builtSelection = buildSelectionForNode$$(source, reader, field, sel, variables, fragments, parentRecordId);
940
- if (builtSelection !== undefined) {
941
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
942
- Object.keys(builtSelection).forEach((key, value) => {
943
- // We only assign a field selection in the fragment if it doesn't already exist in sink
944
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
945
- if (sink[key] === undefined) {
946
- sink[key] = builtSelection[key];
947
- }
948
- });
949
- }
950
- else {
951
- Object.assign(sink, builtSelection);
952
- }
953
- }
954
- });
955
- return sink;
883
+ return selectCalculateSink(sink, field, buildSelectionForNode$$, source, reader, variables, fragments, parentRecordId);
956
884
  };
957
885
  }
958
886
  function getMinimumSelections$L() {
@@ -977,10 +905,10 @@ function getTypeCacheKeys$13(astNode, state) {
977
905
  representationName: name$_
978
906
  });
979
907
  // get all cache keys from normalizable fields
980
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$$) : [];
908
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$$) : new Map();
981
909
  for (const fieldDataKey of Object.keys(data)) {
982
910
  const fieldData = data[fieldDataKey];
983
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
911
+ const requestedField = requestedFields.get(fieldDataKey);
984
912
  if (requestedField === undefined) {
985
913
  continue; // Skip unknown field.
986
914
  }
@@ -1275,26 +1203,8 @@ function buildSelectionForNode$_(source, reader, parentNode, selectionNode, vari
1275
1203
  }
1276
1204
  function select$17(field, variables, fragments) {
1277
1205
  return (source, reader, parentRecordId) => {
1278
- var _a;
1279
1206
  const sink = {};
1280
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
1281
- const builtSelection = buildSelectionForNode$_(source, reader, field, sel, variables, fragments, parentRecordId);
1282
- if (builtSelection !== undefined) {
1283
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
1284
- Object.keys(builtSelection).forEach((key, value) => {
1285
- // We only assign a field selection in the fragment if it doesn't already exist in sink
1286
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
1287
- if (sink[key] === undefined) {
1288
- sink[key] = builtSelection[key];
1289
- }
1290
- });
1291
- }
1292
- else {
1293
- Object.assign(sink, builtSelection);
1294
- }
1295
- }
1296
- });
1297
- return sink;
1207
+ return selectCalculateSink(sink, field, buildSelectionForNode$_, source, reader, variables, fragments, parentRecordId);
1298
1208
  };
1299
1209
  }
1300
1210
  function getTypeCacheKeys$12(astNode, state) {
@@ -1432,26 +1342,8 @@ function buildSelectionForNode$Z(source, reader, parentNode, selectionNode, vari
1432
1342
  }
1433
1343
  function select$16(field, variables, fragments) {
1434
1344
  return (source, reader, parentRecordId) => {
1435
- var _a;
1436
1345
  const sink = {};
1437
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
1438
- const builtSelection = buildSelectionForNode$Z(source, reader, field, sel, variables, fragments, parentRecordId);
1439
- if (builtSelection !== undefined) {
1440
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
1441
- Object.keys(builtSelection).forEach((key, value) => {
1442
- // We only assign a field selection in the fragment if it doesn't already exist in sink
1443
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
1444
- if (sink[key] === undefined) {
1445
- sink[key] = builtSelection[key];
1446
- }
1447
- });
1448
- }
1449
- else {
1450
- Object.assign(sink, builtSelection);
1451
- }
1452
- }
1453
- });
1454
- return sink;
1346
+ return selectCalculateSink(sink, field, buildSelectionForNode$Z, source, reader, variables, fragments, parentRecordId);
1455
1347
  };
1456
1348
  }
1457
1349
  function getTypeCacheKeys$11(astNode, state) {
@@ -1597,26 +1489,8 @@ function buildSelectionForNode$Y(source, reader, parentNode, selectionNode, vari
1597
1489
  }
1598
1490
  function select$15(field, variables, fragments) {
1599
1491
  return (source, reader, parentRecordId) => {
1600
- var _a;
1601
1492
  const sink = {};
1602
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
1603
- const builtSelection = buildSelectionForNode$Y(source, reader, field, sel, variables, fragments, parentRecordId);
1604
- if (builtSelection !== undefined) {
1605
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
1606
- Object.keys(builtSelection).forEach((key, value) => {
1607
- // We only assign a field selection in the fragment if it doesn't already exist in sink
1608
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
1609
- if (sink[key] === undefined) {
1610
- sink[key] = builtSelection[key];
1611
- }
1612
- });
1613
- }
1614
- else {
1615
- Object.assign(sink, builtSelection);
1616
- }
1617
- }
1618
- });
1619
- return sink;
1493
+ return selectCalculateSink(sink, field, buildSelectionForNode$Y, source, reader, variables, fragments, parentRecordId);
1620
1494
  };
1621
1495
  }
1622
1496
  function getMinimumSelections$K() {
@@ -1641,10 +1515,10 @@ function getTypeCacheKeys$10(astNode, state) {
1641
1515
  representationName: name$X
1642
1516
  });
1643
1517
  // get all cache keys from normalizable fields
1644
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$Y) : [];
1518
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$Y) : new Map();
1645
1519
  for (const fieldDataKey of Object.keys(data)) {
1646
1520
  const fieldData = data[fieldDataKey];
1647
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
1521
+ const requestedField = requestedFields.get(fieldDataKey);
1648
1522
  if (requestedField === undefined) {
1649
1523
  continue; // Skip unknown field.
1650
1524
  }
@@ -1956,26 +1830,8 @@ function buildSelectionForNode$X(source, reader, parentNode, selectionNode, vari
1956
1830
  }
1957
1831
  function select$14(field, variables, fragments) {
1958
1832
  return (source, reader, parentRecordId) => {
1959
- var _a;
1960
1833
  const sink = {};
1961
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
1962
- const builtSelection = buildSelectionForNode$X(source, reader, field, sel, variables, fragments, parentRecordId);
1963
- if (builtSelection !== undefined) {
1964
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
1965
- Object.keys(builtSelection).forEach((key, value) => {
1966
- // We only assign a field selection in the fragment if it doesn't already exist in sink
1967
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
1968
- if (sink[key] === undefined) {
1969
- sink[key] = builtSelection[key];
1970
- }
1971
- });
1972
- }
1973
- else {
1974
- Object.assign(sink, builtSelection);
1975
- }
1976
- }
1977
- });
1978
- return sink;
1834
+ return selectCalculateSink(sink, field, buildSelectionForNode$X, source, reader, variables, fragments, parentRecordId);
1979
1835
  };
1980
1836
  }
1981
1837
  function getMinimumSelections$I() {
@@ -2124,26 +1980,8 @@ function buildSelectionForNode$W(source, reader, parentNode, selectionNode, vari
2124
1980
  }
2125
1981
  function select$13(field, variables, fragments) {
2126
1982
  return (source, reader, parentRecordId) => {
2127
- var _a;
2128
1983
  const sink = {};
2129
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
2130
- const builtSelection = buildSelectionForNode$W(source, reader, field, sel, variables, fragments, parentRecordId);
2131
- if (builtSelection !== undefined) {
2132
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
2133
- Object.keys(builtSelection).forEach((key, value) => {
2134
- // We only assign a field selection in the fragment if it doesn't already exist in sink
2135
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
2136
- if (sink[key] === undefined) {
2137
- sink[key] = builtSelection[key];
2138
- }
2139
- });
2140
- }
2141
- else {
2142
- Object.assign(sink, builtSelection);
2143
- }
2144
- }
2145
- });
2146
- return sink;
1984
+ return selectCalculateSink(sink, field, buildSelectionForNode$W, source, reader, variables, fragments, parentRecordId);
2147
1985
  };
2148
1986
  }
2149
1987
  function getTypeCacheKeys$_(astNode, state) {
@@ -2302,26 +2140,8 @@ function buildSelectionForNode$V(source, reader, parentNode, selectionNode, vari
2302
2140
  }
2303
2141
  function select$12(field, variables, fragments) {
2304
2142
  return (source, reader, parentRecordId) => {
2305
- var _a;
2306
2143
  const sink = {};
2307
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
2308
- const builtSelection = buildSelectionForNode$V(source, reader, field, sel, variables, fragments, parentRecordId);
2309
- if (builtSelection !== undefined) {
2310
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
2311
- Object.keys(builtSelection).forEach((key, value) => {
2312
- // We only assign a field selection in the fragment if it doesn't already exist in sink
2313
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
2314
- if (sink[key] === undefined) {
2315
- sink[key] = builtSelection[key];
2316
- }
2317
- });
2318
- }
2319
- else {
2320
- Object.assign(sink, builtSelection);
2321
- }
2322
- }
2323
- });
2324
- return sink;
2144
+ return selectCalculateSink(sink, field, buildSelectionForNode$V, source, reader, variables, fragments, parentRecordId);
2325
2145
  };
2326
2146
  }
2327
2147
  function getMinimumSelections$H() {
@@ -2346,10 +2166,10 @@ function getTypeCacheKeys$Z(astNode, state) {
2346
2166
  representationName: name$U
2347
2167
  });
2348
2168
  // get all cache keys from normalizable fields
2349
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$V) : [];
2169
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$V) : new Map();
2350
2170
  for (const fieldDataKey of Object.keys(data)) {
2351
2171
  const fieldData = data[fieldDataKey];
2352
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
2172
+ const requestedField = requestedFields.get(fieldDataKey);
2353
2173
  if (requestedField === undefined) {
2354
2174
  continue; // Skip unknown field.
2355
2175
  }
@@ -2852,26 +2672,8 @@ function buildSelectionForNode$U(source, reader, parentNode, selectionNode, vari
2852
2672
  }
2853
2673
  function select$11(field, variables, fragments) {
2854
2674
  return (source, reader, parentRecordId) => {
2855
- var _a;
2856
2675
  const sink = {};
2857
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
2858
- const builtSelection = buildSelectionForNode$U(source, reader, field, sel, variables, fragments, parentRecordId);
2859
- if (builtSelection !== undefined) {
2860
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
2861
- Object.keys(builtSelection).forEach((key, value) => {
2862
- // We only assign a field selection in the fragment if it doesn't already exist in sink
2863
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
2864
- if (sink[key] === undefined) {
2865
- sink[key] = builtSelection[key];
2866
- }
2867
- });
2868
- }
2869
- else {
2870
- Object.assign(sink, builtSelection);
2871
- }
2872
- }
2873
- });
2874
- return sink;
2676
+ return selectCalculateSink(sink, field, buildSelectionForNode$U, source, reader, variables, fragments, parentRecordId);
2875
2677
  };
2876
2678
  }
2877
2679
  function getMinimumSelections$G() {
@@ -3070,26 +2872,8 @@ function buildSelectionForNode$T(source, reader, parentNode, selectionNode, vari
3070
2872
  }
3071
2873
  function select$10(field, variables, fragments) {
3072
2874
  return (source, reader, parentRecordId) => {
3073
- var _a;
3074
2875
  const sink = {};
3075
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
3076
- const builtSelection = buildSelectionForNode$T(source, reader, field, sel, variables, fragments, parentRecordId);
3077
- if (builtSelection !== undefined) {
3078
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
3079
- Object.keys(builtSelection).forEach((key, value) => {
3080
- // We only assign a field selection in the fragment if it doesn't already exist in sink
3081
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
3082
- if (sink[key] === undefined) {
3083
- sink[key] = builtSelection[key];
3084
- }
3085
- });
3086
- }
3087
- else {
3088
- Object.assign(sink, builtSelection);
3089
- }
3090
- }
3091
- });
3092
- return sink;
2876
+ return selectCalculateSink(sink, field, buildSelectionForNode$T, source, reader, variables, fragments, parentRecordId);
3093
2877
  };
3094
2878
  }
3095
2879
  function getTypeCacheKeys$X(astNode, state) {
@@ -3225,26 +3009,8 @@ function buildSelectionForNode$S(source, reader, parentNode, selectionNode, vari
3225
3009
  }
3226
3010
  function select$$(field, variables, fragments) {
3227
3011
  return (source, reader, parentRecordId) => {
3228
- var _a;
3229
3012
  const sink = {};
3230
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
3231
- const builtSelection = buildSelectionForNode$S(source, reader, field, sel, variables, fragments, parentRecordId);
3232
- if (builtSelection !== undefined) {
3233
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
3234
- Object.keys(builtSelection).forEach((key, value) => {
3235
- // We only assign a field selection in the fragment if it doesn't already exist in sink
3236
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
3237
- if (sink[key] === undefined) {
3238
- sink[key] = builtSelection[key];
3239
- }
3240
- });
3241
- }
3242
- else {
3243
- Object.assign(sink, builtSelection);
3244
- }
3245
- }
3246
- });
3247
- return sink;
3013
+ return selectCalculateSink(sink, field, buildSelectionForNode$S, source, reader, variables, fragments, parentRecordId);
3248
3014
  };
3249
3015
  }
3250
3016
  function getMinimumSelections$E() {
@@ -3269,10 +3035,10 @@ function getTypeCacheKeys$W(astNode, state) {
3269
3035
  representationName: name$R
3270
3036
  });
3271
3037
  // get all cache keys from normalizable fields
3272
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$S) : [];
3038
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$S) : new Map();
3273
3039
  for (const fieldDataKey of Object.keys(data)) {
3274
3040
  const fieldData = data[fieldDataKey];
3275
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
3041
+ const requestedField = requestedFields.get(fieldDataKey);
3276
3042
  if (requestedField === undefined) {
3277
3043
  continue; // Skip unknown field.
3278
3044
  }
@@ -3449,26 +3215,8 @@ function buildSelectionForNode$R(source, reader, parentNode, selectionNode, vari
3449
3215
  }
3450
3216
  function select$_(field, variables, fragments) {
3451
3217
  return (source, reader, parentRecordId) => {
3452
- var _a;
3453
3218
  const sink = {};
3454
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
3455
- const builtSelection = buildSelectionForNode$R(source, reader, field, sel, variables, fragments, parentRecordId);
3456
- if (builtSelection !== undefined) {
3457
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
3458
- Object.keys(builtSelection).forEach((key, value) => {
3459
- // We only assign a field selection in the fragment if it doesn't already exist in sink
3460
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
3461
- if (sink[key] === undefined) {
3462
- sink[key] = builtSelection[key];
3463
- }
3464
- });
3465
- }
3466
- else {
3467
- Object.assign(sink, builtSelection);
3468
- }
3469
- }
3470
- });
3471
- return sink;
3219
+ return selectCalculateSink(sink, field, buildSelectionForNode$R, source, reader, variables, fragments, parentRecordId);
3472
3220
  };
3473
3221
  }
3474
3222
  function getMinimumSelections$D() {
@@ -3613,26 +3361,8 @@ function buildSelectionForNode$Q(source, reader, parentNode, selectionNode, vari
3613
3361
  }
3614
3362
  function select$Z(field, variables, fragments) {
3615
3363
  return (source, reader, parentRecordId) => {
3616
- var _a;
3617
3364
  const sink = {};
3618
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
3619
- const builtSelection = buildSelectionForNode$Q(source, reader, field, sel, variables, fragments, parentRecordId);
3620
- if (builtSelection !== undefined) {
3621
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
3622
- Object.keys(builtSelection).forEach((key, value) => {
3623
- // We only assign a field selection in the fragment if it doesn't already exist in sink
3624
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
3625
- if (sink[key] === undefined) {
3626
- sink[key] = builtSelection[key];
3627
- }
3628
- });
3629
- }
3630
- else {
3631
- Object.assign(sink, builtSelection);
3632
- }
3633
- }
3634
- });
3635
- return sink;
3365
+ return selectCalculateSink(sink, field, buildSelectionForNode$Q, source, reader, variables, fragments, parentRecordId);
3636
3366
  };
3637
3367
  }
3638
3368
  function getMinimumSelections$C() {
@@ -3810,26 +3540,8 @@ function buildSelectionForNode$P(source, reader, parentNode, selectionNode, vari
3810
3540
  }
3811
3541
  function select$Y(field, variables, fragments) {
3812
3542
  return (source, reader, parentRecordId) => {
3813
- var _a;
3814
3543
  const sink = {};
3815
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
3816
- const builtSelection = buildSelectionForNode$P(source, reader, field, sel, variables, fragments, parentRecordId);
3817
- if (builtSelection !== undefined) {
3818
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
3819
- Object.keys(builtSelection).forEach((key, value) => {
3820
- // We only assign a field selection in the fragment if it doesn't already exist in sink
3821
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
3822
- if (sink[key] === undefined) {
3823
- sink[key] = builtSelection[key];
3824
- }
3825
- });
3826
- }
3827
- else {
3828
- Object.assign(sink, builtSelection);
3829
- }
3830
- }
3831
- });
3832
- return sink;
3544
+ return selectCalculateSink(sink, field, buildSelectionForNode$P, source, reader, variables, fragments, parentRecordId);
3833
3545
  };
3834
3546
  }
3835
3547
  function getMinimumSelections$B() {
@@ -3854,10 +3566,10 @@ function getTypeCacheKeys$T(astNode, state) {
3854
3566
  representationName: name$O
3855
3567
  });
3856
3568
  // get all cache keys from normalizable fields
3857
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$P) : [];
3569
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$P) : new Map();
3858
3570
  for (const fieldDataKey of Object.keys(data)) {
3859
3571
  const fieldData = data[fieldDataKey];
3860
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
3572
+ const requestedField = requestedFields.get(fieldDataKey);
3861
3573
  if (requestedField === undefined) {
3862
3574
  continue; // Skip unknown field.
3863
3575
  }
@@ -4218,26 +3930,8 @@ function buildSelectionForNode$O(source, reader, parentNode, selectionNode, vari
4218
3930
  }
4219
3931
  function select$X(field, variables, fragments) {
4220
3932
  return (source, reader, parentRecordId) => {
4221
- var _a;
4222
3933
  const sink = {};
4223
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
4224
- const builtSelection = buildSelectionForNode$O(source, reader, field, sel, variables, fragments, parentRecordId);
4225
- if (builtSelection !== undefined) {
4226
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
4227
- Object.keys(builtSelection).forEach((key, value) => {
4228
- // We only assign a field selection in the fragment if it doesn't already exist in sink
4229
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
4230
- if (sink[key] === undefined) {
4231
- sink[key] = builtSelection[key];
4232
- }
4233
- });
4234
- }
4235
- else {
4236
- Object.assign(sink, builtSelection);
4237
- }
4238
- }
4239
- });
4240
- return sink;
3934
+ return selectCalculateSink(sink, field, buildSelectionForNode$O, source, reader, variables, fragments, parentRecordId);
4241
3935
  };
4242
3936
  }
4243
3937
  function getMinimumSelections$A() {
@@ -4408,26 +4102,8 @@ function buildSelectionForNode$N(source, reader, parentNode, selectionNode, vari
4408
4102
  }
4409
4103
  function select$W(field, variables, fragments) {
4410
4104
  return (source, reader, parentRecordId) => {
4411
- var _a;
4412
4105
  const sink = {};
4413
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
4414
- const builtSelection = buildSelectionForNode$N(source, reader, field, sel, variables, fragments, parentRecordId);
4415
- if (builtSelection !== undefined) {
4416
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
4417
- Object.keys(builtSelection).forEach((key, value) => {
4418
- // We only assign a field selection in the fragment if it doesn't already exist in sink
4419
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
4420
- if (sink[key] === undefined) {
4421
- sink[key] = builtSelection[key];
4422
- }
4423
- });
4424
- }
4425
- else {
4426
- Object.assign(sink, builtSelection);
4427
- }
4428
- }
4429
- });
4430
- return sink;
4106
+ return selectCalculateSink(sink, field, buildSelectionForNode$N, source, reader, variables, fragments, parentRecordId);
4431
4107
  };
4432
4108
  }
4433
4109
  function getMinimumSelections$z() {
@@ -4452,10 +4128,10 @@ function getTypeCacheKeys$R(astNode, state) {
4452
4128
  representationName: name$M
4453
4129
  });
4454
4130
  // get all cache keys from normalizable fields
4455
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$N) : [];
4131
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$N) : new Map();
4456
4132
  for (const fieldDataKey of Object.keys(data)) {
4457
4133
  const fieldData = data[fieldDataKey];
4458
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
4134
+ const requestedField = requestedFields.get(fieldDataKey);
4459
4135
  if (requestedField === undefined) {
4460
4136
  continue; // Skip unknown field.
4461
4137
  }
@@ -4848,26 +4524,8 @@ function buildSelectionForNode$M(source, reader, parentNode, selectionNode, vari
4848
4524
  }
4849
4525
  function select$V(field, variables, fragments) {
4850
4526
  return (source, reader, parentRecordId) => {
4851
- var _a;
4852
4527
  const sink = {};
4853
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
4854
- const builtSelection = buildSelectionForNode$M(source, reader, field, sel, variables, fragments, parentRecordId);
4855
- if (builtSelection !== undefined) {
4856
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
4857
- Object.keys(builtSelection).forEach((key, value) => {
4858
- // We only assign a field selection in the fragment if it doesn't already exist in sink
4859
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
4860
- if (sink[key] === undefined) {
4861
- sink[key] = builtSelection[key];
4862
- }
4863
- });
4864
- }
4865
- else {
4866
- Object.assign(sink, builtSelection);
4867
- }
4868
- }
4869
- });
4870
- return sink;
4528
+ return selectCalculateSink(sink, field, buildSelectionForNode$M, source, reader, variables, fragments, parentRecordId);
4871
4529
  };
4872
4530
  }
4873
4531
  function getMinimumSelections$y() {
@@ -4892,10 +4550,10 @@ function getTypeCacheKeys$Q(astNode, state) {
4892
4550
  representationName: name$L
4893
4551
  });
4894
4552
  // get all cache keys from normalizable fields
4895
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$M) : [];
4553
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$M) : new Map();
4896
4554
  for (const fieldDataKey of Object.keys(data)) {
4897
4555
  const fieldData = data[fieldDataKey];
4898
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
4556
+ const requestedField = requestedFields.get(fieldDataKey);
4899
4557
  if (requestedField === undefined) {
4900
4558
  continue; // Skip unknown field.
4901
4559
  }
@@ -5059,26 +4717,8 @@ function buildSelectionForNode$L(source, reader, parentNode, selectionNode, vari
5059
4717
  }
5060
4718
  function select$U(field, variables, fragments) {
5061
4719
  return (source, reader, parentRecordId) => {
5062
- var _a;
5063
4720
  const sink = {};
5064
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
5065
- const builtSelection = buildSelectionForNode$L(source, reader, field, sel, variables, fragments, parentRecordId);
5066
- if (builtSelection !== undefined) {
5067
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
5068
- Object.keys(builtSelection).forEach((key, value) => {
5069
- // We only assign a field selection in the fragment if it doesn't already exist in sink
5070
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
5071
- if (sink[key] === undefined) {
5072
- sink[key] = builtSelection[key];
5073
- }
5074
- });
5075
- }
5076
- else {
5077
- Object.assign(sink, builtSelection);
5078
- }
5079
- }
5080
- });
5081
- return sink;
4721
+ return selectCalculateSink(sink, field, buildSelectionForNode$L, source, reader, variables, fragments, parentRecordId);
5082
4722
  };
5083
4723
  }
5084
4724
  function getTypeCacheKeys$P(astNode, state) {
@@ -5215,26 +4855,8 @@ function buildSelectionForNode$K(source, reader, parentNode, selectionNode, vari
5215
4855
  }
5216
4856
  function select$T(field, variables, fragments) {
5217
4857
  return (source, reader, parentRecordId) => {
5218
- var _a;
5219
4858
  const sink = {};
5220
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
5221
- const builtSelection = buildSelectionForNode$K(source, reader, field, sel, variables, fragments, parentRecordId);
5222
- if (builtSelection !== undefined) {
5223
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
5224
- Object.keys(builtSelection).forEach((key, value) => {
5225
- // We only assign a field selection in the fragment if it doesn't already exist in sink
5226
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
5227
- if (sink[key] === undefined) {
5228
- sink[key] = builtSelection[key];
5229
- }
5230
- });
5231
- }
5232
- else {
5233
- Object.assign(sink, builtSelection);
5234
- }
5235
- }
5236
- });
5237
- return sink;
4859
+ return selectCalculateSink(sink, field, buildSelectionForNode$K, source, reader, variables, fragments, parentRecordId);
5238
4860
  };
5239
4861
  }
5240
4862
  function getTypeCacheKeys$O(astNode, state) {
@@ -5383,26 +5005,8 @@ function buildSelectionForNode$J(source, reader, parentNode, selectionNode, vari
5383
5005
  }
5384
5006
  function select$S(field, variables, fragments) {
5385
5007
  return (source, reader, parentRecordId) => {
5386
- var _a;
5387
5008
  const sink = {};
5388
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
5389
- const builtSelection = buildSelectionForNode$J(source, reader, field, sel, variables, fragments, parentRecordId);
5390
- if (builtSelection !== undefined) {
5391
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
5392
- Object.keys(builtSelection).forEach((key, value) => {
5393
- // We only assign a field selection in the fragment if it doesn't already exist in sink
5394
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
5395
- if (sink[key] === undefined) {
5396
- sink[key] = builtSelection[key];
5397
- }
5398
- });
5399
- }
5400
- else {
5401
- Object.assign(sink, builtSelection);
5402
- }
5403
- }
5404
- });
5405
- return sink;
5009
+ return selectCalculateSink(sink, field, buildSelectionForNode$J, source, reader, variables, fragments, parentRecordId);
5406
5010
  };
5407
5011
  }
5408
5012
  function getMinimumSelections$x() {
@@ -5427,10 +5031,10 @@ function getTypeCacheKeys$N(astNode, state) {
5427
5031
  representationName: name$I
5428
5032
  });
5429
5033
  // get all cache keys from normalizable fields
5430
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$J) : [];
5034
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$J) : new Map();
5431
5035
  for (const fieldDataKey of Object.keys(data)) {
5432
5036
  const fieldData = data[fieldDataKey];
5433
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
5037
+ const requestedField = requestedFields.get(fieldDataKey);
5434
5038
  if (requestedField === undefined) {
5435
5039
  continue; // Skip unknown field.
5436
5040
  }
@@ -5744,26 +5348,8 @@ function buildSelectionForNode$I(source, reader, parentNode, selectionNode, vari
5744
5348
  }
5745
5349
  function select$R(field, variables, fragments) {
5746
5350
  return (source, reader, parentRecordId) => {
5747
- var _a;
5748
5351
  const sink = {};
5749
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
5750
- const builtSelection = buildSelectionForNode$I(source, reader, field, sel, variables, fragments, parentRecordId);
5751
- if (builtSelection !== undefined) {
5752
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
5753
- Object.keys(builtSelection).forEach((key, value) => {
5754
- // We only assign a field selection in the fragment if it doesn't already exist in sink
5755
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
5756
- if (sink[key] === undefined) {
5757
- sink[key] = builtSelection[key];
5758
- }
5759
- });
5760
- }
5761
- else {
5762
- Object.assign(sink, builtSelection);
5763
- }
5764
- }
5765
- });
5766
- return sink;
5352
+ return selectCalculateSink(sink, field, buildSelectionForNode$I, source, reader, variables, fragments, parentRecordId);
5767
5353
  };
5768
5354
  }
5769
5355
  function getTypeCacheKeys$M(astNode, state) {
@@ -5912,26 +5498,8 @@ function buildSelectionForNode$H(source, reader, parentNode, selectionNode, vari
5912
5498
  }
5913
5499
  function select$Q(field, variables, fragments) {
5914
5500
  return (source, reader, parentRecordId) => {
5915
- var _a;
5916
5501
  const sink = {};
5917
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
5918
- const builtSelection = buildSelectionForNode$H(source, reader, field, sel, variables, fragments, parentRecordId);
5919
- if (builtSelection !== undefined) {
5920
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
5921
- Object.keys(builtSelection).forEach((key, value) => {
5922
- // We only assign a field selection in the fragment if it doesn't already exist in sink
5923
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
5924
- if (sink[key] === undefined) {
5925
- sink[key] = builtSelection[key];
5926
- }
5927
- });
5928
- }
5929
- else {
5930
- Object.assign(sink, builtSelection);
5931
- }
5932
- }
5933
- });
5934
- return sink;
5502
+ return selectCalculateSink(sink, field, buildSelectionForNode$H, source, reader, variables, fragments, parentRecordId);
5935
5503
  };
5936
5504
  }
5937
5505
  function getMinimumSelections$w() {
@@ -5956,10 +5524,10 @@ function getTypeCacheKeys$L(astNode, state) {
5956
5524
  representationName: name$G
5957
5525
  });
5958
5526
  // get all cache keys from normalizable fields
5959
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$H) : [];
5527
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$H) : new Map();
5960
5528
  for (const fieldDataKey of Object.keys(data)) {
5961
5529
  const fieldData = data[fieldDataKey];
5962
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
5530
+ const requestedField = requestedFields.get(fieldDataKey);
5963
5531
  if (requestedField === undefined) {
5964
5532
  continue; // Skip unknown field.
5965
5533
  }
@@ -6229,26 +5797,8 @@ function buildSelectionForNode$G(source, reader, parentNode, selectionNode, vari
6229
5797
  }
6230
5798
  function select$P(field, variables, fragments) {
6231
5799
  return (source, reader, parentRecordId) => {
6232
- var _a;
6233
5800
  const sink = {};
6234
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
6235
- const builtSelection = buildSelectionForNode$G(source, reader, field, sel, variables, fragments, parentRecordId);
6236
- if (builtSelection !== undefined) {
6237
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
6238
- Object.keys(builtSelection).forEach((key, value) => {
6239
- // We only assign a field selection in the fragment if it doesn't already exist in sink
6240
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
6241
- if (sink[key] === undefined) {
6242
- sink[key] = builtSelection[key];
6243
- }
6244
- });
6245
- }
6246
- else {
6247
- Object.assign(sink, builtSelection);
6248
- }
6249
- }
6250
- });
6251
- return sink;
5801
+ return selectCalculateSink(sink, field, buildSelectionForNode$G, source, reader, variables, fragments, parentRecordId);
6252
5802
  };
6253
5803
  }
6254
5804
  function getTypeCacheKeys$K(astNode, state) {
@@ -6391,26 +5941,8 @@ function buildSelectionForNode$F(source, reader, parentNode, selectionNode, vari
6391
5941
  }
6392
5942
  function select$O(field, variables, fragments) {
6393
5943
  return (source, reader, parentRecordId) => {
6394
- var _a;
6395
5944
  const sink = {};
6396
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
6397
- const builtSelection = buildSelectionForNode$F(source, reader, field, sel, variables, fragments, parentRecordId);
6398
- if (builtSelection !== undefined) {
6399
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
6400
- Object.keys(builtSelection).forEach((key, value) => {
6401
- // We only assign a field selection in the fragment if it doesn't already exist in sink
6402
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
6403
- if (sink[key] === undefined) {
6404
- sink[key] = builtSelection[key];
6405
- }
6406
- });
6407
- }
6408
- else {
6409
- Object.assign(sink, builtSelection);
6410
- }
6411
- }
6412
- });
6413
- return sink;
5945
+ return selectCalculateSink(sink, field, buildSelectionForNode$F, source, reader, variables, fragments, parentRecordId);
6414
5946
  };
6415
5947
  }
6416
5948
  function getTypeCacheKeys$J(astNode, state) {
@@ -6565,26 +6097,8 @@ function buildSelectionForNode$E(source, reader, parentNode, selectionNode, vari
6565
6097
  }
6566
6098
  function select$N(field, variables, fragments) {
6567
6099
  return (source, reader, parentRecordId) => {
6568
- var _a;
6569
6100
  const sink = {};
6570
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
6571
- const builtSelection = buildSelectionForNode$E(source, reader, field, sel, variables, fragments, parentRecordId);
6572
- if (builtSelection !== undefined) {
6573
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
6574
- Object.keys(builtSelection).forEach((key, value) => {
6575
- // We only assign a field selection in the fragment if it doesn't already exist in sink
6576
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
6577
- if (sink[key] === undefined) {
6578
- sink[key] = builtSelection[key];
6579
- }
6580
- });
6581
- }
6582
- else {
6583
- Object.assign(sink, builtSelection);
6584
- }
6585
- }
6586
- });
6587
- return sink;
6101
+ return selectCalculateSink(sink, field, buildSelectionForNode$E, source, reader, variables, fragments, parentRecordId);
6588
6102
  };
6589
6103
  }
6590
6104
  function getMinimumSelections$v() {
@@ -6609,10 +6123,10 @@ function getTypeCacheKeys$I(astNode, state) {
6609
6123
  representationName: name$D
6610
6124
  });
6611
6125
  // get all cache keys from normalizable fields
6612
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$E) : [];
6126
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$E) : new Map();
6613
6127
  for (const fieldDataKey of Object.keys(data)) {
6614
6128
  const fieldData = data[fieldDataKey];
6615
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
6129
+ const requestedField = requestedFields.get(fieldDataKey);
6616
6130
  if (requestedField === undefined) {
6617
6131
  continue; // Skip unknown field.
6618
6132
  }
@@ -6907,26 +6421,8 @@ function buildSelectionForNode$D(source, reader, parentNode, selectionNode, vari
6907
6421
  }
6908
6422
  function select$M(field, variables, fragments) {
6909
6423
  return (source, reader, parentRecordId) => {
6910
- var _a;
6911
6424
  const sink = {};
6912
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
6913
- const builtSelection = buildSelectionForNode$D(source, reader, field, sel, variables, fragments, parentRecordId);
6914
- if (builtSelection !== undefined) {
6915
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
6916
- Object.keys(builtSelection).forEach((key, value) => {
6917
- // We only assign a field selection in the fragment if it doesn't already exist in sink
6918
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
6919
- if (sink[key] === undefined) {
6920
- sink[key] = builtSelection[key];
6921
- }
6922
- });
6923
- }
6924
- else {
6925
- Object.assign(sink, builtSelection);
6926
- }
6927
- }
6928
- });
6929
- return sink;
6425
+ return selectCalculateSink(sink, field, buildSelectionForNode$D, source, reader, variables, fragments, parentRecordId);
6930
6426
  };
6931
6427
  }
6932
6428
  function getTypeCacheKeys$H(astNode, state) {
@@ -7217,26 +6713,8 @@ function buildSelectionForNode$C(source, reader, parentNode, selectionNode, vari
7217
6713
  }
7218
6714
  function select$L(field, variables, fragments) {
7219
6715
  return (source, reader, parentRecordId) => {
7220
- var _a;
7221
6716
  const sink = {};
7222
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
7223
- const builtSelection = buildSelectionForNode$C(source, reader, field, sel, variables, fragments, parentRecordId);
7224
- if (builtSelection !== undefined) {
7225
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
7226
- Object.keys(builtSelection).forEach((key, value) => {
7227
- // We only assign a field selection in the fragment if it doesn't already exist in sink
7228
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
7229
- if (sink[key] === undefined) {
7230
- sink[key] = builtSelection[key];
7231
- }
7232
- });
7233
- }
7234
- else {
7235
- Object.assign(sink, builtSelection);
7236
- }
7237
- }
7238
- });
7239
- return sink;
6717
+ return selectCalculateSink(sink, field, buildSelectionForNode$C, source, reader, variables, fragments, parentRecordId);
7240
6718
  };
7241
6719
  }
7242
6720
  function getTypeCacheKeys$G(astNode, state) {
@@ -7385,26 +6863,8 @@ function buildSelectionForNode$B(source, reader, parentNode, selectionNode, vari
7385
6863
  }
7386
6864
  function select$K(field, variables, fragments) {
7387
6865
  return (source, reader, parentRecordId) => {
7388
- var _a;
7389
6866
  const sink = {};
7390
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
7391
- const builtSelection = buildSelectionForNode$B(source, reader, field, sel, variables, fragments, parentRecordId);
7392
- if (builtSelection !== undefined) {
7393
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
7394
- Object.keys(builtSelection).forEach((key, value) => {
7395
- // We only assign a field selection in the fragment if it doesn't already exist in sink
7396
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
7397
- if (sink[key] === undefined) {
7398
- sink[key] = builtSelection[key];
7399
- }
7400
- });
7401
- }
7402
- else {
7403
- Object.assign(sink, builtSelection);
7404
- }
7405
- }
7406
- });
7407
- return sink;
6867
+ return selectCalculateSink(sink, field, buildSelectionForNode$B, source, reader, variables, fragments, parentRecordId);
7408
6868
  };
7409
6869
  }
7410
6870
  function getMinimumSelections$t() {
@@ -7429,10 +6889,10 @@ function getTypeCacheKeys$F(astNode, state) {
7429
6889
  representationName: name$A
7430
6890
  });
7431
6891
  // get all cache keys from normalizable fields
7432
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$B) : [];
6892
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$B) : new Map();
7433
6893
  for (const fieldDataKey of Object.keys(data)) {
7434
6894
  const fieldData = data[fieldDataKey];
7435
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
6895
+ const requestedField = requestedFields.get(fieldDataKey);
7436
6896
  if (requestedField === undefined) {
7437
6897
  continue; // Skip unknown field.
7438
6898
  }
@@ -7702,26 +7162,8 @@ function buildSelectionForNode$A(source, reader, parentNode, selectionNode, vari
7702
7162
  }
7703
7163
  function select$J(field, variables, fragments) {
7704
7164
  return (source, reader, parentRecordId) => {
7705
- var _a;
7706
7165
  const sink = {};
7707
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
7708
- const builtSelection = buildSelectionForNode$A(source, reader, field, sel, variables, fragments, parentRecordId);
7709
- if (builtSelection !== undefined) {
7710
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
7711
- Object.keys(builtSelection).forEach((key, value) => {
7712
- // We only assign a field selection in the fragment if it doesn't already exist in sink
7713
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
7714
- if (sink[key] === undefined) {
7715
- sink[key] = builtSelection[key];
7716
- }
7717
- });
7718
- }
7719
- else {
7720
- Object.assign(sink, builtSelection);
7721
- }
7722
- }
7723
- });
7724
- return sink;
7166
+ return selectCalculateSink(sink, field, buildSelectionForNode$A, source, reader, variables, fragments, parentRecordId);
7725
7167
  };
7726
7168
  }
7727
7169
  function getTypeCacheKeys$E(astNode, state) {
@@ -7858,26 +7300,8 @@ function buildSelectionForNode$z(source, reader, parentNode, selectionNode, vari
7858
7300
  }
7859
7301
  function select$I(field, variables, fragments) {
7860
7302
  return (source, reader, parentRecordId) => {
7861
- var _a;
7862
7303
  const sink = {};
7863
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
7864
- const builtSelection = buildSelectionForNode$z(source, reader, field, sel, variables, fragments, parentRecordId);
7865
- if (builtSelection !== undefined) {
7866
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
7867
- Object.keys(builtSelection).forEach((key, value) => {
7868
- // We only assign a field selection in the fragment if it doesn't already exist in sink
7869
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
7870
- if (sink[key] === undefined) {
7871
- sink[key] = builtSelection[key];
7872
- }
7873
- });
7874
- }
7875
- else {
7876
- Object.assign(sink, builtSelection);
7877
- }
7878
- }
7879
- });
7880
- return sink;
7304
+ return selectCalculateSink(sink, field, buildSelectionForNode$z, source, reader, variables, fragments, parentRecordId);
7881
7305
  };
7882
7306
  }
7883
7307
  function getTypeCacheKeys$D(astNode, state) {
@@ -8024,26 +7448,8 @@ function buildSelectionForNode$y(source, reader, parentNode, selectionNode, vari
8024
7448
  }
8025
7449
  function select$H(field, variables, fragments) {
8026
7450
  return (source, reader, parentRecordId) => {
8027
- var _a;
8028
7451
  const sink = {};
8029
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
8030
- const builtSelection = buildSelectionForNode$y(source, reader, field, sel, variables, fragments, parentRecordId);
8031
- if (builtSelection !== undefined) {
8032
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
8033
- Object.keys(builtSelection).forEach((key, value) => {
8034
- // We only assign a field selection in the fragment if it doesn't already exist in sink
8035
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
8036
- if (sink[key] === undefined) {
8037
- sink[key] = builtSelection[key];
8038
- }
8039
- });
8040
- }
8041
- else {
8042
- Object.assign(sink, builtSelection);
8043
- }
8044
- }
8045
- });
8046
- return sink;
7452
+ return selectCalculateSink(sink, field, buildSelectionForNode$y, source, reader, variables, fragments, parentRecordId);
8047
7453
  };
8048
7454
  }
8049
7455
  function getMinimumSelections$s() {
@@ -8068,10 +7474,10 @@ function getTypeCacheKeys$C(astNode, state) {
8068
7474
  representationName: name$x
8069
7475
  });
8070
7476
  // get all cache keys from normalizable fields
8071
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$y) : [];
7477
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$y) : new Map();
8072
7478
  for (const fieldDataKey of Object.keys(data)) {
8073
7479
  const fieldData = data[fieldDataKey];
8074
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
7480
+ const requestedField = requestedFields.get(fieldDataKey);
8075
7481
  if (requestedField === undefined) {
8076
7482
  continue; // Skip unknown field.
8077
7483
  }
@@ -8245,26 +7651,8 @@ function buildSelectionForNode$x(source, reader, parentNode, selectionNode, vari
8245
7651
  }
8246
7652
  function select$G(field, variables, fragments) {
8247
7653
  return (source, reader, parentRecordId) => {
8248
- var _a;
8249
7654
  const sink = {};
8250
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
8251
- const builtSelection = buildSelectionForNode$x(source, reader, field, sel, variables, fragments, parentRecordId);
8252
- if (builtSelection !== undefined) {
8253
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
8254
- Object.keys(builtSelection).forEach((key, value) => {
8255
- // We only assign a field selection in the fragment if it doesn't already exist in sink
8256
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
8257
- if (sink[key] === undefined) {
8258
- sink[key] = builtSelection[key];
8259
- }
8260
- });
8261
- }
8262
- else {
8263
- Object.assign(sink, builtSelection);
8264
- }
8265
- }
8266
- });
8267
- return sink;
7655
+ return selectCalculateSink(sink, field, buildSelectionForNode$x, source, reader, variables, fragments, parentRecordId);
8268
7656
  };
8269
7657
  }
8270
7658
  function getTypeCacheKeys$B(astNode, state) {
@@ -8413,26 +7801,8 @@ function buildSelectionForNode$w(source, reader, parentNode, selectionNode, vari
8413
7801
  }
8414
7802
  function select$F(field, variables, fragments) {
8415
7803
  return (source, reader, parentRecordId) => {
8416
- var _a;
8417
7804
  const sink = {};
8418
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
8419
- const builtSelection = buildSelectionForNode$w(source, reader, field, sel, variables, fragments, parentRecordId);
8420
- if (builtSelection !== undefined) {
8421
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
8422
- Object.keys(builtSelection).forEach((key, value) => {
8423
- // We only assign a field selection in the fragment if it doesn't already exist in sink
8424
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
8425
- if (sink[key] === undefined) {
8426
- sink[key] = builtSelection[key];
8427
- }
8428
- });
8429
- }
8430
- else {
8431
- Object.assign(sink, builtSelection);
8432
- }
8433
- }
8434
- });
8435
- return sink;
7805
+ return selectCalculateSink(sink, field, buildSelectionForNode$w, source, reader, variables, fragments, parentRecordId);
8436
7806
  };
8437
7807
  }
8438
7808
  function getMinimumSelections$r() {
@@ -8457,10 +7827,10 @@ function getTypeCacheKeys$A(astNode, state) {
8457
7827
  representationName: name$v
8458
7828
  });
8459
7829
  // get all cache keys from normalizable fields
8460
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$w) : [];
7830
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$w) : new Map();
8461
7831
  for (const fieldDataKey of Object.keys(data)) {
8462
7832
  const fieldData = data[fieldDataKey];
8463
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
7833
+ const requestedField = requestedFields.get(fieldDataKey);
8464
7834
  if (requestedField === undefined) {
8465
7835
  continue; // Skip unknown field.
8466
7836
  }
@@ -8746,29 +8116,11 @@ function buildSelectionForField$v(source, reader, sel, variables, fragments, par
8746
8116
  }
8747
8117
  function buildSelectionForNode$v(source, reader, parentNode, selectionNode, variables, fragments, parentRecordId) {
8748
8118
  return buildSelectionForNode$7(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$v, buildSelectionForField$v, parentRecordId);
8749
- }
8750
- function select$E(field, variables, fragments) {
8751
- return (source, reader, parentRecordId) => {
8752
- var _a;
8753
- const sink = {};
8754
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
8755
- const builtSelection = buildSelectionForNode$v(source, reader, field, sel, variables, fragments, parentRecordId);
8756
- if (builtSelection !== undefined) {
8757
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
8758
- Object.keys(builtSelection).forEach((key, value) => {
8759
- // We only assign a field selection in the fragment if it doesn't already exist in sink
8760
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
8761
- if (sink[key] === undefined) {
8762
- sink[key] = builtSelection[key];
8763
- }
8764
- });
8765
- }
8766
- else {
8767
- Object.assign(sink, builtSelection);
8768
- }
8769
- }
8770
- });
8771
- return sink;
8119
+ }
8120
+ function select$E(field, variables, fragments) {
8121
+ return (source, reader, parentRecordId) => {
8122
+ const sink = {};
8123
+ return selectCalculateSink(sink, field, buildSelectionForNode$v, source, reader, variables, fragments, parentRecordId);
8772
8124
  };
8773
8125
  }
8774
8126
  function getTypeCacheKeys$z(astNode, state) {
@@ -8917,26 +8269,8 @@ function buildSelectionForNode$u(source, reader, parentNode, selectionNode, vari
8917
8269
  }
8918
8270
  function select$D(field, variables, fragments) {
8919
8271
  return (source, reader, parentRecordId) => {
8920
- var _a;
8921
8272
  const sink = {};
8922
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
8923
- const builtSelection = buildSelectionForNode$u(source, reader, field, sel, variables, fragments, parentRecordId);
8924
- if (builtSelection !== undefined) {
8925
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
8926
- Object.keys(builtSelection).forEach((key, value) => {
8927
- // We only assign a field selection in the fragment if it doesn't already exist in sink
8928
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
8929
- if (sink[key] === undefined) {
8930
- sink[key] = builtSelection[key];
8931
- }
8932
- });
8933
- }
8934
- else {
8935
- Object.assign(sink, builtSelection);
8936
- }
8937
- }
8938
- });
8939
- return sink;
8273
+ return selectCalculateSink(sink, field, buildSelectionForNode$u, source, reader, variables, fragments, parentRecordId);
8940
8274
  };
8941
8275
  }
8942
8276
  function getMinimumSelections$q() {
@@ -8961,10 +8295,10 @@ function getTypeCacheKeys$y(astNode, state) {
8961
8295
  representationName: name$t
8962
8296
  });
8963
8297
  // get all cache keys from normalizable fields
8964
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$u) : [];
8298
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$u) : new Map();
8965
8299
  for (const fieldDataKey of Object.keys(data)) {
8966
8300
  const fieldData = data[fieldDataKey];
8967
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
8301
+ const requestedField = requestedFields.get(fieldDataKey);
8968
8302
  if (requestedField === undefined) {
8969
8303
  continue; // Skip unknown field.
8970
8304
  }
@@ -9261,26 +8595,8 @@ function buildSelectionForNode$t(source, reader, parentNode, selectionNode, vari
9261
8595
  }
9262
8596
  function select$C(field, variables, fragments) {
9263
8597
  return (source, reader, parentRecordId) => {
9264
- var _a;
9265
8598
  const sink = {};
9266
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
9267
- const builtSelection = buildSelectionForNode$t(source, reader, field, sel, variables, fragments, parentRecordId);
9268
- if (builtSelection !== undefined) {
9269
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
9270
- Object.keys(builtSelection).forEach((key, value) => {
9271
- // We only assign a field selection in the fragment if it doesn't already exist in sink
9272
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
9273
- if (sink[key] === undefined) {
9274
- sink[key] = builtSelection[key];
9275
- }
9276
- });
9277
- }
9278
- else {
9279
- Object.assign(sink, builtSelection);
9280
- }
9281
- }
9282
- });
9283
- return sink;
8599
+ return selectCalculateSink(sink, field, buildSelectionForNode$t, source, reader, variables, fragments, parentRecordId);
9284
8600
  };
9285
8601
  }
9286
8602
  function getMinimumSelections$p() {
@@ -9305,10 +8621,10 @@ function getTypeCacheKeys$x(astNode, state) {
9305
8621
  representationName: name$s
9306
8622
  });
9307
8623
  // get all cache keys from normalizable fields
9308
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$t) : [];
8624
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$t) : new Map();
9309
8625
  for (const fieldDataKey of Object.keys(data)) {
9310
8626
  const fieldData = data[fieldDataKey];
9311
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
8627
+ const requestedField = requestedFields.get(fieldDataKey);
9312
8628
  if (requestedField === undefined) {
9313
8629
  continue; // Skip unknown field.
9314
8630
  }
@@ -9590,26 +8906,8 @@ function buildSelectionForNode$s(source, reader, parentNode, selectionNode, vari
9590
8906
  }
9591
8907
  function select$B(field, variables, fragments) {
9592
8908
  return (source, reader, parentRecordId) => {
9593
- var _a;
9594
8909
  const sink = {};
9595
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
9596
- const builtSelection = buildSelectionForNode$s(source, reader, field, sel, variables, fragments, parentRecordId);
9597
- if (builtSelection !== undefined) {
9598
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
9599
- Object.keys(builtSelection).forEach((key, value) => {
9600
- // We only assign a field selection in the fragment if it doesn't already exist in sink
9601
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
9602
- if (sink[key] === undefined) {
9603
- sink[key] = builtSelection[key];
9604
- }
9605
- });
9606
- }
9607
- else {
9608
- Object.assign(sink, builtSelection);
9609
- }
9610
- }
9611
- });
9612
- return sink;
8910
+ return selectCalculateSink(sink, field, buildSelectionForNode$s, source, reader, variables, fragments, parentRecordId);
9613
8911
  };
9614
8912
  }
9615
8913
  function getTypeCacheKeys$w(astNode, state) {
@@ -9758,26 +9056,8 @@ function buildSelectionForNode$r(source, reader, parentNode, selectionNode, vari
9758
9056
  }
9759
9057
  function select$A(field, variables, fragments) {
9760
9058
  return (source, reader, parentRecordId) => {
9761
- var _a;
9762
9059
  const sink = {};
9763
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
9764
- const builtSelection = buildSelectionForNode$r(source, reader, field, sel, variables, fragments, parentRecordId);
9765
- if (builtSelection !== undefined) {
9766
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
9767
- Object.keys(builtSelection).forEach((key, value) => {
9768
- // We only assign a field selection in the fragment if it doesn't already exist in sink
9769
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
9770
- if (sink[key] === undefined) {
9771
- sink[key] = builtSelection[key];
9772
- }
9773
- });
9774
- }
9775
- else {
9776
- Object.assign(sink, builtSelection);
9777
- }
9778
- }
9779
- });
9780
- return sink;
9060
+ return selectCalculateSink(sink, field, buildSelectionForNode$r, source, reader, variables, fragments, parentRecordId);
9781
9061
  };
9782
9062
  }
9783
9063
  function getMinimumSelections$o() {
@@ -9802,10 +9082,10 @@ function getTypeCacheKeys$v(astNode, state) {
9802
9082
  representationName: name$q
9803
9083
  });
9804
9084
  // get all cache keys from normalizable fields
9805
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$r) : [];
9085
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$r) : new Map();
9806
9086
  for (const fieldDataKey of Object.keys(data)) {
9807
9087
  const fieldData = data[fieldDataKey];
9808
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
9088
+ const requestedField = requestedFields.get(fieldDataKey);
9809
9089
  if (requestedField === undefined) {
9810
9090
  continue; // Skip unknown field.
9811
9091
  }
@@ -10087,26 +9367,8 @@ function buildSelectionForNode$q(source, reader, parentNode, selectionNode, vari
10087
9367
  }
10088
9368
  function select$z(field, variables, fragments) {
10089
9369
  return (source, reader, parentRecordId) => {
10090
- var _a;
10091
9370
  const sink = {};
10092
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
10093
- const builtSelection = buildSelectionForNode$q(source, reader, field, sel, variables, fragments, parentRecordId);
10094
- if (builtSelection !== undefined) {
10095
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
10096
- Object.keys(builtSelection).forEach((key, value) => {
10097
- // We only assign a field selection in the fragment if it doesn't already exist in sink
10098
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
10099
- if (sink[key] === undefined) {
10100
- sink[key] = builtSelection[key];
10101
- }
10102
- });
10103
- }
10104
- else {
10105
- Object.assign(sink, builtSelection);
10106
- }
10107
- }
10108
- });
10109
- return sink;
9371
+ return selectCalculateSink(sink, field, buildSelectionForNode$q, source, reader, variables, fragments, parentRecordId);
10110
9372
  };
10111
9373
  }
10112
9374
  function getMinimumSelections$n() {
@@ -10131,10 +9393,10 @@ function getTypeCacheKeys$u(astNode, state) {
10131
9393
  representationName: name$p
10132
9394
  });
10133
9395
  // get all cache keys from normalizable fields
10134
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$q) : [];
9396
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$q) : new Map();
10135
9397
  for (const fieldDataKey of Object.keys(data)) {
10136
9398
  const fieldData = data[fieldDataKey];
10137
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
9399
+ const requestedField = requestedFields.get(fieldDataKey);
10138
9400
  if (requestedField === undefined) {
10139
9401
  continue; // Skip unknown field.
10140
9402
  }
@@ -10416,26 +9678,8 @@ function buildSelectionForNode$p(source, reader, parentNode, selectionNode, vari
10416
9678
  }
10417
9679
  function select$y(field, variables, fragments) {
10418
9680
  return (source, reader, parentRecordId) => {
10419
- var _a;
10420
9681
  const sink = {};
10421
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
10422
- const builtSelection = buildSelectionForNode$p(source, reader, field, sel, variables, fragments, parentRecordId);
10423
- if (builtSelection !== undefined) {
10424
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
10425
- Object.keys(builtSelection).forEach((key, value) => {
10426
- // We only assign a field selection in the fragment if it doesn't already exist in sink
10427
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
10428
- if (sink[key] === undefined) {
10429
- sink[key] = builtSelection[key];
10430
- }
10431
- });
10432
- }
10433
- else {
10434
- Object.assign(sink, builtSelection);
10435
- }
10436
- }
10437
- });
10438
- return sink;
9682
+ return selectCalculateSink(sink, field, buildSelectionForNode$p, source, reader, variables, fragments, parentRecordId);
10439
9683
  };
10440
9684
  }
10441
9685
  function getMinimumSelections$m() {
@@ -10460,10 +9704,10 @@ function getTypeCacheKeys$t(astNode, state) {
10460
9704
  representationName: name$o
10461
9705
  });
10462
9706
  // get all cache keys from normalizable fields
10463
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$p) : [];
9707
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$p) : new Map();
10464
9708
  for (const fieldDataKey of Object.keys(data)) {
10465
9709
  const fieldData = data[fieldDataKey];
10466
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
9710
+ const requestedField = requestedFields.get(fieldDataKey);
10467
9711
  if (requestedField === undefined) {
10468
9712
  continue; // Skip unknown field.
10469
9713
  }
@@ -10733,26 +9977,8 @@ function buildSelectionForNode$o(source, reader, parentNode, selectionNode, vari
10733
9977
  }
10734
9978
  function select$x(field, variables, fragments) {
10735
9979
  return (source, reader, parentRecordId) => {
10736
- var _a;
10737
9980
  const sink = {};
10738
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
10739
- const builtSelection = buildSelectionForNode$o(source, reader, field, sel, variables, fragments, parentRecordId);
10740
- if (builtSelection !== undefined) {
10741
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
10742
- Object.keys(builtSelection).forEach((key, value) => {
10743
- // We only assign a field selection in the fragment if it doesn't already exist in sink
10744
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
10745
- if (sink[key] === undefined) {
10746
- sink[key] = builtSelection[key];
10747
- }
10748
- });
10749
- }
10750
- else {
10751
- Object.assign(sink, builtSelection);
10752
- }
10753
- }
10754
- });
10755
- return sink;
9981
+ return selectCalculateSink(sink, field, buildSelectionForNode$o, source, reader, variables, fragments, parentRecordId);
10756
9982
  };
10757
9983
  }
10758
9984
  function getTypeCacheKeys$s(astNode, state) {
@@ -10907,26 +10133,8 @@ function buildSelectionForNode$n(source, reader, parentNode, selectionNode, vari
10907
10133
  }
10908
10134
  function select$w(field, variables, fragments) {
10909
10135
  return (source, reader, parentRecordId) => {
10910
- var _a;
10911
10136
  const sink = {};
10912
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
10913
- const builtSelection = buildSelectionForNode$n(source, reader, field, sel, variables, fragments, parentRecordId);
10914
- if (builtSelection !== undefined) {
10915
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
10916
- Object.keys(builtSelection).forEach((key, value) => {
10917
- // We only assign a field selection in the fragment if it doesn't already exist in sink
10918
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
10919
- if (sink[key] === undefined) {
10920
- sink[key] = builtSelection[key];
10921
- }
10922
- });
10923
- }
10924
- else {
10925
- Object.assign(sink, builtSelection);
10926
- }
10927
- }
10928
- });
10929
- return sink;
10137
+ return selectCalculateSink(sink, field, buildSelectionForNode$n, source, reader, variables, fragments, parentRecordId);
10930
10138
  };
10931
10139
  }
10932
10140
  function getMinimumSelections$l() {
@@ -10951,10 +10159,10 @@ function getTypeCacheKeys$r(astNode, state) {
10951
10159
  representationName: name$m
10952
10160
  });
10953
10161
  // get all cache keys from normalizable fields
10954
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$n) : [];
10162
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$n) : new Map();
10955
10163
  for (const fieldDataKey of Object.keys(data)) {
10956
10164
  const fieldData = data[fieldDataKey];
10957
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
10165
+ const requestedField = requestedFields.get(fieldDataKey);
10958
10166
  if (requestedField === undefined) {
10959
10167
  continue; // Skip unknown field.
10960
10168
  }
@@ -11242,26 +10450,8 @@ function buildSelectionForNode$m(source, reader, parentNode, selectionNode, vari
11242
10450
  }
11243
10451
  function select$v(field, variables, fragments) {
11244
10452
  return (source, reader, parentRecordId) => {
11245
- var _a;
11246
10453
  const sink = {};
11247
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
11248
- const builtSelection = buildSelectionForNode$m(source, reader, field, sel, variables, fragments, parentRecordId);
11249
- if (builtSelection !== undefined) {
11250
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
11251
- Object.keys(builtSelection).forEach((key, value) => {
11252
- // We only assign a field selection in the fragment if it doesn't already exist in sink
11253
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
11254
- if (sink[key] === undefined) {
11255
- sink[key] = builtSelection[key];
11256
- }
11257
- });
11258
- }
11259
- else {
11260
- Object.assign(sink, builtSelection);
11261
- }
11262
- }
11263
- });
11264
- return sink;
10454
+ return selectCalculateSink(sink, field, buildSelectionForNode$m, source, reader, variables, fragments, parentRecordId);
11265
10455
  };
11266
10456
  }
11267
10457
  function getMinimumSelections$k() {
@@ -11286,10 +10476,10 @@ function getTypeCacheKeys$q(astNode, state) {
11286
10476
  representationName: name$l
11287
10477
  });
11288
10478
  // get all cache keys from normalizable fields
11289
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$m) : [];
10479
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$m) : new Map();
11290
10480
  for (const fieldDataKey of Object.keys(data)) {
11291
10481
  const fieldData = data[fieldDataKey];
11292
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
10482
+ const requestedField = requestedFields.get(fieldDataKey);
11293
10483
  if (requestedField === undefined) {
11294
10484
  continue; // Skip unknown field.
11295
10485
  }
@@ -11603,26 +10793,8 @@ function buildSelectionForNode$l(source, reader, parentNode, selectionNode, vari
11603
10793
  }
11604
10794
  function select$u(field, variables, fragments) {
11605
10795
  return (source, reader, parentRecordId) => {
11606
- var _a;
11607
10796
  const sink = {};
11608
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
11609
- const builtSelection = buildSelectionForNode$l(source, reader, field, sel, variables, fragments, parentRecordId);
11610
- if (builtSelection !== undefined) {
11611
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
11612
- Object.keys(builtSelection).forEach((key, value) => {
11613
- // We only assign a field selection in the fragment if it doesn't already exist in sink
11614
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
11615
- if (sink[key] === undefined) {
11616
- sink[key] = builtSelection[key];
11617
- }
11618
- });
11619
- }
11620
- else {
11621
- Object.assign(sink, builtSelection);
11622
- }
11623
- }
11624
- });
11625
- return sink;
10797
+ return selectCalculateSink(sink, field, buildSelectionForNode$l, source, reader, variables, fragments, parentRecordId);
11626
10798
  };
11627
10799
  }
11628
10800
  function getTypeCacheKeys$p(astNode, state) {
@@ -11763,26 +10935,8 @@ function buildSelectionForNode$k(source, reader, parentNode, selectionNode, vari
11763
10935
  }
11764
10936
  function select$t(field, variables, fragments) {
11765
10937
  return (source, reader, parentRecordId) => {
11766
- var _a;
11767
10938
  const sink = {};
11768
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
11769
- const builtSelection = buildSelectionForNode$k(source, reader, field, sel, variables, fragments, parentRecordId);
11770
- if (builtSelection !== undefined) {
11771
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
11772
- Object.keys(builtSelection).forEach((key, value) => {
11773
- // We only assign a field selection in the fragment if it doesn't already exist in sink
11774
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
11775
- if (sink[key] === undefined) {
11776
- sink[key] = builtSelection[key];
11777
- }
11778
- });
11779
- }
11780
- else {
11781
- Object.assign(sink, builtSelection);
11782
- }
11783
- }
11784
- });
11785
- return sink;
10939
+ return selectCalculateSink(sink, field, buildSelectionForNode$k, source, reader, variables, fragments, parentRecordId);
11786
10940
  };
11787
10941
  }
11788
10942
  function getMinimumSelections$j() {
@@ -11807,10 +10961,10 @@ function getTypeCacheKeys$o(astNode, state) {
11807
10961
  representationName: name$j
11808
10962
  });
11809
10963
  // get all cache keys from normalizable fields
11810
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$k) : [];
10964
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$k) : new Map();
11811
10965
  for (const fieldDataKey of Object.keys(data)) {
11812
10966
  const fieldData = data[fieldDataKey];
11813
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
10967
+ const requestedField = requestedFields.get(fieldDataKey);
11814
10968
  if (requestedField === undefined) {
11815
10969
  continue; // Skip unknown field.
11816
10970
  }
@@ -11978,26 +11132,8 @@ function buildSelectionForNode$j(source, reader, parentNode, selectionNode, vari
11978
11132
  }
11979
11133
  function select$s(field, variables, fragments) {
11980
11134
  return (source, reader, parentRecordId) => {
11981
- var _a;
11982
11135
  const sink = {};
11983
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
11984
- const builtSelection = buildSelectionForNode$j(source, reader, field, sel, variables, fragments, parentRecordId);
11985
- if (builtSelection !== undefined) {
11986
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
11987
- Object.keys(builtSelection).forEach((key, value) => {
11988
- // We only assign a field selection in the fragment if it doesn't already exist in sink
11989
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
11990
- if (sink[key] === undefined) {
11991
- sink[key] = builtSelection[key];
11992
- }
11993
- });
11994
- }
11995
- else {
11996
- Object.assign(sink, builtSelection);
11997
- }
11998
- }
11999
- });
12000
- return sink;
11136
+ return selectCalculateSink(sink, field, buildSelectionForNode$j, source, reader, variables, fragments, parentRecordId);
12001
11137
  };
12002
11138
  }
12003
11139
  function getTypeCacheKeys$n(astNode, state) {
@@ -12134,26 +11270,8 @@ function buildSelectionForNode$i(source, reader, parentNode, selectionNode, vari
12134
11270
  }
12135
11271
  function select$r(field, variables, fragments) {
12136
11272
  return (source, reader, parentRecordId) => {
12137
- var _a;
12138
11273
  const sink = {};
12139
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
12140
- const builtSelection = buildSelectionForNode$i(source, reader, field, sel, variables, fragments, parentRecordId);
12141
- if (builtSelection !== undefined) {
12142
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
12143
- Object.keys(builtSelection).forEach((key, value) => {
12144
- // We only assign a field selection in the fragment if it doesn't already exist in sink
12145
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
12146
- if (sink[key] === undefined) {
12147
- sink[key] = builtSelection[key];
12148
- }
12149
- });
12150
- }
12151
- else {
12152
- Object.assign(sink, builtSelection);
12153
- }
12154
- }
12155
- });
12156
- return sink;
11274
+ return selectCalculateSink(sink, field, buildSelectionForNode$i, source, reader, variables, fragments, parentRecordId);
12157
11275
  };
12158
11276
  }
12159
11277
  function getTypeCacheKeys$m(astNode, state) {
@@ -12324,26 +11442,8 @@ function buildSelectionForNode$h(source, reader, parentNode, selectionNode, vari
12324
11442
  }
12325
11443
  function select$q(field, variables, fragments) {
12326
11444
  return (source, reader, parentRecordId) => {
12327
- var _a;
12328
11445
  const sink = {};
12329
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
12330
- const builtSelection = buildSelectionForNode$h(source, reader, field, sel, variables, fragments, parentRecordId);
12331
- if (builtSelection !== undefined) {
12332
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
12333
- Object.keys(builtSelection).forEach((key, value) => {
12334
- // We only assign a field selection in the fragment if it doesn't already exist in sink
12335
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
12336
- if (sink[key] === undefined) {
12337
- sink[key] = builtSelection[key];
12338
- }
12339
- });
12340
- }
12341
- else {
12342
- Object.assign(sink, builtSelection);
12343
- }
12344
- }
12345
- });
12346
- return sink;
11446
+ return selectCalculateSink(sink, field, buildSelectionForNode$h, source, reader, variables, fragments, parentRecordId);
12347
11447
  };
12348
11448
  }
12349
11449
  function getMinimumSelections$h() {
@@ -12504,26 +11604,8 @@ function buildSelectionForNode$g(source, reader, parentNode, selectionNode, vari
12504
11604
  }
12505
11605
  function select$p(field, variables, fragments) {
12506
11606
  return (source, reader, parentRecordId) => {
12507
- var _a;
12508
11607
  const sink = {};
12509
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
12510
- const builtSelection = buildSelectionForNode$g(source, reader, field, sel, variables, fragments, parentRecordId);
12511
- if (builtSelection !== undefined) {
12512
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
12513
- Object.keys(builtSelection).forEach((key, value) => {
12514
- // We only assign a field selection in the fragment if it doesn't already exist in sink
12515
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
12516
- if (sink[key] === undefined) {
12517
- sink[key] = builtSelection[key];
12518
- }
12519
- });
12520
- }
12521
- else {
12522
- Object.assign(sink, builtSelection);
12523
- }
12524
- }
12525
- });
12526
- return sink;
11608
+ return selectCalculateSink(sink, field, buildSelectionForNode$g, source, reader, variables, fragments, parentRecordId);
12527
11609
  };
12528
11610
  }
12529
11611
  function getMinimumSelections$g() {
@@ -12676,26 +11758,8 @@ function buildSelectionForNode$f(source, reader, parentNode, selectionNode, vari
12676
11758
  }
12677
11759
  function select$o(field, variables, fragments) {
12678
11760
  return (source, reader, parentRecordId) => {
12679
- var _a;
12680
11761
  const sink = {};
12681
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
12682
- const builtSelection = buildSelectionForNode$f(source, reader, field, sel, variables, fragments, parentRecordId);
12683
- if (builtSelection !== undefined) {
12684
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
12685
- Object.keys(builtSelection).forEach((key, value) => {
12686
- // We only assign a field selection in the fragment if it doesn't already exist in sink
12687
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
12688
- if (sink[key] === undefined) {
12689
- sink[key] = builtSelection[key];
12690
- }
12691
- });
12692
- }
12693
- else {
12694
- Object.assign(sink, builtSelection);
12695
- }
12696
- }
12697
- });
12698
- return sink;
11762
+ return selectCalculateSink(sink, field, buildSelectionForNode$f, source, reader, variables, fragments, parentRecordId);
12699
11763
  };
12700
11764
  }
12701
11765
  function getMinimumSelections$f() {
@@ -12720,10 +11784,10 @@ function getTypeCacheKeys$j(astNode, state) {
12720
11784
  representationName: name$e
12721
11785
  });
12722
11786
  // get all cache keys from normalizable fields
12723
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$f) : [];
11787
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$f) : new Map();
12724
11788
  for (const fieldDataKey of Object.keys(data)) {
12725
11789
  const fieldData = data[fieldDataKey];
12726
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
11790
+ const requestedField = requestedFields.get(fieldDataKey);
12727
11791
  if (requestedField === undefined) {
12728
11792
  continue; // Skip unknown field.
12729
11793
  }
@@ -13208,26 +12272,8 @@ function buildSelectionForNode$e(source, reader, parentNode, selectionNode, vari
13208
12272
  }
13209
12273
  function select$m(field, variables, fragments) {
13210
12274
  return (source, reader, parentRecordId) => {
13211
- var _a;
13212
12275
  const sink = {};
13213
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
13214
- const builtSelection = buildSelectionForNode$e(source, reader, field, sel, variables, fragments, parentRecordId);
13215
- if (builtSelection !== undefined) {
13216
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
13217
- Object.keys(builtSelection).forEach((key, value) => {
13218
- // We only assign a field selection in the fragment if it doesn't already exist in sink
13219
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
13220
- if (sink[key] === undefined) {
13221
- sink[key] = builtSelection[key];
13222
- }
13223
- });
13224
- }
13225
- else {
13226
- Object.assign(sink, builtSelection);
13227
- }
13228
- }
13229
- });
13230
- return sink;
12276
+ return selectCalculateSink(sink, field, buildSelectionForNode$e, source, reader, variables, fragments, parentRecordId);
13231
12277
  };
13232
12278
  }
13233
12279
  function getMinimumSelections$d() {
@@ -13252,10 +12298,10 @@ function getTypeCacheKeys$h(astNode, state) {
13252
12298
  representationName: name$d
13253
12299
  });
13254
12300
  // get all cache keys from normalizable fields
13255
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$e) : [];
12301
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$e) : new Map();
13256
12302
  for (const fieldDataKey of Object.keys(data)) {
13257
12303
  const fieldData = data[fieldDataKey];
13258
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
12304
+ const requestedField = requestedFields.get(fieldDataKey);
13259
12305
  if (requestedField === undefined) {
13260
12306
  continue; // Skip unknown field.
13261
12307
  }
@@ -13804,26 +12850,8 @@ function buildSelectionForNode$d(source, reader, parentNode, selectionNode, vari
13804
12850
  }
13805
12851
  function select$l(field, variables, fragments) {
13806
12852
  return (source, reader, parentRecordId) => {
13807
- var _a;
13808
12853
  const sink = {};
13809
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
13810
- const builtSelection = buildSelectionForNode$d(source, reader, field, sel, variables, fragments, parentRecordId);
13811
- if (builtSelection !== undefined) {
13812
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
13813
- Object.keys(builtSelection).forEach((key, value) => {
13814
- // We only assign a field selection in the fragment if it doesn't already exist in sink
13815
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
13816
- if (sink[key] === undefined) {
13817
- sink[key] = builtSelection[key];
13818
- }
13819
- });
13820
- }
13821
- else {
13822
- Object.assign(sink, builtSelection);
13823
- }
13824
- }
13825
- });
13826
- return sink;
12854
+ return selectCalculateSink(sink, field, buildSelectionForNode$d, source, reader, variables, fragments, parentRecordId);
13827
12855
  };
13828
12856
  }
13829
12857
  function getMinimumSelections$c() {
@@ -13848,10 +12876,10 @@ function getTypeCacheKeys$g(astNode, state) {
13848
12876
  representationName: name$c
13849
12877
  });
13850
12878
  // get all cache keys from normalizable fields
13851
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$d) : [];
12879
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$d) : new Map();
13852
12880
  for (const fieldDataKey of Object.keys(data)) {
13853
12881
  const fieldData = data[fieldDataKey];
13854
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
12882
+ const requestedField = requestedFields.get(fieldDataKey);
13855
12883
  if (requestedField === undefined) {
13856
12884
  continue; // Skip unknown field.
13857
12885
  }
@@ -14002,26 +13030,8 @@ function buildSelectionForNode$c(source, reader, parentNode, selectionNode, vari
14002
13030
  }
14003
13031
  function select$k(field, variables, fragments) {
14004
13032
  return (source, reader, parentRecordId) => {
14005
- var _a;
14006
13033
  const sink = {};
14007
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
14008
- const builtSelection = buildSelectionForNode$c(source, reader, field, sel, variables, fragments, parentRecordId);
14009
- if (builtSelection !== undefined) {
14010
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
14011
- Object.keys(builtSelection).forEach((key, value) => {
14012
- // We only assign a field selection in the fragment if it doesn't already exist in sink
14013
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
14014
- if (sink[key] === undefined) {
14015
- sink[key] = builtSelection[key];
14016
- }
14017
- });
14018
- }
14019
- else {
14020
- Object.assign(sink, builtSelection);
14021
- }
14022
- }
14023
- });
14024
- return sink;
13034
+ return selectCalculateSink(sink, field, buildSelectionForNode$c, source, reader, variables, fragments, parentRecordId);
14025
13035
  };
14026
13036
  }
14027
13037
  function getMinimumSelections$b() {
@@ -14046,10 +13056,10 @@ function getTypeCacheKeys$f(astNode, state) {
14046
13056
  representationName: name$b
14047
13057
  });
14048
13058
  // get all cache keys from normalizable fields
14049
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$c) : [];
13059
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$c) : new Map();
14050
13060
  for (const fieldDataKey of Object.keys(data)) {
14051
13061
  const fieldData = data[fieldDataKey];
14052
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
13062
+ const requestedField = requestedFields.get(fieldDataKey);
14053
13063
  if (requestedField === undefined) {
14054
13064
  continue; // Skip unknown field.
14055
13065
  }
@@ -14207,26 +13217,8 @@ function buildSelectionForNode$b(source, reader, parentNode, selectionNode, vari
14207
13217
  }
14208
13218
  function select$j(field, variables, fragments) {
14209
13219
  return (source, reader, parentRecordId) => {
14210
- var _a;
14211
13220
  const sink = {};
14212
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
14213
- const builtSelection = buildSelectionForNode$b(source, reader, field, sel, variables, fragments, parentRecordId);
14214
- if (builtSelection !== undefined) {
14215
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
14216
- Object.keys(builtSelection).forEach((key, value) => {
14217
- // We only assign a field selection in the fragment if it doesn't already exist in sink
14218
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
14219
- if (sink[key] === undefined) {
14220
- sink[key] = builtSelection[key];
14221
- }
14222
- });
14223
- }
14224
- else {
14225
- Object.assign(sink, builtSelection);
14226
- }
14227
- }
14228
- });
14229
- return sink;
13221
+ return selectCalculateSink(sink, field, buildSelectionForNode$b, source, reader, variables, fragments, parentRecordId);
14230
13222
  };
14231
13223
  }
14232
13224
  function getMinimumSelections$a() {
@@ -14452,26 +13444,8 @@ function buildSelectionForNode$a(source, reader, parentNode, selectionNode, vari
14452
13444
  }
14453
13445
  function select$i(field, variables, fragments) {
14454
13446
  return (source, reader, parentRecordId) => {
14455
- var _a;
14456
13447
  const sink = {};
14457
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
14458
- const builtSelection = buildSelectionForNode$a(source, reader, field, sel, variables, fragments, parentRecordId);
14459
- if (builtSelection !== undefined) {
14460
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
14461
- Object.keys(builtSelection).forEach((key, value) => {
14462
- // We only assign a field selection in the fragment if it doesn't already exist in sink
14463
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
14464
- if (sink[key] === undefined) {
14465
- sink[key] = builtSelection[key];
14466
- }
14467
- });
14468
- }
14469
- else {
14470
- Object.assign(sink, builtSelection);
14471
- }
14472
- }
14473
- });
14474
- return sink;
13448
+ return selectCalculateSink(sink, field, buildSelectionForNode$a, source, reader, variables, fragments, parentRecordId);
14475
13449
  };
14476
13450
  }
14477
13451
  function getMinimumSelections$9() {
@@ -14497,10 +13471,10 @@ function getTypeCacheKeys$d(astNode, state) {
14497
13471
  representationName: name$9
14498
13472
  });
14499
13473
  // get all cache keys from normalizable fields
14500
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$a) : [];
13474
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$a) : new Map();
14501
13475
  for (const fieldDataKey of Object.keys(data)) {
14502
13476
  const fieldData = data[fieldDataKey];
14503
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
13477
+ const requestedField = requestedFields.get(fieldDataKey);
14504
13478
  if (requestedField === undefined) {
14505
13479
  continue; // Skip unknown field.
14506
13480
  }
@@ -15034,26 +14008,8 @@ function buildSelectionForNode$9(source, reader, parentNode, selectionNode, vari
15034
14008
  }
15035
14009
  function select$h(field, variables, fragments) {
15036
14010
  return (source, reader, parentRecordId) => {
15037
- var _a;
15038
14011
  const sink = {};
15039
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
15040
- const builtSelection = buildSelectionForNode$9(source, reader, field, sel, variables, fragments, parentRecordId);
15041
- if (builtSelection !== undefined) {
15042
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
15043
- Object.keys(builtSelection).forEach((key, value) => {
15044
- // We only assign a field selection in the fragment if it doesn't already exist in sink
15045
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
15046
- if (sink[key] === undefined) {
15047
- sink[key] = builtSelection[key];
15048
- }
15049
- });
15050
- }
15051
- else {
15052
- Object.assign(sink, builtSelection);
15053
- }
15054
- }
15055
- });
15056
- return sink;
14012
+ return selectCalculateSink(sink, field, buildSelectionForNode$9, source, reader, variables, fragments, parentRecordId);
15057
14013
  };
15058
14014
  }
15059
14015
  function getMinimumSelections$7() {
@@ -15078,10 +14034,10 @@ function getTypeCacheKeys$c(astNode, state) {
15078
14034
  representationName: name$8
15079
14035
  });
15080
14036
  // get all cache keys from normalizable fields
15081
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$9) : [];
14037
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$9) : new Map();
15082
14038
  for (const fieldDataKey of Object.keys(data)) {
15083
14039
  const fieldData = data[fieldDataKey];
15084
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
14040
+ const requestedField = requestedFields.get(fieldDataKey);
15085
14041
  if (requestedField === undefined) {
15086
14042
  continue; // Skip unknown field.
15087
14043
  }
@@ -15220,26 +14176,8 @@ function buildSelectionForNode$8(source, reader, parentNode, selectionNode, vari
15220
14176
  }
15221
14177
  function select$g(field, variables, fragments) {
15222
14178
  return (source, reader, parentRecordId) => {
15223
- var _a;
15224
14179
  const sink = {};
15225
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
15226
- const builtSelection = buildSelectionForNode$8(source, reader, field, sel, variables, fragments, parentRecordId);
15227
- if (builtSelection !== undefined) {
15228
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
15229
- Object.keys(builtSelection).forEach((key, value) => {
15230
- // We only assign a field selection in the fragment if it doesn't already exist in sink
15231
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
15232
- if (sink[key] === undefined) {
15233
- sink[key] = builtSelection[key];
15234
- }
15235
- });
15236
- }
15237
- else {
15238
- Object.assign(sink, builtSelection);
15239
- }
15240
- }
15241
- });
15242
- return sink;
14180
+ return selectCalculateSink(sink, field, buildSelectionForNode$8, source, reader, variables, fragments, parentRecordId);
15243
14181
  };
15244
14182
  }
15245
14183
  function getMinimumSelections$6() {
@@ -15558,10 +14496,10 @@ function ingestNonCursorConnectionType(astNode, state, specifics) {
15558
14496
  function ingestTypeWithStrategy(astNode, state, isCursorConnectionType, { key, isFragmentApplicable, isMappedFieldImport, getFieldType, ramlIngestBlock, ingestPaginatedMetadata, mergeData, storeMetadataParams, createLink, }, strategy) {
15559
14497
  const { data, variables, luvio, store } = state;
15560
14498
  const sink = {};
15561
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable) : [];
14499
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable) : new Map();
15562
14500
  for (const fieldDataKey of Object.keys(data)) {
15563
14501
  const fieldData = data[fieldDataKey];
15564
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
14502
+ const requestedField = requestedFields.get(fieldDataKey);
15565
14503
  if (requestedField === undefined) {
15566
14504
  continue; // TODO: (W-11132802) We got a field back we didn't ask for. Call handleUnknownField.
15567
14505
  }
@@ -15778,18 +14716,28 @@ function calculateRequestedFieldsForType(typename, selectionSet, namedFragmentsM
15778
14716
  selections.push(selection);
15779
14717
  }
15780
14718
  if (selection.kind === "InlineFragment" && isFragmentApplicable(selection, typename)) {
14719
+ // loops over the map to get the values.
15781
14720
  getRequestedFieldsForType(typename, selection.selectionSet, namedFragmentsMap, isFragmentApplicable)
15782
14721
  .forEach(fragmentFieldSelection => { mergeFragmentWithExistingSelections(fragmentFieldSelection, selections); });
15783
14722
  }
15784
14723
  if (selection.kind === "FragmentSpread") {
15785
14724
  const namedFragment = namedFragmentsMap[selection.name.value];
15786
14725
  if (namedFragment && isFragmentApplicable(namedFragment, typename)) {
14726
+ // loops over the map to get the values.
15787
14727
  getRequestedFieldsForType(typename, namedFragment.selectionSet, namedFragmentsMap, isFragmentApplicable)
15788
14728
  .forEach(fragmentFieldSelection => { mergeFragmentWithExistingSelections(fragmentFieldSelection, selections); });
15789
14729
  }
15790
14730
  }
15791
14731
  });
15792
- return selections;
14732
+ // Needs to happen after the selections are merged.
14733
+ return selections.reduce((acc, fieldNode) => {
14734
+ const fieldName = fieldNode.alias ? fieldNode.alias.value : fieldNode.name.value;
14735
+ // TODO: W-13485835. Some fields are not being merged, and this logic reproduces the current behavior in which the first field with name is being used.
14736
+ if (!acc.has(fieldName)) {
14737
+ acc.set(fieldName, fieldNode);
14738
+ }
14739
+ return acc;
14740
+ }, new Map());
15793
14741
  }
15794
14742
  let selectionSetRequestedFieldsWeakMap = new WeakMap();
15795
14743
  function getRequestedFieldsForType(typename, selectionSet, namedFragmentsMap, isFragmentApplicable) {
@@ -16394,6 +15342,27 @@ function augmentDefaultVariableValues(variableDefinitions, variables) {
16394
15342
  }
16395
15343
  });
16396
15344
  }
15345
+ function selectCalculateSink(sink, field, buildSelectionForNodeFn, source, reader, variables, fragments, parentRecordId) {
15346
+ var _a;
15347
+ (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
15348
+ const builtSelection = buildSelectionForNodeFn(source, reader, field, sel, variables, fragments, parentRecordId);
15349
+ if (builtSelection !== undefined) {
15350
+ if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
15351
+ Object.keys(builtSelection).forEach((key, value) => {
15352
+ // We only assign a field selection in the fragment if it doesn't already exist in sink
15353
+ // The non-fragment selection already got the merged selections in getRequestedFieldsForType
15354
+ if (sink[key] === undefined) {
15355
+ sink[key] = builtSelection[key];
15356
+ }
15357
+ });
15358
+ }
15359
+ else {
15360
+ Object.assign(sink, builtSelection);
15361
+ }
15362
+ }
15363
+ });
15364
+ return sink;
15365
+ }
16397
15366
  function selectTypeLinkWithPagination(resolvedLink, sel, fieldData, reader, key, sink, variables, fragments, selectFn) {
16398
15367
  var _a, _b, _c, _d, _e;
16399
15368
  const source = resolvedLink.data.data;
@@ -16587,26 +15556,8 @@ function buildSelectionForNode$6(source, reader, parentNode, selectionNode, vari
16587
15556
  }
16588
15557
  function select$f(field, variables, fragments) {
16589
15558
  return (source, reader, parentRecordId) => {
16590
- var _a;
16591
15559
  const sink = {};
16592
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
16593
- const builtSelection = buildSelectionForNode$6(source, reader, field, sel, variables, fragments, parentRecordId);
16594
- if (builtSelection !== undefined) {
16595
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
16596
- Object.keys(builtSelection).forEach((key, value) => {
16597
- // We only assign a field selection in the fragment if it doesn't already exist in sink
16598
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
16599
- if (sink[key] === undefined) {
16600
- sink[key] = builtSelection[key];
16601
- }
16602
- });
16603
- }
16604
- else {
16605
- Object.assign(sink, builtSelection);
16606
- }
16607
- }
16608
- });
16609
- return sink;
15560
+ return selectCalculateSink(sink, field, buildSelectionForNode$6, source, reader, variables, fragments, parentRecordId);
16610
15561
  };
16611
15562
  }
16612
15563
  function getTypeCacheKeys$a(astNode, state) {
@@ -16765,7 +15716,7 @@ function convertGraphQLToRaml(astNode, state) {
16765
15716
  const { data } = state;
16766
15717
  const requestedFields = astNode.selectionSet
16767
15718
  ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$5)
16768
- : [];
15719
+ : new Map();
16769
15720
  const { fieldsBag, trie } = createFieldsBagAndTrie(data, requestedFields, state);
16770
15721
  const recordRepresentation = {
16771
15722
  apiName: data.ApiName,
@@ -16794,7 +15745,7 @@ function createFieldsBagAndTrie(data, requestedFields, parentState) {
16794
15745
  };
16795
15746
  for (const fieldDataKey of Object.keys(data)) {
16796
15747
  const fieldData = data[fieldDataKey];
16797
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
15748
+ const requestedField = requestedFields.get(fieldDataKey);
16798
15749
  if (requestedField === undefined) {
16799
15750
  continue; // We got a field back we didn't ask for. Skip.
16800
15751
  }
@@ -16884,9 +15835,8 @@ function convertAstToTrie(astNode, fragments) {
16884
15835
  const requestedFields = astNode.selectionSet
16885
15836
  ? getRequestedFieldsForType('', // data is null here
16886
15837
  astNode.selectionSet, fragments, isFragmentApplicable$5)
16887
- : [];
16888
- for (let i = 0, len = requestedFields.length; i < len; i += 1) {
16889
- const field = requestedFields[i];
15838
+ : new Map();
15839
+ for (const [, field] of requestedFields) {
16890
15840
  const fieldType = getFieldType$9(field);
16891
15841
  const fieldName = field.name.value;
16892
15842
  //Untyped field - Adapter forwarded request?
@@ -17233,10 +16183,10 @@ function getTypeCacheKeys$6(astNode, state) {
17233
16183
  // get all cache keys from normalizable fields
17234
16184
  const requestedFields = astNode.selectionSet
17235
16185
  ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$3)
17236
- : [];
16186
+ : new Map();
17237
16187
  for (const fieldDataKey of ObjectKeys(data)) {
17238
16188
  const fieldData = data[fieldDataKey];
17239
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
16189
+ const requestedField = requestedFields.get(fieldDataKey);
17240
16190
  if (requestedField === undefined) {
17241
16191
  continue; // Skip unknown field.
17242
16192
  }
@@ -17458,28 +16408,10 @@ function buildSelectionForNode$5(source, reader, parentNode, selectionNode, vari
17458
16408
  }
17459
16409
  function select$e(field, variables, fragments) {
17460
16410
  return (source, reader, parentRecordId) => {
17461
- var _a;
17462
16411
  const sink = {};
17463
16412
  source = attachMappedData(source, reader);
17464
16413
  reader.markSeenId(parentRecordId); // Always mark identifiable types as seen
17465
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
17466
- const builtSelection = buildSelectionForNode$5(source, reader, field, sel, variables, fragments, parentRecordId);
17467
- if (builtSelection !== undefined) {
17468
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
17469
- Object.keys(builtSelection).forEach((key, value) => {
17470
- // We only assign a field selection in the fragment if it doesn't already exist in sink
17471
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
17472
- if (sink[key] === undefined) {
17473
- sink[key] = builtSelection[key];
17474
- }
17475
- });
17476
- }
17477
- else {
17478
- Object.assign(sink, builtSelection);
17479
- }
17480
- }
17481
- });
17482
- return sink;
16414
+ return selectCalculateSink(sink, field, buildSelectionForNode$5, source, reader, variables, fragments, parentRecordId);
17483
16415
  };
17484
16416
  }
17485
16417
  function getTypeCacheKeys$5(astNode, state) {
@@ -17492,10 +16424,10 @@ function getTypeCacheKeys$5(astNode, state) {
17492
16424
  representationName: name$5
17493
16425
  });
17494
16426
  // get all cache keys from normalizable fields
17495
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$5) : [];
16427
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$5) : new Map();
17496
16428
  for (const fieldDataKey of Object.keys(data)) {
17497
16429
  const fieldData = data[fieldDataKey];
17498
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
16430
+ const requestedField = requestedFields.get(fieldDataKey);
17499
16431
  if (requestedField === undefined) {
17500
16432
  continue; // Skip unknown field.
17501
16433
  }
@@ -18359,26 +17291,8 @@ function buildSelectionForNode$4(source, reader, parentNode, selectionNode, vari
18359
17291
  }
18360
17292
  function select$d(field, variables, fragments) {
18361
17293
  return (source, reader, parentRecordId) => {
18362
- var _a;
18363
17294
  const sink = {};
18364
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
18365
- const builtSelection = buildSelectionForNode$4(source, reader, field, sel, variables, fragments, parentRecordId);
18366
- if (builtSelection !== undefined) {
18367
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
18368
- Object.keys(builtSelection).forEach((key, value) => {
18369
- // We only assign a field selection in the fragment if it doesn't already exist in sink
18370
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
18371
- if (sink[key] === undefined) {
18372
- sink[key] = builtSelection[key];
18373
- }
18374
- });
18375
- }
18376
- else {
18377
- Object.assign(sink, builtSelection);
18378
- }
18379
- }
18380
- });
18381
- return sink;
17295
+ return selectCalculateSink(sink, field, buildSelectionForNode$4, source, reader, variables, fragments, parentRecordId);
18382
17296
  };
18383
17297
  }
18384
17298
  function getMinimumSelections$4() {
@@ -18403,10 +17317,10 @@ function getTypeCacheKeys$4(astNode, state) {
18403
17317
  representationName: name$4
18404
17318
  });
18405
17319
  // get all cache keys from normalizable fields
18406
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$4) : [];
17320
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$4) : new Map();
18407
17321
  for (const fieldDataKey of Object.keys(data)) {
18408
17322
  const fieldData = data[fieldDataKey];
18409
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
17323
+ const requestedField = requestedFields.get(fieldDataKey);
18410
17324
  if (requestedField === undefined) {
18411
17325
  continue; // Skip unknown field.
18412
17326
  }
@@ -18630,26 +17544,8 @@ function buildSelectionForNode$3(source, reader, parentNode, selectionNode, vari
18630
17544
  }
18631
17545
  function select$c(field, variables, fragments) {
18632
17546
  return (source, reader, parentRecordId) => {
18633
- var _a;
18634
17547
  const sink = {};
18635
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
18636
- const builtSelection = buildSelectionForNode$3(source, reader, field, sel, variables, fragments, parentRecordId);
18637
- if (builtSelection !== undefined) {
18638
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
18639
- Object.keys(builtSelection).forEach((key, value) => {
18640
- // We only assign a field selection in the fragment if it doesn't already exist in sink
18641
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
18642
- if (sink[key] === undefined) {
18643
- sink[key] = builtSelection[key];
18644
- }
18645
- });
18646
- }
18647
- else {
18648
- Object.assign(sink, builtSelection);
18649
- }
18650
- }
18651
- });
18652
- return sink;
17548
+ return selectCalculateSink(sink, field, buildSelectionForNode$3, source, reader, variables, fragments, parentRecordId);
18653
17549
  };
18654
17550
  }
18655
17551
  function getMinimumSelections$3() {
@@ -18817,26 +17713,8 @@ function buildSelectionForNode$2(source, reader, parentNode, selectionNode, vari
18817
17713
  }
18818
17714
  function select$b(field, variables, fragments) {
18819
17715
  return (source, reader, parentRecordId) => {
18820
- var _a;
18821
17716
  const sink = {};
18822
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
18823
- const builtSelection = buildSelectionForNode$2(source, reader, field, sel, variables, fragments, parentRecordId);
18824
- if (builtSelection !== undefined) {
18825
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
18826
- Object.keys(builtSelection).forEach((key, value) => {
18827
- // We only assign a field selection in the fragment if it doesn't already exist in sink
18828
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
18829
- if (sink[key] === undefined) {
18830
- sink[key] = builtSelection[key];
18831
- }
18832
- });
18833
- }
18834
- else {
18835
- Object.assign(sink, builtSelection);
18836
- }
18837
- }
18838
- });
18839
- return sink;
17717
+ return selectCalculateSink(sink, field, buildSelectionForNode$2, source, reader, variables, fragments, parentRecordId);
18840
17718
  };
18841
17719
  }
18842
17720
  function getMinimumSelections$2() {
@@ -18861,10 +17739,10 @@ function getTypeCacheKeys$3(astNode, state) {
18861
17739
  representationName: name$2
18862
17740
  });
18863
17741
  // get all cache keys from normalizable fields
18864
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$2) : [];
17742
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$2) : new Map();
18865
17743
  for (const fieldDataKey of Object.keys(data)) {
18866
17744
  const fieldData = data[fieldDataKey];
18867
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
17745
+ const requestedField = requestedFields.get(fieldDataKey);
18868
17746
  if (requestedField === undefined) {
18869
17747
  continue; // Skip unknown field.
18870
17748
  }
@@ -19009,26 +17887,8 @@ function buildSelectionForNode$1(source, reader, parentNode, selectionNode, vari
19009
17887
  }
19010
17888
  function select$a(field, variables, fragments) {
19011
17889
  return (source, reader, parentRecordId) => {
19012
- var _a;
19013
17890
  const sink = {};
19014
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
19015
- const builtSelection = buildSelectionForNode$1(source, reader, field, sel, variables, fragments, parentRecordId);
19016
- if (builtSelection !== undefined) {
19017
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
19018
- Object.keys(builtSelection).forEach((key, value) => {
19019
- // We only assign a field selection in the fragment if it doesn't already exist in sink
19020
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
19021
- if (sink[key] === undefined) {
19022
- sink[key] = builtSelection[key];
19023
- }
19024
- });
19025
- }
19026
- else {
19027
- Object.assign(sink, builtSelection);
19028
- }
19029
- }
19030
- });
19031
- return sink;
17891
+ return selectCalculateSink(sink, field, buildSelectionForNode$1, source, reader, variables, fragments, parentRecordId);
19032
17892
  };
19033
17893
  }
19034
17894
  function getMinimumSelections$1() {
@@ -19053,10 +17913,10 @@ function getTypeCacheKeys$2(astNode, state) {
19053
17913
  representationName: name$1
19054
17914
  });
19055
17915
  // get all cache keys from normalizable fields
19056
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$1) : [];
17916
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable$1) : new Map();
19057
17917
  for (const fieldDataKey of Object.keys(data)) {
19058
17918
  const fieldData = data[fieldDataKey];
19059
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
17919
+ const requestedField = requestedFields.get(fieldDataKey);
19060
17920
  if (requestedField === undefined) {
19061
17921
  continue; // Skip unknown field.
19062
17922
  }
@@ -19315,26 +18175,8 @@ function buildSelectionForNode(source, reader, parentNode, selectionNode, variab
19315
18175
  }
19316
18176
  function select$9(field, variables, fragments) {
19317
18177
  return (source, reader, parentRecordId) => {
19318
- var _a;
19319
18178
  const sink = {};
19320
- (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
19321
- const builtSelection = buildSelectionForNode(source, reader, field, sel, variables, fragments, parentRecordId);
19322
- if (builtSelection !== undefined) {
19323
- if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
19324
- Object.keys(builtSelection).forEach((key, value) => {
19325
- // We only assign a field selection in the fragment if it doesn't already exist in sink
19326
- // The non-fragment selection already got the merged selections in getRequestedFieldsForType
19327
- if (sink[key] === undefined) {
19328
- sink[key] = builtSelection[key];
19329
- }
19330
- });
19331
- }
19332
- else {
19333
- Object.assign(sink, builtSelection);
19334
- }
19335
- }
19336
- });
19337
- return sink;
18179
+ return selectCalculateSink(sink, field, buildSelectionForNode, source, reader, variables, fragments, parentRecordId);
19338
18180
  };
19339
18181
  }
19340
18182
  function getMinimumSelections() {
@@ -19351,10 +18193,10 @@ function getTypeCacheKeys$1(astNode, state) {
19351
18193
  representationName: name
19352
18194
  });
19353
18195
  // get all cache keys from normalizable fields
19354
- const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable) : [];
18196
+ const requestedFields = astNode.selectionSet ? getRequestedFieldsForType(data.__typename, astNode.selectionSet, state.fragments, isFragmentApplicable) : new Map();
19355
18197
  for (const fieldDataKey of Object.keys(data)) {
19356
18198
  const fieldData = data[fieldDataKey];
19357
- const requestedField = getRequestedField(fieldDataKey, requestedFields);
18199
+ const requestedField = requestedFields.get(fieldDataKey);
19358
18200
  if (requestedField === undefined) {
19359
18201
  continue; // Skip unknown field.
19360
18202
  }
@@ -20811,4 +19653,4 @@ register({
20811
19653
  });
20812
19654
 
20813
19655
  export { configurationForGraphQLAdapters as configuration, graphql, factory$1 as graphqlAdapterFactory, graphqlBatch, graphqlBatch_imperative, graphql_imperative };
20814
- // version: 1.157.2-24516510a
19656
+ // version: 1.158.1-63f64c475