@salesforce/lds-adapters-uiapi 1.114.5 → 1.114.6

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.
@@ -5758,6 +5758,10 @@
5758
5758
  function findMaxOffset(metadata) {
5759
5759
  if (metadata === undefined)
5760
5760
  return -1;
5761
+ const endOfList = metadata["__END__"];
5762
+ if (endOfList !== undefined) {
5763
+ return endOfList > 0 ? endOfList - 1 : 0; // Cursor based pagination in gql is off by one :)
5764
+ }
5761
5765
  const { __END__: _, ...cursorMetadata } = metadata;
5762
5766
  const values = Object.values(cursorMetadata).filter((value) => value !== undefined);
5763
5767
  return Math.max(...values);
@@ -31659,93 +31663,6 @@
31659
31663
  buildCachedSnapshotCachePolicy$6, buildNetworkSnapshotCachePolicy$7);
31660
31664
  };
31661
31665
 
31662
- function applyToSelection$6(selection, directive, variables) {
31663
- return selection;
31664
- }
31665
-
31666
- function applyToSelection$5(selection, directive, variables) {
31667
- return selection;
31668
- }
31669
-
31670
- function applyToSelection$4(selection, directive, variables) {
31671
- return selection;
31672
- }
31673
-
31674
- function applyToSelection$3(selection, directive, variables) {
31675
- var _a;
31676
- const ifArg = (_a = directive.arguments) === null || _a === void 0 ? void 0 : _a.find(argument => argument.name.value === "if");
31677
- if (ifArg && ifArg.value) {
31678
- if (ifArg.value.kind === "BooleanValue") {
31679
- return ifArg.value.value ? selection : undefined;
31680
- }
31681
- if (ifArg.value.kind === "Variable") {
31682
- return variables[ifArg.value.name.value] ? selection : undefined;
31683
- }
31684
- }
31685
- return selection;
31686
- }
31687
-
31688
- function applyToSelection$2(selection, directive, variables) {
31689
- var _a;
31690
- const ifArg = (_a = directive.arguments) === null || _a === void 0 ? void 0 : _a.find(argument => argument.name.value === "if");
31691
- if (ifArg && ifArg.value) {
31692
- if (ifArg.value.kind === "BooleanValue") {
31693
- return ifArg.value.value ? undefined : selection;
31694
- }
31695
- if (ifArg.value.kind === "Variable") {
31696
- return variables[ifArg.value.name.value] ? undefined : selection;
31697
- }
31698
- }
31699
- return selection;
31700
- }
31701
-
31702
- function applyToSelection$1(selection, directive, variables) {
31703
- return selection;
31704
- }
31705
-
31706
- function applyToSelection(selection, directive, variables) {
31707
- return selection;
31708
- }
31709
-
31710
- function applyDirectivesForSelection(selection, variables) {
31711
- let result = selection;
31712
- if (selection && selection.directives) {
31713
- // iterate through directives in order. Directives _can_ be stacked.
31714
- for (var i = 0; i < selection.directives.length; i++) {
31715
- const directive = selection.directives[i];
31716
- switch (directive.name.value) {
31717
- // Generate Case for each directive in the schema that supports SelectionNodes
31718
- case ("generic"):
31719
- result = applyToSelection$6(selection);
31720
- break;
31721
- case ("fieldCategory"):
31722
- result = applyToSelection$5(selection);
31723
- break;
31724
- case ("category"):
31725
- result = applyToSelection$4(selection);
31726
- break;
31727
- case ("include"):
31728
- result = applyToSelection$3(selection, directive, variables);
31729
- break;
31730
- case ("skip"):
31731
- result = applyToSelection$2(selection, directive, variables);
31732
- break;
31733
- case ("deprecated"):
31734
- result = applyToSelection$1(selection);
31735
- break;
31736
- case ("specifiedBy"):
31737
- result = applyToSelection(selection);
31738
- break;
31739
- }
31740
- if (result === undefined) {
31741
- // Selection was removed.
31742
- break;
31743
- }
31744
- }
31745
- }
31746
- return result;
31747
- }
31748
-
31749
31666
  const name$G = 'DoubleValue';
31750
31667
  const VERSION$T = 'de69c0962aca45d77a5bc8d9abacfa7d';
31751
31668
  function keyBuilder$U(luvio, path, data) {
@@ -31805,79 +31722,18 @@
31805
31722
  }
31806
31723
  return sink;
31807
31724
  }
31808
- function buildSelectionForField$G(source, reader, sel, variables, fragments) {
31809
- const sink = {};
31810
- const fieldData = getFieldData$G(source, sel, variables);
31811
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
31812
- reader.enterPath(requestedFieldName);
31813
- if (fieldData === undefined) {
31814
- reader.markMissing();
31815
- reader.exitPath();
31816
- return;
31817
- }
31818
- if (fieldData === null) {
31819
- reader.assignScalar(requestedFieldName, sink, fieldData);
31820
- return sink;
31821
- }
31822
- const fieldType = getFieldType$11(sel);
31823
- if (fieldType === undefined) {
31824
- // This field's type is unknown to us. This breaks normalization.
31825
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
31826
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
31827
- }
31828
- else if (fieldType.isArray) {
31829
- const arraySink = [];
31830
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
31831
- reader.enterPath(i);
31832
- selectType$H(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
31833
- reader.exitPath();
31834
- }
31835
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
31836
- }
31837
- else {
31838
- selectType$H(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
31839
- }
31840
- reader.exitPath();
31841
- return sink;
31725
+ function buildSelectionForField$H(source, reader, sel, variables, fragments) {
31726
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$G, getFieldType$11, selectType$H);
31842
31727
  }
31843
- function buildSelectionForNode$G(source, reader, parentNode, selectionNode, variables, fragments) {
31844
- const sink = {};
31845
- if (selectionNode.directives) {
31846
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
31847
- if (selectionWithDirectives === undefined) {
31848
- return;
31849
- }
31850
- selectionNode = selectionWithDirectives;
31851
- }
31852
- if (selectionNode.kind === "InlineFragment") {
31853
- if (isFragmentApplicable$H(selectionNode, source.data.__typename)) {
31854
- // Get selections out of the inline fragment
31855
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
31856
- // Call into field handling with selections
31857
- Object.assign(sink, buildSelectionForNode$G(source, reader, parentNode, fragmentSelection, variables, fragments));
31858
- });
31859
- }
31860
- }
31861
- if (selectionNode.kind === "FragmentSpread") {
31862
- const namedFragment = fragments[selectionNode.name.value];
31863
- if (namedFragment && isFragmentApplicable$H(namedFragment, source.data.__typename)) {
31864
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
31865
- // Call into field handling with selections
31866
- Object.assign(sink, buildSelectionForNode$G(source, reader, parentNode, fragmentSelection, variables, fragments));
31867
- });
31868
- }
31869
- }
31870
- if (selectionNode.kind === "Field") {
31871
- Object.assign(sink, buildSelectionForField$G(source, reader, selectionNode, variables));
31872
- }
31873
- return sink;
31728
+ function buildSelectionForNode$H(source, reader, parentNode, selectionNode, variables, fragments) {
31729
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$H, buildSelectionForField$H);
31874
31730
  }
31875
31731
  function select$Q(field, variables, fragments) {
31876
31732
  return (source, reader) => {
31877
31733
  var _a;
31878
31734
  const sink = {};
31879
31735
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
31880
- const builtSelection = buildSelectionForNode$G(source, reader, field, sel, variables, fragments);
31736
+ const builtSelection = buildSelectionForNode$H(source, reader, field, sel, variables, fragments);
31881
31737
  if (builtSelection !== undefined) {
31882
31738
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
31883
31739
  Object.keys(builtSelection).forEach((key, value) => {
@@ -32025,79 +31881,18 @@
32025
31881
  }
32026
31882
  return sink;
32027
31883
  }
32028
- function buildSelectionForField$F(source, reader, sel, variables, fragments) {
32029
- const sink = {};
32030
- const fieldData = getFieldData$F(source, sel, variables);
32031
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
32032
- reader.enterPath(requestedFieldName);
32033
- if (fieldData === undefined) {
32034
- reader.markMissing();
32035
- reader.exitPath();
32036
- return;
32037
- }
32038
- if (fieldData === null) {
32039
- reader.assignScalar(requestedFieldName, sink, fieldData);
32040
- return sink;
32041
- }
32042
- const fieldType = getFieldType$10(sel);
32043
- if (fieldType === undefined) {
32044
- // This field's type is unknown to us. This breaks normalization.
32045
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
32046
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
32047
- }
32048
- else if (fieldType.isArray) {
32049
- const arraySink = [];
32050
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
32051
- reader.enterPath(i);
32052
- selectType$G(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
32053
- reader.exitPath();
32054
- }
32055
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
32056
- }
32057
- else {
32058
- selectType$G(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
32059
- }
32060
- reader.exitPath();
32061
- return sink;
31884
+ function buildSelectionForField$G(source, reader, sel, variables, fragments) {
31885
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$F, getFieldType$10, selectType$G);
32062
31886
  }
32063
- function buildSelectionForNode$F(source, reader, parentNode, selectionNode, variables, fragments) {
32064
- const sink = {};
32065
- if (selectionNode.directives) {
32066
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
32067
- if (selectionWithDirectives === undefined) {
32068
- return;
32069
- }
32070
- selectionNode = selectionWithDirectives;
32071
- }
32072
- if (selectionNode.kind === "InlineFragment") {
32073
- if (isFragmentApplicable$G(selectionNode, source.data.__typename)) {
32074
- // Get selections out of the inline fragment
32075
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
32076
- // Call into field handling with selections
32077
- Object.assign(sink, buildSelectionForNode$F(source, reader, parentNode, fragmentSelection, variables, fragments));
32078
- });
32079
- }
32080
- }
32081
- if (selectionNode.kind === "FragmentSpread") {
32082
- const namedFragment = fragments[selectionNode.name.value];
32083
- if (namedFragment && isFragmentApplicable$G(namedFragment, source.data.__typename)) {
32084
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
32085
- // Call into field handling with selections
32086
- Object.assign(sink, buildSelectionForNode$F(source, reader, parentNode, fragmentSelection, variables, fragments));
32087
- });
32088
- }
32089
- }
32090
- if (selectionNode.kind === "Field") {
32091
- Object.assign(sink, buildSelectionForField$F(source, reader, selectionNode, variables));
32092
- }
32093
- return sink;
31887
+ function buildSelectionForNode$G(source, reader, parentNode, selectionNode, variables, fragments) {
31888
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$G, buildSelectionForField$G);
32094
31889
  }
32095
31890
  function select$P(field, variables, fragments) {
32096
31891
  return (source, reader) => {
32097
31892
  var _a;
32098
31893
  const sink = {};
32099
31894
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
32100
- const builtSelection = buildSelectionForNode$F(source, reader, field, sel, variables, fragments);
31895
+ const builtSelection = buildSelectionForNode$G(source, reader, field, sel, variables, fragments);
32101
31896
  if (builtSelection !== undefined) {
32102
31897
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
32103
31898
  Object.keys(builtSelection).forEach((key, value) => {
@@ -32245,79 +32040,18 @@
32245
32040
  }
32246
32041
  return sink;
32247
32042
  }
32248
- function buildSelectionForField$E(source, reader, sel, variables, fragments) {
32249
- const sink = {};
32250
- const fieldData = getFieldData$E(source, sel, variables);
32251
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
32252
- reader.enterPath(requestedFieldName);
32253
- if (fieldData === undefined) {
32254
- reader.markMissing();
32255
- reader.exitPath();
32256
- return;
32257
- }
32258
- if (fieldData === null) {
32259
- reader.assignScalar(requestedFieldName, sink, fieldData);
32260
- return sink;
32261
- }
32262
- const fieldType = getFieldType$$(sel);
32263
- if (fieldType === undefined) {
32264
- // This field's type is unknown to us. This breaks normalization.
32265
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
32266
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
32267
- }
32268
- else if (fieldType.isArray) {
32269
- const arraySink = [];
32270
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
32271
- reader.enterPath(i);
32272
- selectType$F(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
32273
- reader.exitPath();
32274
- }
32275
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
32276
- }
32277
- else {
32278
- selectType$F(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
32279
- }
32280
- reader.exitPath();
32281
- return sink;
32043
+ function buildSelectionForField$F(source, reader, sel, variables, fragments) {
32044
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$E, getFieldType$$, selectType$F);
32282
32045
  }
32283
- function buildSelectionForNode$E(source, reader, parentNode, selectionNode, variables, fragments) {
32284
- const sink = {};
32285
- if (selectionNode.directives) {
32286
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
32287
- if (selectionWithDirectives === undefined) {
32288
- return;
32289
- }
32290
- selectionNode = selectionWithDirectives;
32291
- }
32292
- if (selectionNode.kind === "InlineFragment") {
32293
- if (isFragmentApplicable$F(selectionNode, source.data.__typename)) {
32294
- // Get selections out of the inline fragment
32295
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
32296
- // Call into field handling with selections
32297
- Object.assign(sink, buildSelectionForNode$E(source, reader, parentNode, fragmentSelection, variables, fragments));
32298
- });
32299
- }
32300
- }
32301
- if (selectionNode.kind === "FragmentSpread") {
32302
- const namedFragment = fragments[selectionNode.name.value];
32303
- if (namedFragment && isFragmentApplicable$F(namedFragment, source.data.__typename)) {
32304
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
32305
- // Call into field handling with selections
32306
- Object.assign(sink, buildSelectionForNode$E(source, reader, parentNode, fragmentSelection, variables, fragments));
32307
- });
32308
- }
32309
- }
32310
- if (selectionNode.kind === "Field") {
32311
- Object.assign(sink, buildSelectionForField$E(source, reader, selectionNode, variables));
32312
- }
32313
- return sink;
32046
+ function buildSelectionForNode$F(source, reader, parentNode, selectionNode, variables, fragments) {
32047
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$F, buildSelectionForField$F);
32314
32048
  }
32315
32049
  function select$O(field, variables, fragments) {
32316
32050
  return (source, reader) => {
32317
32051
  var _a;
32318
32052
  const sink = {};
32319
32053
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
32320
- const builtSelection = buildSelectionForNode$E(source, reader, field, sel, variables, fragments);
32054
+ const builtSelection = buildSelectionForNode$F(source, reader, field, sel, variables, fragments);
32321
32055
  if (builtSelection !== undefined) {
32322
32056
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
32323
32057
  Object.keys(builtSelection).forEach((key, value) => {
@@ -32547,79 +32281,18 @@
32547
32281
  }
32548
32282
  return sink;
32549
32283
  }
32550
- function buildSelectionForField$D(source, reader, sel, variables, fragments) {
32551
- const sink = {};
32552
- const fieldData = getFieldData$D(source, sel, variables);
32553
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
32554
- reader.enterPath(requestedFieldName);
32555
- if (fieldData === undefined) {
32556
- reader.markMissing();
32557
- reader.exitPath();
32558
- return;
32559
- }
32560
- if (fieldData === null) {
32561
- reader.assignScalar(requestedFieldName, sink, fieldData);
32562
- return sink;
32563
- }
32564
- const fieldType = getFieldType$Z(sel);
32565
- if (fieldType === undefined) {
32566
- // This field's type is unknown to us. This breaks normalization.
32567
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
32568
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
32569
- }
32570
- else if (fieldType.isArray) {
32571
- const arraySink = [];
32572
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
32573
- reader.enterPath(i);
32574
- selectType$E(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
32575
- reader.exitPath();
32576
- }
32577
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
32578
- }
32579
- else {
32580
- selectType$E(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
32581
- }
32582
- reader.exitPath();
32583
- return sink;
32284
+ function buildSelectionForField$E(source, reader, sel, variables, fragments) {
32285
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$D, getFieldType$Z, selectType$E);
32584
32286
  }
32585
- function buildSelectionForNode$D(source, reader, parentNode, selectionNode, variables, fragments) {
32586
- const sink = {};
32587
- if (selectionNode.directives) {
32588
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
32589
- if (selectionWithDirectives === undefined) {
32590
- return;
32591
- }
32592
- selectionNode = selectionWithDirectives;
32593
- }
32594
- if (selectionNode.kind === "InlineFragment") {
32595
- if (isFragmentApplicable$E(selectionNode, source.data.__typename)) {
32596
- // Get selections out of the inline fragment
32597
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
32598
- // Call into field handling with selections
32599
- Object.assign(sink, buildSelectionForNode$D(source, reader, parentNode, fragmentSelection, variables, fragments));
32600
- });
32601
- }
32602
- }
32603
- if (selectionNode.kind === "FragmentSpread") {
32604
- const namedFragment = fragments[selectionNode.name.value];
32605
- if (namedFragment && isFragmentApplicable$E(namedFragment, source.data.__typename)) {
32606
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
32607
- // Call into field handling with selections
32608
- Object.assign(sink, buildSelectionForNode$D(source, reader, parentNode, fragmentSelection, variables, fragments));
32609
- });
32610
- }
32611
- }
32612
- if (selectionNode.kind === "Field") {
32613
- Object.assign(sink, buildSelectionForField$D(source, reader, selectionNode, variables));
32614
- }
32615
- return sink;
32287
+ function buildSelectionForNode$E(source, reader, parentNode, selectionNode, variables, fragments) {
32288
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$E, buildSelectionForField$E);
32616
32289
  }
32617
32290
  function select$N(field, variables, fragments) {
32618
32291
  return (source, reader) => {
32619
32292
  var _a;
32620
32293
  const sink = {};
32621
32294
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
32622
- const builtSelection = buildSelectionForNode$D(source, reader, field, sel, variables, fragments);
32295
+ const builtSelection = buildSelectionForNode$E(source, reader, field, sel, variables, fragments);
32623
32296
  if (builtSelection !== undefined) {
32624
32297
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
32625
32298
  Object.keys(builtSelection).forEach((key, value) => {
@@ -32763,79 +32436,18 @@
32763
32436
  }
32764
32437
  return sink;
32765
32438
  }
32766
- function buildSelectionForField$C(source, reader, sel, variables, fragments) {
32767
- const sink = {};
32768
- const fieldData = getFieldData$C(source, sel, variables);
32769
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
32770
- reader.enterPath(requestedFieldName);
32771
- if (fieldData === undefined) {
32772
- reader.markMissing();
32773
- reader.exitPath();
32774
- return;
32775
- }
32776
- if (fieldData === null) {
32777
- reader.assignScalar(requestedFieldName, sink, fieldData);
32778
- return sink;
32779
- }
32780
- const fieldType = getFieldType$Y(sel);
32781
- if (fieldType === undefined) {
32782
- // This field's type is unknown to us. This breaks normalization.
32783
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
32784
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
32785
- }
32786
- else if (fieldType.isArray) {
32787
- const arraySink = [];
32788
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
32789
- reader.enterPath(i);
32790
- selectType$D(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
32791
- reader.exitPath();
32792
- }
32793
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
32794
- }
32795
- else {
32796
- selectType$D(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
32797
- }
32798
- reader.exitPath();
32799
- return sink;
32439
+ function buildSelectionForField$D(source, reader, sel, variables, fragments) {
32440
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$C, getFieldType$Y, selectType$D);
32800
32441
  }
32801
- function buildSelectionForNode$C(source, reader, parentNode, selectionNode, variables, fragments) {
32802
- const sink = {};
32803
- if (selectionNode.directives) {
32804
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
32805
- if (selectionWithDirectives === undefined) {
32806
- return;
32807
- }
32808
- selectionNode = selectionWithDirectives;
32809
- }
32810
- if (selectionNode.kind === "InlineFragment") {
32811
- if (isFragmentApplicable$D(selectionNode, source.data.__typename)) {
32812
- // Get selections out of the inline fragment
32813
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
32814
- // Call into field handling with selections
32815
- Object.assign(sink, buildSelectionForNode$C(source, reader, parentNode, fragmentSelection, variables, fragments));
32816
- });
32817
- }
32818
- }
32819
- if (selectionNode.kind === "FragmentSpread") {
32820
- const namedFragment = fragments[selectionNode.name.value];
32821
- if (namedFragment && isFragmentApplicable$D(namedFragment, source.data.__typename)) {
32822
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
32823
- // Call into field handling with selections
32824
- Object.assign(sink, buildSelectionForNode$C(source, reader, parentNode, fragmentSelection, variables, fragments));
32825
- });
32826
- }
32827
- }
32828
- if (selectionNode.kind === "Field") {
32829
- Object.assign(sink, buildSelectionForField$C(source, reader, selectionNode, variables));
32830
- }
32831
- return sink;
32442
+ function buildSelectionForNode$D(source, reader, parentNode, selectionNode, variables, fragments) {
32443
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$D, buildSelectionForField$D);
32832
32444
  }
32833
32445
  function select$M(field, variables, fragments) {
32834
32446
  return (source, reader) => {
32835
32447
  var _a;
32836
32448
  const sink = {};
32837
32449
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
32838
- const builtSelection = buildSelectionForNode$C(source, reader, field, sel, variables, fragments);
32450
+ const builtSelection = buildSelectionForNode$D(source, reader, field, sel, variables, fragments);
32839
32451
  if (builtSelection !== undefined) {
32840
32452
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
32841
32453
  Object.keys(builtSelection).forEach((key, value) => {
@@ -33055,79 +32667,18 @@
33055
32667
  }
33056
32668
  return sink;
33057
32669
  }
33058
- function buildSelectionForField$B(source, reader, sel, variables, fragments) {
33059
- const sink = {};
33060
- const fieldData = getFieldData$B(source, sel, variables);
33061
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
33062
- reader.enterPath(requestedFieldName);
33063
- if (fieldData === undefined) {
33064
- reader.markMissing();
33065
- reader.exitPath();
33066
- return;
33067
- }
33068
- if (fieldData === null) {
33069
- reader.assignScalar(requestedFieldName, sink, fieldData);
33070
- return sink;
33071
- }
33072
- const fieldType = getFieldType$W(sel);
33073
- if (fieldType === undefined) {
33074
- // This field's type is unknown to us. This breaks normalization.
33075
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
33076
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
33077
- }
33078
- else if (fieldType.isArray) {
33079
- const arraySink = [];
33080
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
33081
- reader.enterPath(i);
33082
- selectType$C(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
33083
- reader.exitPath();
33084
- }
33085
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
33086
- }
33087
- else {
33088
- selectType$C(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
33089
- }
33090
- reader.exitPath();
33091
- return sink;
32670
+ function buildSelectionForField$C(source, reader, sel, variables, fragments) {
32671
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$B, getFieldType$W, selectType$C);
33092
32672
  }
33093
- function buildSelectionForNode$B(source, reader, parentNode, selectionNode, variables, fragments) {
33094
- const sink = {};
33095
- if (selectionNode.directives) {
33096
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
33097
- if (selectionWithDirectives === undefined) {
33098
- return;
33099
- }
33100
- selectionNode = selectionWithDirectives;
33101
- }
33102
- if (selectionNode.kind === "InlineFragment") {
33103
- if (isFragmentApplicable$C(selectionNode, source.data.__typename)) {
33104
- // Get selections out of the inline fragment
33105
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
33106
- // Call into field handling with selections
33107
- Object.assign(sink, buildSelectionForNode$B(source, reader, parentNode, fragmentSelection, variables, fragments));
33108
- });
33109
- }
33110
- }
33111
- if (selectionNode.kind === "FragmentSpread") {
33112
- const namedFragment = fragments[selectionNode.name.value];
33113
- if (namedFragment && isFragmentApplicable$C(namedFragment, source.data.__typename)) {
33114
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
33115
- // Call into field handling with selections
33116
- Object.assign(sink, buildSelectionForNode$B(source, reader, parentNode, fragmentSelection, variables, fragments));
33117
- });
33118
- }
33119
- }
33120
- if (selectionNode.kind === "Field") {
33121
- Object.assign(sink, buildSelectionForField$B(source, reader, selectionNode, variables));
33122
- }
33123
- return sink;
32673
+ function buildSelectionForNode$C(source, reader, parentNode, selectionNode, variables, fragments) {
32674
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$C, buildSelectionForField$C);
33124
32675
  }
33125
32676
  function select$L(field, variables, fragments) {
33126
32677
  return (source, reader) => {
33127
32678
  var _a;
33128
32679
  const sink = {};
33129
32680
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
33130
- const builtSelection = buildSelectionForNode$B(source, reader, field, sel, variables, fragments);
32681
+ const builtSelection = buildSelectionForNode$C(source, reader, field, sel, variables, fragments);
33131
32682
  if (builtSelection !== undefined) {
33132
32683
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
33133
32684
  Object.keys(builtSelection).forEach((key, value) => {
@@ -33269,79 +32820,18 @@
33269
32820
  }
33270
32821
  return sink;
33271
32822
  }
33272
- function buildSelectionForField$A(source, reader, sel, variables, fragments) {
33273
- const sink = {};
33274
- const fieldData = getFieldData$A(source, sel, variables);
33275
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
33276
- reader.enterPath(requestedFieldName);
33277
- if (fieldData === undefined) {
33278
- reader.markMissing();
33279
- reader.exitPath();
33280
- return;
33281
- }
33282
- if (fieldData === null) {
33283
- reader.assignScalar(requestedFieldName, sink, fieldData);
33284
- return sink;
33285
- }
33286
- const fieldType = getFieldType$V(sel);
33287
- if (fieldType === undefined) {
33288
- // This field's type is unknown to us. This breaks normalization.
33289
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
33290
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
33291
- }
33292
- else if (fieldType.isArray) {
33293
- const arraySink = [];
33294
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
33295
- reader.enterPath(i);
33296
- selectType$B(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
33297
- reader.exitPath();
33298
- }
33299
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
33300
- }
33301
- else {
33302
- selectType$B(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
33303
- }
33304
- reader.exitPath();
33305
- return sink;
32823
+ function buildSelectionForField$B(source, reader, sel, variables, fragments) {
32824
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$A, getFieldType$V, selectType$B);
33306
32825
  }
33307
- function buildSelectionForNode$A(source, reader, parentNode, selectionNode, variables, fragments) {
33308
- const sink = {};
33309
- if (selectionNode.directives) {
33310
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
33311
- if (selectionWithDirectives === undefined) {
33312
- return;
33313
- }
33314
- selectionNode = selectionWithDirectives;
33315
- }
33316
- if (selectionNode.kind === "InlineFragment") {
33317
- if (isFragmentApplicable$B(selectionNode, source.data.__typename)) {
33318
- // Get selections out of the inline fragment
33319
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
33320
- // Call into field handling with selections
33321
- Object.assign(sink, buildSelectionForNode$A(source, reader, parentNode, fragmentSelection, variables, fragments));
33322
- });
33323
- }
33324
- }
33325
- if (selectionNode.kind === "FragmentSpread") {
33326
- const namedFragment = fragments[selectionNode.name.value];
33327
- if (namedFragment && isFragmentApplicable$B(namedFragment, source.data.__typename)) {
33328
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
33329
- // Call into field handling with selections
33330
- Object.assign(sink, buildSelectionForNode$A(source, reader, parentNode, fragmentSelection, variables, fragments));
33331
- });
33332
- }
33333
- }
33334
- if (selectionNode.kind === "Field") {
33335
- Object.assign(sink, buildSelectionForField$A(source, reader, selectionNode, variables));
33336
- }
33337
- return sink;
32826
+ function buildSelectionForNode$B(source, reader, parentNode, selectionNode, variables, fragments) {
32827
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$B, buildSelectionForField$B);
33338
32828
  }
33339
32829
  function select$K(field, variables, fragments) {
33340
32830
  return (source, reader) => {
33341
32831
  var _a;
33342
32832
  const sink = {};
33343
32833
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
33344
- const builtSelection = buildSelectionForNode$A(source, reader, field, sel, variables, fragments);
32834
+ const builtSelection = buildSelectionForNode$B(source, reader, field, sel, variables, fragments);
33345
32835
  if (builtSelection !== undefined) {
33346
32836
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
33347
32837
  Object.keys(builtSelection).forEach((key, value) => {
@@ -33489,79 +32979,18 @@
33489
32979
  }
33490
32980
  return sink;
33491
32981
  }
33492
- function buildSelectionForField$z(source, reader, sel, variables, fragments) {
33493
- const sink = {};
33494
- const fieldData = getFieldData$z(source, sel, variables);
33495
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
33496
- reader.enterPath(requestedFieldName);
33497
- if (fieldData === undefined) {
33498
- reader.markMissing();
33499
- reader.exitPath();
33500
- return;
33501
- }
33502
- if (fieldData === null) {
33503
- reader.assignScalar(requestedFieldName, sink, fieldData);
33504
- return sink;
33505
- }
33506
- const fieldType = getFieldType$U(sel);
33507
- if (fieldType === undefined) {
33508
- // This field's type is unknown to us. This breaks normalization.
33509
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
33510
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
33511
- }
33512
- else if (fieldType.isArray) {
33513
- const arraySink = [];
33514
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
33515
- reader.enterPath(i);
33516
- selectType$A(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
33517
- reader.exitPath();
33518
- }
33519
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
33520
- }
33521
- else {
33522
- selectType$A(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
33523
- }
33524
- reader.exitPath();
33525
- return sink;
32982
+ function buildSelectionForField$A(source, reader, sel, variables, fragments) {
32983
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$z, getFieldType$U, selectType$A);
33526
32984
  }
33527
- function buildSelectionForNode$z(source, reader, parentNode, selectionNode, variables, fragments) {
33528
- const sink = {};
33529
- if (selectionNode.directives) {
33530
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
33531
- if (selectionWithDirectives === undefined) {
33532
- return;
33533
- }
33534
- selectionNode = selectionWithDirectives;
33535
- }
33536
- if (selectionNode.kind === "InlineFragment") {
33537
- if (isFragmentApplicable$A(selectionNode, source.data.__typename)) {
33538
- // Get selections out of the inline fragment
33539
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
33540
- // Call into field handling with selections
33541
- Object.assign(sink, buildSelectionForNode$z(source, reader, parentNode, fragmentSelection, variables, fragments));
33542
- });
33543
- }
33544
- }
33545
- if (selectionNode.kind === "FragmentSpread") {
33546
- const namedFragment = fragments[selectionNode.name.value];
33547
- if (namedFragment && isFragmentApplicable$A(namedFragment, source.data.__typename)) {
33548
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
33549
- // Call into field handling with selections
33550
- Object.assign(sink, buildSelectionForNode$z(source, reader, parentNode, fragmentSelection, variables, fragments));
33551
- });
33552
- }
33553
- }
33554
- if (selectionNode.kind === "Field") {
33555
- Object.assign(sink, buildSelectionForField$z(source, reader, selectionNode, variables));
33556
- }
33557
- return sink;
32985
+ function buildSelectionForNode$A(source, reader, parentNode, selectionNode, variables, fragments) {
32986
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$A, buildSelectionForField$A);
33558
32987
  }
33559
32988
  function select$J(field, variables, fragments) {
33560
32989
  return (source, reader) => {
33561
32990
  var _a;
33562
32991
  const sink = {};
33563
32992
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
33564
- const builtSelection = buildSelectionForNode$z(source, reader, field, sel, variables, fragments);
32993
+ const builtSelection = buildSelectionForNode$A(source, reader, field, sel, variables, fragments);
33565
32994
  if (builtSelection !== undefined) {
33566
32995
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
33567
32996
  Object.keys(builtSelection).forEach((key, value) => {
@@ -33703,79 +33132,18 @@
33703
33132
  }
33704
33133
  return sink;
33705
33134
  }
33706
- function buildSelectionForField$y(source, reader, sel, variables, fragments) {
33707
- const sink = {};
33708
- const fieldData = getFieldData$y(source, sel, variables);
33709
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
33710
- reader.enterPath(requestedFieldName);
33711
- if (fieldData === undefined) {
33712
- reader.markMissing();
33713
- reader.exitPath();
33714
- return;
33715
- }
33716
- if (fieldData === null) {
33717
- reader.assignScalar(requestedFieldName, sink, fieldData);
33718
- return sink;
33719
- }
33720
- const fieldType = getFieldType$T(sel);
33721
- if (fieldType === undefined) {
33722
- // This field's type is unknown to us. This breaks normalization.
33723
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
33724
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
33725
- }
33726
- else if (fieldType.isArray) {
33727
- const arraySink = [];
33728
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
33729
- reader.enterPath(i);
33730
- selectType$z(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
33731
- reader.exitPath();
33732
- }
33733
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
33734
- }
33735
- else {
33736
- selectType$z(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
33737
- }
33738
- reader.exitPath();
33739
- return sink;
33135
+ function buildSelectionForField$z(source, reader, sel, variables, fragments) {
33136
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$y, getFieldType$T, selectType$z);
33740
33137
  }
33741
- function buildSelectionForNode$y(source, reader, parentNode, selectionNode, variables, fragments) {
33742
- const sink = {};
33743
- if (selectionNode.directives) {
33744
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
33745
- if (selectionWithDirectives === undefined) {
33746
- return;
33747
- }
33748
- selectionNode = selectionWithDirectives;
33749
- }
33750
- if (selectionNode.kind === "InlineFragment") {
33751
- if (isFragmentApplicable$z(selectionNode, source.data.__typename)) {
33752
- // Get selections out of the inline fragment
33753
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
33754
- // Call into field handling with selections
33755
- Object.assign(sink, buildSelectionForNode$y(source, reader, parentNode, fragmentSelection, variables, fragments));
33756
- });
33757
- }
33758
- }
33759
- if (selectionNode.kind === "FragmentSpread") {
33760
- const namedFragment = fragments[selectionNode.name.value];
33761
- if (namedFragment && isFragmentApplicable$z(namedFragment, source.data.__typename)) {
33762
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
33763
- // Call into field handling with selections
33764
- Object.assign(sink, buildSelectionForNode$y(source, reader, parentNode, fragmentSelection, variables, fragments));
33765
- });
33766
- }
33767
- }
33768
- if (selectionNode.kind === "Field") {
33769
- Object.assign(sink, buildSelectionForField$y(source, reader, selectionNode, variables));
33770
- }
33771
- return sink;
33138
+ function buildSelectionForNode$z(source, reader, parentNode, selectionNode, variables, fragments) {
33139
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$z, buildSelectionForField$z);
33772
33140
  }
33773
33141
  function select$I(field, variables, fragments) {
33774
33142
  return (source, reader) => {
33775
33143
  var _a;
33776
33144
  const sink = {};
33777
33145
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
33778
- const builtSelection = buildSelectionForNode$y(source, reader, field, sel, variables, fragments);
33146
+ const builtSelection = buildSelectionForNode$z(source, reader, field, sel, variables, fragments);
33779
33147
  if (builtSelection !== undefined) {
33780
33148
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
33781
33149
  Object.keys(builtSelection).forEach((key, value) => {
@@ -33923,79 +33291,18 @@
33923
33291
  }
33924
33292
  return sink;
33925
33293
  }
33926
- function buildSelectionForField$x(source, reader, sel, variables, fragments) {
33927
- const sink = {};
33928
- const fieldData = getFieldData$x(source, sel, variables);
33929
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
33930
- reader.enterPath(requestedFieldName);
33931
- if (fieldData === undefined) {
33932
- reader.markMissing();
33933
- reader.exitPath();
33934
- return;
33935
- }
33936
- if (fieldData === null) {
33937
- reader.assignScalar(requestedFieldName, sink, fieldData);
33938
- return sink;
33939
- }
33940
- const fieldType = getFieldType$S(sel);
33941
- if (fieldType === undefined) {
33942
- // This field's type is unknown to us. This breaks normalization.
33943
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
33944
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
33945
- }
33946
- else if (fieldType.isArray) {
33947
- const arraySink = [];
33948
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
33949
- reader.enterPath(i);
33950
- selectType$y(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
33951
- reader.exitPath();
33952
- }
33953
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
33954
- }
33955
- else {
33956
- selectType$y(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
33957
- }
33958
- reader.exitPath();
33959
- return sink;
33294
+ function buildSelectionForField$y(source, reader, sel, variables, fragments) {
33295
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$x, getFieldType$S, selectType$y);
33960
33296
  }
33961
- function buildSelectionForNode$x(source, reader, parentNode, selectionNode, variables, fragments) {
33962
- const sink = {};
33963
- if (selectionNode.directives) {
33964
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
33965
- if (selectionWithDirectives === undefined) {
33966
- return;
33967
- }
33968
- selectionNode = selectionWithDirectives;
33969
- }
33970
- if (selectionNode.kind === "InlineFragment") {
33971
- if (isFragmentApplicable$y(selectionNode, source.data.__typename)) {
33972
- // Get selections out of the inline fragment
33973
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
33974
- // Call into field handling with selections
33975
- Object.assign(sink, buildSelectionForNode$x(source, reader, parentNode, fragmentSelection, variables, fragments));
33976
- });
33977
- }
33978
- }
33979
- if (selectionNode.kind === "FragmentSpread") {
33980
- const namedFragment = fragments[selectionNode.name.value];
33981
- if (namedFragment && isFragmentApplicable$y(namedFragment, source.data.__typename)) {
33982
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
33983
- // Call into field handling with selections
33984
- Object.assign(sink, buildSelectionForNode$x(source, reader, parentNode, fragmentSelection, variables, fragments));
33985
- });
33986
- }
33987
- }
33988
- if (selectionNode.kind === "Field") {
33989
- Object.assign(sink, buildSelectionForField$x(source, reader, selectionNode, variables));
33990
- }
33991
- return sink;
33297
+ function buildSelectionForNode$y(source, reader, parentNode, selectionNode, variables, fragments) {
33298
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$y, buildSelectionForField$y);
33992
33299
  }
33993
33300
  function select$H(field, variables, fragments) {
33994
33301
  return (source, reader) => {
33995
33302
  var _a;
33996
33303
  const sink = {};
33997
33304
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
33998
- const builtSelection = buildSelectionForNode$x(source, reader, field, sel, variables, fragments);
33305
+ const builtSelection = buildSelectionForNode$y(source, reader, field, sel, variables, fragments);
33999
33306
  if (builtSelection !== undefined) {
34000
33307
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
34001
33308
  Object.keys(builtSelection).forEach((key, value) => {
@@ -34143,79 +33450,18 @@
34143
33450
  }
34144
33451
  return sink;
34145
33452
  }
34146
- function buildSelectionForField$w(source, reader, sel, variables, fragments) {
34147
- const sink = {};
34148
- const fieldData = getFieldData$w(source, sel, variables);
34149
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
34150
- reader.enterPath(requestedFieldName);
34151
- if (fieldData === undefined) {
34152
- reader.markMissing();
34153
- reader.exitPath();
34154
- return;
34155
- }
34156
- if (fieldData === null) {
34157
- reader.assignScalar(requestedFieldName, sink, fieldData);
34158
- return sink;
34159
- }
34160
- const fieldType = getFieldType$R(sel);
34161
- if (fieldType === undefined) {
34162
- // This field's type is unknown to us. This breaks normalization.
34163
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
34164
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
34165
- }
34166
- else if (fieldType.isArray) {
34167
- const arraySink = [];
34168
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
34169
- reader.enterPath(i);
34170
- selectType$x(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
34171
- reader.exitPath();
34172
- }
34173
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
34174
- }
34175
- else {
34176
- selectType$x(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
34177
- }
34178
- reader.exitPath();
34179
- return sink;
33453
+ function buildSelectionForField$x(source, reader, sel, variables, fragments) {
33454
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$w, getFieldType$R, selectType$x);
34180
33455
  }
34181
- function buildSelectionForNode$w(source, reader, parentNode, selectionNode, variables, fragments) {
34182
- const sink = {};
34183
- if (selectionNode.directives) {
34184
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
34185
- if (selectionWithDirectives === undefined) {
34186
- return;
34187
- }
34188
- selectionNode = selectionWithDirectives;
34189
- }
34190
- if (selectionNode.kind === "InlineFragment") {
34191
- if (isFragmentApplicable$x(selectionNode, source.data.__typename)) {
34192
- // Get selections out of the inline fragment
34193
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
34194
- // Call into field handling with selections
34195
- Object.assign(sink, buildSelectionForNode$w(source, reader, parentNode, fragmentSelection, variables, fragments));
34196
- });
34197
- }
34198
- }
34199
- if (selectionNode.kind === "FragmentSpread") {
34200
- const namedFragment = fragments[selectionNode.name.value];
34201
- if (namedFragment && isFragmentApplicable$x(namedFragment, source.data.__typename)) {
34202
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
34203
- // Call into field handling with selections
34204
- Object.assign(sink, buildSelectionForNode$w(source, reader, parentNode, fragmentSelection, variables, fragments));
34205
- });
34206
- }
34207
- }
34208
- if (selectionNode.kind === "Field") {
34209
- Object.assign(sink, buildSelectionForField$w(source, reader, selectionNode, variables));
34210
- }
34211
- return sink;
33456
+ function buildSelectionForNode$x(source, reader, parentNode, selectionNode, variables, fragments) {
33457
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$x, buildSelectionForField$x);
34212
33458
  }
34213
33459
  function select$G(field, variables, fragments) {
34214
33460
  return (source, reader) => {
34215
33461
  var _a;
34216
33462
  const sink = {};
34217
33463
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
34218
- const builtSelection = buildSelectionForNode$w(source, reader, field, sel, variables, fragments);
33464
+ const builtSelection = buildSelectionForNode$x(source, reader, field, sel, variables, fragments);
34219
33465
  if (builtSelection !== undefined) {
34220
33466
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
34221
33467
  Object.keys(builtSelection).forEach((key, value) => {
@@ -34357,79 +33603,18 @@
34357
33603
  }
34358
33604
  return sink;
34359
33605
  }
34360
- function buildSelectionForField$v(source, reader, sel, variables, fragments) {
34361
- const sink = {};
34362
- const fieldData = getFieldData$v(source, sel, variables);
34363
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
34364
- reader.enterPath(requestedFieldName);
34365
- if (fieldData === undefined) {
34366
- reader.markMissing();
34367
- reader.exitPath();
34368
- return;
34369
- }
34370
- if (fieldData === null) {
34371
- reader.assignScalar(requestedFieldName, sink, fieldData);
34372
- return sink;
34373
- }
34374
- const fieldType = getFieldType$Q(sel);
34375
- if (fieldType === undefined) {
34376
- // This field's type is unknown to us. This breaks normalization.
34377
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
34378
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
34379
- }
34380
- else if (fieldType.isArray) {
34381
- const arraySink = [];
34382
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
34383
- reader.enterPath(i);
34384
- selectType$w(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
34385
- reader.exitPath();
34386
- }
34387
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
34388
- }
34389
- else {
34390
- selectType$w(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
34391
- }
34392
- reader.exitPath();
34393
- return sink;
33606
+ function buildSelectionForField$w(source, reader, sel, variables, fragments) {
33607
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$v, getFieldType$Q, selectType$w);
34394
33608
  }
34395
- function buildSelectionForNode$v(source, reader, parentNode, selectionNode, variables, fragments) {
34396
- const sink = {};
34397
- if (selectionNode.directives) {
34398
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
34399
- if (selectionWithDirectives === undefined) {
34400
- return;
34401
- }
34402
- selectionNode = selectionWithDirectives;
34403
- }
34404
- if (selectionNode.kind === "InlineFragment") {
34405
- if (isFragmentApplicable$w(selectionNode, source.data.__typename)) {
34406
- // Get selections out of the inline fragment
34407
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
34408
- // Call into field handling with selections
34409
- Object.assign(sink, buildSelectionForNode$v(source, reader, parentNode, fragmentSelection, variables, fragments));
34410
- });
34411
- }
34412
- }
34413
- if (selectionNode.kind === "FragmentSpread") {
34414
- const namedFragment = fragments[selectionNode.name.value];
34415
- if (namedFragment && isFragmentApplicable$w(namedFragment, source.data.__typename)) {
34416
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
34417
- // Call into field handling with selections
34418
- Object.assign(sink, buildSelectionForNode$v(source, reader, parentNode, fragmentSelection, variables, fragments));
34419
- });
34420
- }
34421
- }
34422
- if (selectionNode.kind === "Field") {
34423
- Object.assign(sink, buildSelectionForField$v(source, reader, selectionNode, variables));
34424
- }
34425
- return sink;
33609
+ function buildSelectionForNode$w(source, reader, parentNode, selectionNode, variables, fragments) {
33610
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$w, buildSelectionForField$w);
34426
33611
  }
34427
33612
  function select$F(field, variables, fragments) {
34428
33613
  return (source, reader) => {
34429
33614
  var _a;
34430
33615
  const sink = {};
34431
33616
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
34432
- const builtSelection = buildSelectionForNode$v(source, reader, field, sel, variables, fragments);
33617
+ const builtSelection = buildSelectionForNode$w(source, reader, field, sel, variables, fragments);
34433
33618
  if (builtSelection !== undefined) {
34434
33619
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
34435
33620
  Object.keys(builtSelection).forEach((key, value) => {
@@ -34571,79 +33756,18 @@
34571
33756
  }
34572
33757
  return sink;
34573
33758
  }
34574
- function buildSelectionForField$u(source, reader, sel, variables, fragments) {
34575
- const sink = {};
34576
- const fieldData = getFieldData$u(source, sel, variables);
34577
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
34578
- reader.enterPath(requestedFieldName);
34579
- if (fieldData === undefined) {
34580
- reader.markMissing();
34581
- reader.exitPath();
34582
- return;
34583
- }
34584
- if (fieldData === null) {
34585
- reader.assignScalar(requestedFieldName, sink, fieldData);
34586
- return sink;
34587
- }
34588
- const fieldType = getFieldType$P(sel);
34589
- if (fieldType === undefined) {
34590
- // This field's type is unknown to us. This breaks normalization.
34591
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
34592
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
34593
- }
34594
- else if (fieldType.isArray) {
34595
- const arraySink = [];
34596
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
34597
- reader.enterPath(i);
34598
- selectType$v(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
34599
- reader.exitPath();
34600
- }
34601
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
34602
- }
34603
- else {
34604
- selectType$v(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
34605
- }
34606
- reader.exitPath();
34607
- return sink;
33759
+ function buildSelectionForField$v(source, reader, sel, variables, fragments) {
33760
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$u, getFieldType$P, selectType$v);
34608
33761
  }
34609
- function buildSelectionForNode$u(source, reader, parentNode, selectionNode, variables, fragments) {
34610
- const sink = {};
34611
- if (selectionNode.directives) {
34612
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
34613
- if (selectionWithDirectives === undefined) {
34614
- return;
34615
- }
34616
- selectionNode = selectionWithDirectives;
34617
- }
34618
- if (selectionNode.kind === "InlineFragment") {
34619
- if (isFragmentApplicable$v(selectionNode, source.data.__typename)) {
34620
- // Get selections out of the inline fragment
34621
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
34622
- // Call into field handling with selections
34623
- Object.assign(sink, buildSelectionForNode$u(source, reader, parentNode, fragmentSelection, variables, fragments));
34624
- });
34625
- }
34626
- }
34627
- if (selectionNode.kind === "FragmentSpread") {
34628
- const namedFragment = fragments[selectionNode.name.value];
34629
- if (namedFragment && isFragmentApplicable$v(namedFragment, source.data.__typename)) {
34630
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
34631
- // Call into field handling with selections
34632
- Object.assign(sink, buildSelectionForNode$u(source, reader, parentNode, fragmentSelection, variables, fragments));
34633
- });
34634
- }
34635
- }
34636
- if (selectionNode.kind === "Field") {
34637
- Object.assign(sink, buildSelectionForField$u(source, reader, selectionNode, variables));
34638
- }
34639
- return sink;
33762
+ function buildSelectionForNode$v(source, reader, parentNode, selectionNode, variables, fragments) {
33763
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$v, buildSelectionForField$v);
34640
33764
  }
34641
33765
  function select$E(field, variables, fragments) {
34642
33766
  return (source, reader) => {
34643
33767
  var _a;
34644
33768
  const sink = {};
34645
33769
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
34646
- const builtSelection = buildSelectionForNode$u(source, reader, field, sel, variables, fragments);
33770
+ const builtSelection = buildSelectionForNode$v(source, reader, field, sel, variables, fragments);
34647
33771
  if (builtSelection !== undefined) {
34648
33772
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
34649
33773
  Object.keys(builtSelection).forEach((key, value) => {
@@ -34785,79 +33909,18 @@
34785
33909
  }
34786
33910
  return sink;
34787
33911
  }
34788
- function buildSelectionForField$t(source, reader, sel, variables, fragments) {
34789
- const sink = {};
34790
- const fieldData = getFieldData$t(source, sel, variables);
34791
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
34792
- reader.enterPath(requestedFieldName);
34793
- if (fieldData === undefined) {
34794
- reader.markMissing();
34795
- reader.exitPath();
34796
- return;
34797
- }
34798
- if (fieldData === null) {
34799
- reader.assignScalar(requestedFieldName, sink, fieldData);
34800
- return sink;
34801
- }
34802
- const fieldType = getFieldType$O(sel);
34803
- if (fieldType === undefined) {
34804
- // This field's type is unknown to us. This breaks normalization.
34805
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
34806
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
34807
- }
34808
- else if (fieldType.isArray) {
34809
- const arraySink = [];
34810
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
34811
- reader.enterPath(i);
34812
- selectType$u(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
34813
- reader.exitPath();
34814
- }
34815
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
34816
- }
34817
- else {
34818
- selectType$u(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
34819
- }
34820
- reader.exitPath();
34821
- return sink;
33912
+ function buildSelectionForField$u(source, reader, sel, variables, fragments) {
33913
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$t, getFieldType$O, selectType$u);
34822
33914
  }
34823
- function buildSelectionForNode$t(source, reader, parentNode, selectionNode, variables, fragments) {
34824
- const sink = {};
34825
- if (selectionNode.directives) {
34826
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
34827
- if (selectionWithDirectives === undefined) {
34828
- return;
34829
- }
34830
- selectionNode = selectionWithDirectives;
34831
- }
34832
- if (selectionNode.kind === "InlineFragment") {
34833
- if (isFragmentApplicable$u(selectionNode, source.data.__typename)) {
34834
- // Get selections out of the inline fragment
34835
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
34836
- // Call into field handling with selections
34837
- Object.assign(sink, buildSelectionForNode$t(source, reader, parentNode, fragmentSelection, variables, fragments));
34838
- });
34839
- }
34840
- }
34841
- if (selectionNode.kind === "FragmentSpread") {
34842
- const namedFragment = fragments[selectionNode.name.value];
34843
- if (namedFragment && isFragmentApplicable$u(namedFragment, source.data.__typename)) {
34844
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
34845
- // Call into field handling with selections
34846
- Object.assign(sink, buildSelectionForNode$t(source, reader, parentNode, fragmentSelection, variables, fragments));
34847
- });
34848
- }
34849
- }
34850
- if (selectionNode.kind === "Field") {
34851
- Object.assign(sink, buildSelectionForField$t(source, reader, selectionNode, variables));
34852
- }
34853
- return sink;
33915
+ function buildSelectionForNode$u(source, reader, parentNode, selectionNode, variables, fragments) {
33916
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$u, buildSelectionForField$u);
34854
33917
  }
34855
33918
  function select$D(field, variables, fragments) {
34856
33919
  return (source, reader) => {
34857
33920
  var _a;
34858
33921
  const sink = {};
34859
33922
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
34860
- const builtSelection = buildSelectionForNode$t(source, reader, field, sel, variables, fragments);
33923
+ const builtSelection = buildSelectionForNode$u(source, reader, field, sel, variables, fragments);
34861
33924
  if (builtSelection !== undefined) {
34862
33925
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
34863
33926
  Object.keys(builtSelection).forEach((key, value) => {
@@ -34999,79 +34062,18 @@
34999
34062
  }
35000
34063
  return sink;
35001
34064
  }
35002
- function buildSelectionForField$s(source, reader, sel, variables, fragments) {
35003
- const sink = {};
35004
- const fieldData = getFieldData$s(source, sel, variables);
35005
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
35006
- reader.enterPath(requestedFieldName);
35007
- if (fieldData === undefined) {
35008
- reader.markMissing();
35009
- reader.exitPath();
35010
- return;
35011
- }
35012
- if (fieldData === null) {
35013
- reader.assignScalar(requestedFieldName, sink, fieldData);
35014
- return sink;
35015
- }
35016
- const fieldType = getFieldType$N(sel);
35017
- if (fieldType === undefined) {
35018
- // This field's type is unknown to us. This breaks normalization.
35019
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
35020
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
35021
- }
35022
- else if (fieldType.isArray) {
35023
- const arraySink = [];
35024
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
35025
- reader.enterPath(i);
35026
- selectType$t(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
35027
- reader.exitPath();
35028
- }
35029
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
35030
- }
35031
- else {
35032
- selectType$t(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
35033
- }
35034
- reader.exitPath();
35035
- return sink;
34065
+ function buildSelectionForField$t(source, reader, sel, variables, fragments) {
34066
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$s, getFieldType$N, selectType$t);
35036
34067
  }
35037
- function buildSelectionForNode$s(source, reader, parentNode, selectionNode, variables, fragments) {
35038
- const sink = {};
35039
- if (selectionNode.directives) {
35040
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
35041
- if (selectionWithDirectives === undefined) {
35042
- return;
35043
- }
35044
- selectionNode = selectionWithDirectives;
35045
- }
35046
- if (selectionNode.kind === "InlineFragment") {
35047
- if (isFragmentApplicable$t(selectionNode, source.data.__typename)) {
35048
- // Get selections out of the inline fragment
35049
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
35050
- // Call into field handling with selections
35051
- Object.assign(sink, buildSelectionForNode$s(source, reader, parentNode, fragmentSelection, variables, fragments));
35052
- });
35053
- }
35054
- }
35055
- if (selectionNode.kind === "FragmentSpread") {
35056
- const namedFragment = fragments[selectionNode.name.value];
35057
- if (namedFragment && isFragmentApplicable$t(namedFragment, source.data.__typename)) {
35058
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
35059
- // Call into field handling with selections
35060
- Object.assign(sink, buildSelectionForNode$s(source, reader, parentNode, fragmentSelection, variables, fragments));
35061
- });
35062
- }
35063
- }
35064
- if (selectionNode.kind === "Field") {
35065
- Object.assign(sink, buildSelectionForField$s(source, reader, selectionNode, variables));
35066
- }
35067
- return sink;
34068
+ function buildSelectionForNode$t(source, reader, parentNode, selectionNode, variables, fragments) {
34069
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$t, buildSelectionForField$t);
35068
34070
  }
35069
34071
  function select$C(field, variables, fragments) {
35070
34072
  return (source, reader) => {
35071
34073
  var _a;
35072
34074
  const sink = {};
35073
34075
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
35074
- const builtSelection = buildSelectionForNode$s(source, reader, field, sel, variables, fragments);
34076
+ const builtSelection = buildSelectionForNode$t(source, reader, field, sel, variables, fragments);
35075
34077
  if (builtSelection !== undefined) {
35076
34078
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
35077
34079
  Object.keys(builtSelection).forEach((key, value) => {
@@ -35213,79 +34215,18 @@
35213
34215
  }
35214
34216
  return sink;
35215
34217
  }
35216
- function buildSelectionForField$r(source, reader, sel, variables, fragments) {
35217
- const sink = {};
35218
- const fieldData = getFieldData$r(source, sel, variables);
35219
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
35220
- reader.enterPath(requestedFieldName);
35221
- if (fieldData === undefined) {
35222
- reader.markMissing();
35223
- reader.exitPath();
35224
- return;
35225
- }
35226
- if (fieldData === null) {
35227
- reader.assignScalar(requestedFieldName, sink, fieldData);
35228
- return sink;
35229
- }
35230
- const fieldType = getFieldType$M(sel);
35231
- if (fieldType === undefined) {
35232
- // This field's type is unknown to us. This breaks normalization.
35233
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
35234
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
35235
- }
35236
- else if (fieldType.isArray) {
35237
- const arraySink = [];
35238
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
35239
- reader.enterPath(i);
35240
- selectType$s(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
35241
- reader.exitPath();
35242
- }
35243
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
35244
- }
35245
- else {
35246
- selectType$s(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
35247
- }
35248
- reader.exitPath();
35249
- return sink;
34218
+ function buildSelectionForField$s(source, reader, sel, variables, fragments) {
34219
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$r, getFieldType$M, selectType$s);
35250
34220
  }
35251
- function buildSelectionForNode$r(source, reader, parentNode, selectionNode, variables, fragments) {
35252
- const sink = {};
35253
- if (selectionNode.directives) {
35254
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
35255
- if (selectionWithDirectives === undefined) {
35256
- return;
35257
- }
35258
- selectionNode = selectionWithDirectives;
35259
- }
35260
- if (selectionNode.kind === "InlineFragment") {
35261
- if (isFragmentApplicable$s(selectionNode, source.data.__typename)) {
35262
- // Get selections out of the inline fragment
35263
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
35264
- // Call into field handling with selections
35265
- Object.assign(sink, buildSelectionForNode$r(source, reader, parentNode, fragmentSelection, variables, fragments));
35266
- });
35267
- }
35268
- }
35269
- if (selectionNode.kind === "FragmentSpread") {
35270
- const namedFragment = fragments[selectionNode.name.value];
35271
- if (namedFragment && isFragmentApplicable$s(namedFragment, source.data.__typename)) {
35272
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
35273
- // Call into field handling with selections
35274
- Object.assign(sink, buildSelectionForNode$r(source, reader, parentNode, fragmentSelection, variables, fragments));
35275
- });
35276
- }
35277
- }
35278
- if (selectionNode.kind === "Field") {
35279
- Object.assign(sink, buildSelectionForField$r(source, reader, selectionNode, variables));
35280
- }
35281
- return sink;
34221
+ function buildSelectionForNode$s(source, reader, parentNode, selectionNode, variables, fragments) {
34222
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$s, buildSelectionForField$s);
35282
34223
  }
35283
34224
  function select$B(field, variables, fragments) {
35284
34225
  return (source, reader) => {
35285
34226
  var _a;
35286
34227
  const sink = {};
35287
34228
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
35288
- const builtSelection = buildSelectionForNode$r(source, reader, field, sel, variables, fragments);
34229
+ const builtSelection = buildSelectionForNode$s(source, reader, field, sel, variables, fragments);
35289
34230
  if (builtSelection !== undefined) {
35290
34231
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
35291
34232
  Object.keys(builtSelection).forEach((key, value) => {
@@ -35427,79 +34368,18 @@
35427
34368
  }
35428
34369
  return sink;
35429
34370
  }
35430
- function buildSelectionForField$q(source, reader, sel, variables, fragments) {
35431
- const sink = {};
35432
- const fieldData = getFieldData$q(source, sel, variables);
35433
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
35434
- reader.enterPath(requestedFieldName);
35435
- if (fieldData === undefined) {
35436
- reader.markMissing();
35437
- reader.exitPath();
35438
- return;
35439
- }
35440
- if (fieldData === null) {
35441
- reader.assignScalar(requestedFieldName, sink, fieldData);
35442
- return sink;
35443
- }
35444
- const fieldType = getFieldType$L(sel);
35445
- if (fieldType === undefined) {
35446
- // This field's type is unknown to us. This breaks normalization.
35447
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
35448
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
35449
- }
35450
- else if (fieldType.isArray) {
35451
- const arraySink = [];
35452
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
35453
- reader.enterPath(i);
35454
- selectType$r(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
35455
- reader.exitPath();
35456
- }
35457
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
35458
- }
35459
- else {
35460
- selectType$r(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
35461
- }
35462
- reader.exitPath();
35463
- return sink;
34371
+ function buildSelectionForField$r(source, reader, sel, variables, fragments) {
34372
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$q, getFieldType$L, selectType$r);
35464
34373
  }
35465
- function buildSelectionForNode$q(source, reader, parentNode, selectionNode, variables, fragments) {
35466
- const sink = {};
35467
- if (selectionNode.directives) {
35468
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
35469
- if (selectionWithDirectives === undefined) {
35470
- return;
35471
- }
35472
- selectionNode = selectionWithDirectives;
35473
- }
35474
- if (selectionNode.kind === "InlineFragment") {
35475
- if (isFragmentApplicable$r(selectionNode, source.data.__typename)) {
35476
- // Get selections out of the inline fragment
35477
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
35478
- // Call into field handling with selections
35479
- Object.assign(sink, buildSelectionForNode$q(source, reader, parentNode, fragmentSelection, variables, fragments));
35480
- });
35481
- }
35482
- }
35483
- if (selectionNode.kind === "FragmentSpread") {
35484
- const namedFragment = fragments[selectionNode.name.value];
35485
- if (namedFragment && isFragmentApplicable$r(namedFragment, source.data.__typename)) {
35486
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
35487
- // Call into field handling with selections
35488
- Object.assign(sink, buildSelectionForNode$q(source, reader, parentNode, fragmentSelection, variables, fragments));
35489
- });
35490
- }
35491
- }
35492
- if (selectionNode.kind === "Field") {
35493
- Object.assign(sink, buildSelectionForField$q(source, reader, selectionNode, variables));
35494
- }
35495
- return sink;
34374
+ function buildSelectionForNode$r(source, reader, parentNode, selectionNode, variables, fragments) {
34375
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$r, buildSelectionForField$r);
35496
34376
  }
35497
34377
  function select$A(field, variables, fragments) {
35498
34378
  return (source, reader) => {
35499
34379
  var _a;
35500
34380
  const sink = {};
35501
34381
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
35502
- const builtSelection = buildSelectionForNode$q(source, reader, field, sel, variables, fragments);
34382
+ const builtSelection = buildSelectionForNode$r(source, reader, field, sel, variables, fragments);
35503
34383
  if (builtSelection !== undefined) {
35504
34384
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
35505
34385
  Object.keys(builtSelection).forEach((key, value) => {
@@ -35641,79 +34521,18 @@
35641
34521
  }
35642
34522
  return sink;
35643
34523
  }
35644
- function buildSelectionForField$p(source, reader, sel, variables, fragments) {
35645
- const sink = {};
35646
- const fieldData = getFieldData$p(source, sel, variables);
35647
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
35648
- reader.enterPath(requestedFieldName);
35649
- if (fieldData === undefined) {
35650
- reader.markMissing();
35651
- reader.exitPath();
35652
- return;
35653
- }
35654
- if (fieldData === null) {
35655
- reader.assignScalar(requestedFieldName, sink, fieldData);
35656
- return sink;
35657
- }
35658
- const fieldType = getFieldType$K(sel);
35659
- if (fieldType === undefined) {
35660
- // This field's type is unknown to us. This breaks normalization.
35661
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
35662
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
35663
- }
35664
- else if (fieldType.isArray) {
35665
- const arraySink = [];
35666
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
35667
- reader.enterPath(i);
35668
- selectType$q(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
35669
- reader.exitPath();
35670
- }
35671
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
35672
- }
35673
- else {
35674
- selectType$q(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
35675
- }
35676
- reader.exitPath();
35677
- return sink;
34524
+ function buildSelectionForField$q(source, reader, sel, variables, fragments) {
34525
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$p, getFieldType$K, selectType$q);
35678
34526
  }
35679
- function buildSelectionForNode$p(source, reader, parentNode, selectionNode, variables, fragments) {
35680
- const sink = {};
35681
- if (selectionNode.directives) {
35682
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
35683
- if (selectionWithDirectives === undefined) {
35684
- return;
35685
- }
35686
- selectionNode = selectionWithDirectives;
35687
- }
35688
- if (selectionNode.kind === "InlineFragment") {
35689
- if (isFragmentApplicable$q(selectionNode, source.data.__typename)) {
35690
- // Get selections out of the inline fragment
35691
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
35692
- // Call into field handling with selections
35693
- Object.assign(sink, buildSelectionForNode$p(source, reader, parentNode, fragmentSelection, variables, fragments));
35694
- });
35695
- }
35696
- }
35697
- if (selectionNode.kind === "FragmentSpread") {
35698
- const namedFragment = fragments[selectionNode.name.value];
35699
- if (namedFragment && isFragmentApplicable$q(namedFragment, source.data.__typename)) {
35700
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
35701
- // Call into field handling with selections
35702
- Object.assign(sink, buildSelectionForNode$p(source, reader, parentNode, fragmentSelection, variables, fragments));
35703
- });
35704
- }
35705
- }
35706
- if (selectionNode.kind === "Field") {
35707
- Object.assign(sink, buildSelectionForField$p(source, reader, selectionNode, variables));
35708
- }
35709
- return sink;
34527
+ function buildSelectionForNode$q(source, reader, parentNode, selectionNode, variables, fragments) {
34528
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$q, buildSelectionForField$q);
35710
34529
  }
35711
34530
  function select$z(field, variables, fragments) {
35712
34531
  return (source, reader) => {
35713
34532
  var _a;
35714
34533
  const sink = {};
35715
34534
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
35716
- const builtSelection = buildSelectionForNode$p(source, reader, field, sel, variables, fragments);
34535
+ const builtSelection = buildSelectionForNode$q(source, reader, field, sel, variables, fragments);
35717
34536
  if (builtSelection !== undefined) {
35718
34537
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
35719
34538
  Object.keys(builtSelection).forEach((key, value) => {
@@ -35861,79 +34680,18 @@
35861
34680
  }
35862
34681
  return sink;
35863
34682
  }
35864
- function buildSelectionForField$o(source, reader, sel, variables, fragments) {
35865
- const sink = {};
35866
- const fieldData = getFieldData$o(source, sel, variables);
35867
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
35868
- reader.enterPath(requestedFieldName);
35869
- if (fieldData === undefined) {
35870
- reader.markMissing();
35871
- reader.exitPath();
35872
- return;
35873
- }
35874
- if (fieldData === null) {
35875
- reader.assignScalar(requestedFieldName, sink, fieldData);
35876
- return sink;
35877
- }
35878
- const fieldType = getFieldType$J(sel);
35879
- if (fieldType === undefined) {
35880
- // This field's type is unknown to us. This breaks normalization.
35881
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
35882
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
35883
- }
35884
- else if (fieldType.isArray) {
35885
- const arraySink = [];
35886
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
35887
- reader.enterPath(i);
35888
- selectType$p(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
35889
- reader.exitPath();
35890
- }
35891
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
35892
- }
35893
- else {
35894
- selectType$p(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
35895
- }
35896
- reader.exitPath();
35897
- return sink;
34683
+ function buildSelectionForField$p(source, reader, sel, variables, fragments) {
34684
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$o, getFieldType$J, selectType$p);
35898
34685
  }
35899
- function buildSelectionForNode$o(source, reader, parentNode, selectionNode, variables, fragments) {
35900
- const sink = {};
35901
- if (selectionNode.directives) {
35902
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
35903
- if (selectionWithDirectives === undefined) {
35904
- return;
35905
- }
35906
- selectionNode = selectionWithDirectives;
35907
- }
35908
- if (selectionNode.kind === "InlineFragment") {
35909
- if (isFragmentApplicable$p(selectionNode, source.data.__typename)) {
35910
- // Get selections out of the inline fragment
35911
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
35912
- // Call into field handling with selections
35913
- Object.assign(sink, buildSelectionForNode$o(source, reader, parentNode, fragmentSelection, variables, fragments));
35914
- });
35915
- }
35916
- }
35917
- if (selectionNode.kind === "FragmentSpread") {
35918
- const namedFragment = fragments[selectionNode.name.value];
35919
- if (namedFragment && isFragmentApplicable$p(namedFragment, source.data.__typename)) {
35920
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
35921
- // Call into field handling with selections
35922
- Object.assign(sink, buildSelectionForNode$o(source, reader, parentNode, fragmentSelection, variables, fragments));
35923
- });
35924
- }
35925
- }
35926
- if (selectionNode.kind === "Field") {
35927
- Object.assign(sink, buildSelectionForField$o(source, reader, selectionNode, variables));
35928
- }
35929
- return sink;
34686
+ function buildSelectionForNode$p(source, reader, parentNode, selectionNode, variables, fragments) {
34687
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$p, buildSelectionForField$p);
35930
34688
  }
35931
34689
  function select$y(field, variables, fragments) {
35932
34690
  return (source, reader) => {
35933
34691
  var _a;
35934
34692
  const sink = {};
35935
34693
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
35936
- const builtSelection = buildSelectionForNode$o(source, reader, field, sel, variables, fragments);
34694
+ const builtSelection = buildSelectionForNode$p(source, reader, field, sel, variables, fragments);
35937
34695
  if (builtSelection !== undefined) {
35938
34696
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
35939
34697
  Object.keys(builtSelection).forEach((key, value) => {
@@ -36075,79 +34833,18 @@
36075
34833
  }
36076
34834
  return sink;
36077
34835
  }
36078
- function buildSelectionForField$n(source, reader, sel, variables, fragments) {
36079
- const sink = {};
36080
- const fieldData = getFieldData$n(source, sel, variables);
36081
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
36082
- reader.enterPath(requestedFieldName);
36083
- if (fieldData === undefined) {
36084
- reader.markMissing();
36085
- reader.exitPath();
36086
- return;
36087
- }
36088
- if (fieldData === null) {
36089
- reader.assignScalar(requestedFieldName, sink, fieldData);
36090
- return sink;
36091
- }
36092
- const fieldType = getFieldType$I(sel);
36093
- if (fieldType === undefined) {
36094
- // This field's type is unknown to us. This breaks normalization.
36095
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
36096
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
36097
- }
36098
- else if (fieldType.isArray) {
36099
- const arraySink = [];
36100
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
36101
- reader.enterPath(i);
36102
- selectType$o(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
36103
- reader.exitPath();
36104
- }
36105
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
36106
- }
36107
- else {
36108
- selectType$o(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
36109
- }
36110
- reader.exitPath();
36111
- return sink;
34836
+ function buildSelectionForField$o(source, reader, sel, variables, fragments) {
34837
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$n, getFieldType$I, selectType$o);
36112
34838
  }
36113
- function buildSelectionForNode$n(source, reader, parentNode, selectionNode, variables, fragments) {
36114
- const sink = {};
36115
- if (selectionNode.directives) {
36116
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
36117
- if (selectionWithDirectives === undefined) {
36118
- return;
36119
- }
36120
- selectionNode = selectionWithDirectives;
36121
- }
36122
- if (selectionNode.kind === "InlineFragment") {
36123
- if (isFragmentApplicable$o(selectionNode, source.data.__typename)) {
36124
- // Get selections out of the inline fragment
36125
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
36126
- // Call into field handling with selections
36127
- Object.assign(sink, buildSelectionForNode$n(source, reader, parentNode, fragmentSelection, variables, fragments));
36128
- });
36129
- }
36130
- }
36131
- if (selectionNode.kind === "FragmentSpread") {
36132
- const namedFragment = fragments[selectionNode.name.value];
36133
- if (namedFragment && isFragmentApplicable$o(namedFragment, source.data.__typename)) {
36134
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
36135
- // Call into field handling with selections
36136
- Object.assign(sink, buildSelectionForNode$n(source, reader, parentNode, fragmentSelection, variables, fragments));
36137
- });
36138
- }
36139
- }
36140
- if (selectionNode.kind === "Field") {
36141
- Object.assign(sink, buildSelectionForField$n(source, reader, selectionNode, variables));
36142
- }
36143
- return sink;
34839
+ function buildSelectionForNode$o(source, reader, parentNode, selectionNode, variables, fragments) {
34840
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$o, buildSelectionForField$o);
36144
34841
  }
36145
34842
  function select$x(field, variables, fragments) {
36146
34843
  return (source, reader) => {
36147
34844
  var _a;
36148
34845
  const sink = {};
36149
34846
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
36150
- const builtSelection = buildSelectionForNode$n(source, reader, field, sel, variables, fragments);
34847
+ const builtSelection = buildSelectionForNode$o(source, reader, field, sel, variables, fragments);
36151
34848
  if (builtSelection !== undefined) {
36152
34849
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
36153
34850
  Object.keys(builtSelection).forEach((key, value) => {
@@ -36289,79 +34986,18 @@
36289
34986
  }
36290
34987
  return sink;
36291
34988
  }
36292
- function buildSelectionForField$m(source, reader, sel, variables, fragments) {
36293
- const sink = {};
36294
- const fieldData = getFieldData$m(source, sel, variables);
36295
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
36296
- reader.enterPath(requestedFieldName);
36297
- if (fieldData === undefined) {
36298
- reader.markMissing();
36299
- reader.exitPath();
36300
- return;
36301
- }
36302
- if (fieldData === null) {
36303
- reader.assignScalar(requestedFieldName, sink, fieldData);
36304
- return sink;
36305
- }
36306
- const fieldType = getFieldType$H(sel);
36307
- if (fieldType === undefined) {
36308
- // This field's type is unknown to us. This breaks normalization.
36309
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
36310
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
36311
- }
36312
- else if (fieldType.isArray) {
36313
- const arraySink = [];
36314
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
36315
- reader.enterPath(i);
36316
- selectType$n(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
36317
- reader.exitPath();
36318
- }
36319
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
36320
- }
36321
- else {
36322
- selectType$n(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
36323
- }
36324
- reader.exitPath();
36325
- return sink;
34989
+ function buildSelectionForField$n(source, reader, sel, variables, fragments) {
34990
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$m, getFieldType$H, selectType$n);
36326
34991
  }
36327
- function buildSelectionForNode$m(source, reader, parentNode, selectionNode, variables, fragments) {
36328
- const sink = {};
36329
- if (selectionNode.directives) {
36330
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
36331
- if (selectionWithDirectives === undefined) {
36332
- return;
36333
- }
36334
- selectionNode = selectionWithDirectives;
36335
- }
36336
- if (selectionNode.kind === "InlineFragment") {
36337
- if (isFragmentApplicable$n(selectionNode, source.data.__typename)) {
36338
- // Get selections out of the inline fragment
36339
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
36340
- // Call into field handling with selections
36341
- Object.assign(sink, buildSelectionForNode$m(source, reader, parentNode, fragmentSelection, variables, fragments));
36342
- });
36343
- }
36344
- }
36345
- if (selectionNode.kind === "FragmentSpread") {
36346
- const namedFragment = fragments[selectionNode.name.value];
36347
- if (namedFragment && isFragmentApplicable$n(namedFragment, source.data.__typename)) {
36348
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
36349
- // Call into field handling with selections
36350
- Object.assign(sink, buildSelectionForNode$m(source, reader, parentNode, fragmentSelection, variables, fragments));
36351
- });
36352
- }
36353
- }
36354
- if (selectionNode.kind === "Field") {
36355
- Object.assign(sink, buildSelectionForField$m(source, reader, selectionNode, variables));
36356
- }
36357
- return sink;
34992
+ function buildSelectionForNode$n(source, reader, parentNode, selectionNode, variables, fragments) {
34993
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$n, buildSelectionForField$n);
36358
34994
  }
36359
34995
  function select$w(field, variables, fragments) {
36360
34996
  return (source, reader) => {
36361
34997
  var _a;
36362
34998
  const sink = {};
36363
34999
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
36364
- const builtSelection = buildSelectionForNode$m(source, reader, field, sel, variables, fragments);
35000
+ const builtSelection = buildSelectionForNode$n(source, reader, field, sel, variables, fragments);
36365
35001
  if (builtSelection !== undefined) {
36366
35002
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
36367
35003
  Object.keys(builtSelection).forEach((key, value) => {
@@ -36509,79 +35145,18 @@
36509
35145
  }
36510
35146
  return sink;
36511
35147
  }
36512
- function buildSelectionForField$l(source, reader, sel, variables, fragments) {
36513
- const sink = {};
36514
- const fieldData = getFieldData$l(source, sel, variables);
36515
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
36516
- reader.enterPath(requestedFieldName);
36517
- if (fieldData === undefined) {
36518
- reader.markMissing();
36519
- reader.exitPath();
36520
- return;
36521
- }
36522
- if (fieldData === null) {
36523
- reader.assignScalar(requestedFieldName, sink, fieldData);
36524
- return sink;
36525
- }
36526
- const fieldType = getFieldType$G(sel);
36527
- if (fieldType === undefined) {
36528
- // This field's type is unknown to us. This breaks normalization.
36529
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
36530
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
36531
- }
36532
- else if (fieldType.isArray) {
36533
- const arraySink = [];
36534
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
36535
- reader.enterPath(i);
36536
- selectType$m(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
36537
- reader.exitPath();
36538
- }
36539
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
36540
- }
36541
- else {
36542
- selectType$m(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
36543
- }
36544
- reader.exitPath();
36545
- return sink;
35148
+ function buildSelectionForField$m(source, reader, sel, variables, fragments) {
35149
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$l, getFieldType$G, selectType$m);
36546
35150
  }
36547
- function buildSelectionForNode$l(source, reader, parentNode, selectionNode, variables, fragments) {
36548
- const sink = {};
36549
- if (selectionNode.directives) {
36550
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
36551
- if (selectionWithDirectives === undefined) {
36552
- return;
36553
- }
36554
- selectionNode = selectionWithDirectives;
36555
- }
36556
- if (selectionNode.kind === "InlineFragment") {
36557
- if (isFragmentApplicable$m(selectionNode, source.data.__typename)) {
36558
- // Get selections out of the inline fragment
36559
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
36560
- // Call into field handling with selections
36561
- Object.assign(sink, buildSelectionForNode$l(source, reader, parentNode, fragmentSelection, variables, fragments));
36562
- });
36563
- }
36564
- }
36565
- if (selectionNode.kind === "FragmentSpread") {
36566
- const namedFragment = fragments[selectionNode.name.value];
36567
- if (namedFragment && isFragmentApplicable$m(namedFragment, source.data.__typename)) {
36568
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
36569
- // Call into field handling with selections
36570
- Object.assign(sink, buildSelectionForNode$l(source, reader, parentNode, fragmentSelection, variables, fragments));
36571
- });
36572
- }
36573
- }
36574
- if (selectionNode.kind === "Field") {
36575
- Object.assign(sink, buildSelectionForField$l(source, reader, selectionNode, variables));
36576
- }
36577
- return sink;
35151
+ function buildSelectionForNode$m(source, reader, parentNode, selectionNode, variables, fragments) {
35152
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$m, buildSelectionForField$m);
36578
35153
  }
36579
35154
  function select$v(field, variables, fragments) {
36580
35155
  return (source, reader) => {
36581
35156
  var _a;
36582
35157
  const sink = {};
36583
35158
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
36584
- const builtSelection = buildSelectionForNode$l(source, reader, field, sel, variables, fragments);
35159
+ const builtSelection = buildSelectionForNode$m(source, reader, field, sel, variables, fragments);
36585
35160
  if (builtSelection !== undefined) {
36586
35161
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
36587
35162
  Object.keys(builtSelection).forEach((key, value) => {
@@ -36729,79 +35304,18 @@
36729
35304
  }
36730
35305
  return sink;
36731
35306
  }
36732
- function buildSelectionForField$k(source, reader, sel, variables, fragments) {
36733
- const sink = {};
36734
- const fieldData = getFieldData$k(source, sel, variables);
36735
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
36736
- reader.enterPath(requestedFieldName);
36737
- if (fieldData === undefined) {
36738
- reader.markMissing();
36739
- reader.exitPath();
36740
- return;
36741
- }
36742
- if (fieldData === null) {
36743
- reader.assignScalar(requestedFieldName, sink, fieldData);
36744
- return sink;
36745
- }
36746
- const fieldType = getFieldType$F(sel);
36747
- if (fieldType === undefined) {
36748
- // This field's type is unknown to us. This breaks normalization.
36749
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
36750
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
36751
- }
36752
- else if (fieldType.isArray) {
36753
- const arraySink = [];
36754
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
36755
- reader.enterPath(i);
36756
- selectType$l(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
36757
- reader.exitPath();
36758
- }
36759
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
36760
- }
36761
- else {
36762
- selectType$l(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
36763
- }
36764
- reader.exitPath();
36765
- return sink;
35307
+ function buildSelectionForField$l(source, reader, sel, variables, fragments) {
35308
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$k, getFieldType$F, selectType$l);
36766
35309
  }
36767
- function buildSelectionForNode$k(source, reader, parentNode, selectionNode, variables, fragments) {
36768
- const sink = {};
36769
- if (selectionNode.directives) {
36770
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
36771
- if (selectionWithDirectives === undefined) {
36772
- return;
36773
- }
36774
- selectionNode = selectionWithDirectives;
36775
- }
36776
- if (selectionNode.kind === "InlineFragment") {
36777
- if (isFragmentApplicable$l(selectionNode, source.data.__typename)) {
36778
- // Get selections out of the inline fragment
36779
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
36780
- // Call into field handling with selections
36781
- Object.assign(sink, buildSelectionForNode$k(source, reader, parentNode, fragmentSelection, variables, fragments));
36782
- });
36783
- }
36784
- }
36785
- if (selectionNode.kind === "FragmentSpread") {
36786
- const namedFragment = fragments[selectionNode.name.value];
36787
- if (namedFragment && isFragmentApplicable$l(namedFragment, source.data.__typename)) {
36788
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
36789
- // Call into field handling with selections
36790
- Object.assign(sink, buildSelectionForNode$k(source, reader, parentNode, fragmentSelection, variables, fragments));
36791
- });
36792
- }
36793
- }
36794
- if (selectionNode.kind === "Field") {
36795
- Object.assign(sink, buildSelectionForField$k(source, reader, selectionNode, variables));
36796
- }
36797
- return sink;
35310
+ function buildSelectionForNode$l(source, reader, parentNode, selectionNode, variables, fragments) {
35311
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$l, buildSelectionForField$l);
36798
35312
  }
36799
35313
  function select$u(field, variables, fragments) {
36800
35314
  return (source, reader) => {
36801
35315
  var _a;
36802
35316
  const sink = {};
36803
35317
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
36804
- const builtSelection = buildSelectionForNode$k(source, reader, field, sel, variables, fragments);
35318
+ const builtSelection = buildSelectionForNode$l(source, reader, field, sel, variables, fragments);
36805
35319
  if (builtSelection !== undefined) {
36806
35320
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
36807
35321
  Object.keys(builtSelection).forEach((key, value) => {
@@ -36943,79 +35457,18 @@
36943
35457
  }
36944
35458
  return sink;
36945
35459
  }
36946
- function buildSelectionForField$j(source, reader, sel, variables, fragments) {
36947
- const sink = {};
36948
- const fieldData = getFieldData$j(source, sel, variables);
36949
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
36950
- reader.enterPath(requestedFieldName);
36951
- if (fieldData === undefined) {
36952
- reader.markMissing();
36953
- reader.exitPath();
36954
- return;
36955
- }
36956
- if (fieldData === null) {
36957
- reader.assignScalar(requestedFieldName, sink, fieldData);
36958
- return sink;
36959
- }
36960
- const fieldType = getFieldType$E(sel);
36961
- if (fieldType === undefined) {
36962
- // This field's type is unknown to us. This breaks normalization.
36963
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
36964
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
36965
- }
36966
- else if (fieldType.isArray) {
36967
- const arraySink = [];
36968
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
36969
- reader.enterPath(i);
36970
- selectType$k(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
36971
- reader.exitPath();
36972
- }
36973
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
36974
- }
36975
- else {
36976
- selectType$k(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
36977
- }
36978
- reader.exitPath();
36979
- return sink;
35460
+ function buildSelectionForField$k(source, reader, sel, variables, fragments) {
35461
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$j, getFieldType$E, selectType$k);
36980
35462
  }
36981
- function buildSelectionForNode$j(source, reader, parentNode, selectionNode, variables, fragments) {
36982
- const sink = {};
36983
- if (selectionNode.directives) {
36984
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
36985
- if (selectionWithDirectives === undefined) {
36986
- return;
36987
- }
36988
- selectionNode = selectionWithDirectives;
36989
- }
36990
- if (selectionNode.kind === "InlineFragment") {
36991
- if (isFragmentApplicable$k(selectionNode, source.data.__typename)) {
36992
- // Get selections out of the inline fragment
36993
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
36994
- // Call into field handling with selections
36995
- Object.assign(sink, buildSelectionForNode$j(source, reader, parentNode, fragmentSelection, variables, fragments));
36996
- });
36997
- }
36998
- }
36999
- if (selectionNode.kind === "FragmentSpread") {
37000
- const namedFragment = fragments[selectionNode.name.value];
37001
- if (namedFragment && isFragmentApplicable$k(namedFragment, source.data.__typename)) {
37002
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
37003
- // Call into field handling with selections
37004
- Object.assign(sink, buildSelectionForNode$j(source, reader, parentNode, fragmentSelection, variables, fragments));
37005
- });
37006
- }
37007
- }
37008
- if (selectionNode.kind === "Field") {
37009
- Object.assign(sink, buildSelectionForField$j(source, reader, selectionNode, variables));
37010
- }
37011
- return sink;
35463
+ function buildSelectionForNode$k(source, reader, parentNode, selectionNode, variables, fragments) {
35464
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$k, buildSelectionForField$k);
37012
35465
  }
37013
35466
  function select$t(field, variables, fragments) {
37014
35467
  return (source, reader) => {
37015
35468
  var _a;
37016
35469
  const sink = {};
37017
35470
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
37018
- const builtSelection = buildSelectionForNode$j(source, reader, field, sel, variables, fragments);
35471
+ const builtSelection = buildSelectionForNode$k(source, reader, field, sel, variables, fragments);
37019
35472
  if (builtSelection !== undefined) {
37020
35473
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
37021
35474
  Object.keys(builtSelection).forEach((key, value) => {
@@ -37938,79 +36391,18 @@
37938
36391
  }
37939
36392
  return sink;
37940
36393
  }
37941
- function buildSelectionForField$i(source, reader, sel, variables, fragments) {
37942
- const sink = {};
37943
- const fieldData = getFieldData$h(source, sel, variables);
37944
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
37945
- reader.enterPath(requestedFieldName);
37946
- if (fieldData === undefined) {
37947
- reader.markMissing();
37948
- reader.exitPath();
37949
- return;
37950
- }
37951
- if (fieldData === null) {
37952
- reader.assignScalar(requestedFieldName, sink, fieldData);
37953
- return sink;
37954
- }
37955
- const fieldType = getFieldType$B(sel);
37956
- if (fieldType === undefined) {
37957
- // This field's type is unknown to us. This breaks normalization.
37958
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
37959
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
37960
- }
37961
- else if (fieldType.isArray) {
37962
- const arraySink = [];
37963
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
37964
- reader.enterPath(i);
37965
- selectType$i(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
37966
- reader.exitPath();
37967
- }
37968
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
37969
- }
37970
- else {
37971
- selectType$i(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
37972
- }
37973
- reader.exitPath();
37974
- return sink;
36394
+ function buildSelectionForField$j(source, reader, sel, variables, fragments) {
36395
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$h, getFieldType$B, selectType$i);
37975
36396
  }
37976
- function buildSelectionForNode$i(source, reader, parentNode, selectionNode, variables, fragments) {
37977
- const sink = {};
37978
- if (selectionNode.directives) {
37979
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
37980
- if (selectionWithDirectives === undefined) {
37981
- return;
37982
- }
37983
- selectionNode = selectionWithDirectives;
37984
- }
37985
- if (selectionNode.kind === "InlineFragment") {
37986
- if (isFragmentApplicable$j(selectionNode, source.data.__typename)) {
37987
- // Get selections out of the inline fragment
37988
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
37989
- // Call into field handling with selections
37990
- Object.assign(sink, buildSelectionForNode$i(source, reader, parentNode, fragmentSelection, variables, fragments));
37991
- });
37992
- }
37993
- }
37994
- if (selectionNode.kind === "FragmentSpread") {
37995
- const namedFragment = fragments[selectionNode.name.value];
37996
- if (namedFragment && isFragmentApplicable$j(namedFragment, source.data.__typename)) {
37997
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
37998
- // Call into field handling with selections
37999
- Object.assign(sink, buildSelectionForNode$i(source, reader, parentNode, fragmentSelection, variables, fragments));
38000
- });
38001
- }
38002
- }
38003
- if (selectionNode.kind === "Field") {
38004
- Object.assign(sink, buildSelectionForField$i(source, reader, selectionNode, variables));
38005
- }
38006
- return sink;
36397
+ function buildSelectionForNode$j(source, reader, parentNode, selectionNode, variables, fragments) {
36398
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$j, buildSelectionForField$j);
38007
36399
  }
38008
36400
  function select$r(field, variables, fragments) {
38009
36401
  return (source, reader) => {
38010
36402
  var _a;
38011
36403
  const sink = {};
38012
36404
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
38013
- const builtSelection = buildSelectionForNode$i(source, reader, field, sel, variables, fragments);
36405
+ const builtSelection = buildSelectionForNode$j(source, reader, field, sel, variables, fragments);
38014
36406
  if (builtSelection !== undefined) {
38015
36407
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
38016
36408
  Object.keys(builtSelection).forEach((key, value) => {
@@ -38860,7 +37252,7 @@
38860
37252
  }
38861
37253
  else {
38862
37254
  trimmedEdges = trimEdges(source.edges, startOffset, endOffset);
38863
- maxOffset = !listIsComplete ? findMaxOffset(metadata) : Object.keys(metadata).length - 2;
37255
+ maxOffset = findMaxOffset(metadata);
38864
37256
  const listHasEnoughItems = (endOffset - 1 <= maxOffset);
38865
37257
  if (trimmedEdges === undefined || !listHasEnoughItems) {
38866
37258
  reader.markMissingLink(fieldData.__ref);
@@ -38898,72 +37290,11 @@
38898
37290
  }
38899
37291
  return sink;
38900
37292
  }
38901
- function buildSelectionForField$h(source, reader, sel, variables, fragments) {
38902
- const sink = {};
38903
- const fieldData = getFieldData$i(source, sel, variables);
38904
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
38905
- reader.enterPath(requestedFieldName);
38906
- if (fieldData === undefined) {
38907
- reader.markMissing();
38908
- reader.exitPath();
38909
- return;
38910
- }
38911
- if (fieldData === null) {
38912
- reader.assignScalar(requestedFieldName, sink, fieldData);
38913
- return sink;
38914
- }
38915
- const fieldType = getFieldType$C(sel);
38916
- if (fieldType === undefined) {
38917
- // This field's type is unknown to us. This breaks normalization.
38918
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
38919
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
38920
- }
38921
- else if (fieldType.isArray) {
38922
- const arraySink = [];
38923
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
38924
- reader.enterPath(i);
38925
- selectType$j(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
38926
- reader.exitPath();
38927
- }
38928
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
38929
- }
38930
- else {
38931
- selectType$j(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
38932
- }
38933
- reader.exitPath();
38934
- return sink;
37293
+ function buildSelectionForField$i(source, reader, sel, variables, fragments) {
37294
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$i, getFieldType$C, selectType$j);
38935
37295
  }
38936
- function buildSelectionForNode$h(source, reader, parentNode, selectionNode, variables, fragments) {
38937
- const sink = {};
38938
- if (selectionNode.directives) {
38939
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
38940
- if (selectionWithDirectives === undefined) {
38941
- return;
38942
- }
38943
- selectionNode = selectionWithDirectives;
38944
- }
38945
- if (selectionNode.kind === "InlineFragment") {
38946
- if (isFragmentApplicable$i(selectionNode, source.data.__typename)) {
38947
- // Get selections out of the inline fragment
38948
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
38949
- // Call into field handling with selections
38950
- Object.assign(sink, buildSelectionForNode$h(source, reader, parentNode, fragmentSelection, variables, fragments));
38951
- });
38952
- }
38953
- }
38954
- if (selectionNode.kind === "FragmentSpread") {
38955
- const namedFragment = fragments[selectionNode.name.value];
38956
- if (namedFragment && isFragmentApplicable$i(namedFragment, source.data.__typename)) {
38957
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
38958
- // Call into field handling with selections
38959
- Object.assign(sink, buildSelectionForNode$h(source, reader, parentNode, fragmentSelection, variables, fragments));
38960
- });
38961
- }
38962
- }
38963
- if (selectionNode.kind === "Field") {
38964
- Object.assign(sink, buildSelectionForField$h(source, reader, selectionNode, variables, fragments));
38965
- }
38966
- return sink;
37296
+ function buildSelectionForNode$i(source, reader, parentNode, selectionNode, variables, fragments) {
37297
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$i, buildSelectionForField$i);
38967
37298
  }
38968
37299
  function select$q(field, variables, fragments) {
38969
37300
  return (source, reader) => {
@@ -38971,7 +37302,7 @@
38971
37302
  const sink = {};
38972
37303
  source = attachMappedData(source, reader);
38973
37304
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
38974
- const builtSelection = buildSelectionForNode$h(source, reader, field, sel, variables, fragments);
37305
+ const builtSelection = buildSelectionForNode$i(source, reader, field, sel, variables, fragments);
38975
37306
  if (builtSelection !== undefined) {
38976
37307
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
38977
37308
  Object.keys(builtSelection).forEach((key, value) => {
@@ -39907,79 +38238,18 @@
39907
38238
  }
39908
38239
  return sink;
39909
38240
  }
39910
- function buildSelectionForField$g(source, reader, sel, variables, fragments) {
39911
- const sink = {};
39912
- const fieldData = getFieldData$g(source, sel, variables);
39913
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
39914
- reader.enterPath(requestedFieldName);
39915
- if (fieldData === undefined) {
39916
- reader.markMissing();
39917
- reader.exitPath();
39918
- return;
39919
- }
39920
- if (fieldData === null) {
39921
- reader.assignScalar(requestedFieldName, sink, fieldData);
39922
- return sink;
39923
- }
39924
- const fieldType = getFieldType$A(sel);
39925
- if (fieldType === undefined) {
39926
- // This field's type is unknown to us. This breaks normalization.
39927
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
39928
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
39929
- }
39930
- else if (fieldType.isArray) {
39931
- const arraySink = [];
39932
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
39933
- reader.enterPath(i);
39934
- selectType$g(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
39935
- reader.exitPath();
39936
- }
39937
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
39938
- }
39939
- else {
39940
- selectType$g(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
39941
- }
39942
- reader.exitPath();
39943
- return sink;
38241
+ function buildSelectionForField$h(source, reader, sel, variables, fragments) {
38242
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$g, getFieldType$A, selectType$g);
39944
38243
  }
39945
- function buildSelectionForNode$g(source, reader, parentNode, selectionNode, variables, fragments) {
39946
- const sink = {};
39947
- if (selectionNode.directives) {
39948
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
39949
- if (selectionWithDirectives === undefined) {
39950
- return;
39951
- }
39952
- selectionNode = selectionWithDirectives;
39953
- }
39954
- if (selectionNode.kind === "InlineFragment") {
39955
- if (isFragmentApplicable$h(selectionNode, source.data.__typename)) {
39956
- // Get selections out of the inline fragment
39957
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
39958
- // Call into field handling with selections
39959
- Object.assign(sink, buildSelectionForNode$g(source, reader, parentNode, fragmentSelection, variables, fragments));
39960
- });
39961
- }
39962
- }
39963
- if (selectionNode.kind === "FragmentSpread") {
39964
- const namedFragment = fragments[selectionNode.name.value];
39965
- if (namedFragment && isFragmentApplicable$h(namedFragment, source.data.__typename)) {
39966
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
39967
- // Call into field handling with selections
39968
- Object.assign(sink, buildSelectionForNode$g(source, reader, parentNode, fragmentSelection, variables, fragments));
39969
- });
39970
- }
39971
- }
39972
- if (selectionNode.kind === "Field") {
39973
- Object.assign(sink, buildSelectionForField$g(source, reader, selectionNode, variables, fragments));
39974
- }
39975
- return sink;
38244
+ function buildSelectionForNode$h(source, reader, parentNode, selectionNode, variables, fragments) {
38245
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$h, buildSelectionForField$h);
39976
38246
  }
39977
38247
  function select$p(field, variables, fragments) {
39978
38248
  return (source, reader) => {
39979
38249
  var _a;
39980
38250
  const sink = {};
39981
38251
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
39982
- const builtSelection = buildSelectionForNode$g(source, reader, field, sel, variables, fragments);
38252
+ const builtSelection = buildSelectionForNode$h(source, reader, field, sel, variables, fragments);
39983
38253
  if (builtSelection !== undefined) {
39984
38254
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
39985
38255
  Object.keys(builtSelection).forEach((key, value) => {
@@ -40266,81 +38536,18 @@
40266
38536
  }
40267
38537
  return sink;
40268
38538
  }
40269
- function buildSelectionForField$f(source, reader, sel, variables, fragments) {
40270
- const sink = {};
40271
- const fieldData = getFieldData$f(source, sel, variables);
40272
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
40273
- if (requestedFieldName === 'pageInfo')
40274
- return;
40275
- reader.enterPath(requestedFieldName);
40276
- if (fieldData === undefined) {
40277
- reader.markMissing();
40278
- reader.exitPath();
40279
- return;
40280
- }
40281
- if (fieldData === null) {
40282
- reader.assignScalar(requestedFieldName, sink, fieldData);
40283
- return sink;
40284
- }
40285
- const fieldType = getFieldType$z(sel);
40286
- if (fieldType === undefined) {
40287
- // This field's type is unknown to us. This breaks normalization.
40288
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
40289
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
40290
- }
40291
- else if (fieldType.isArray) {
40292
- const arraySink = [];
40293
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
40294
- reader.enterPath(i);
40295
- selectType$f(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
40296
- reader.exitPath();
40297
- }
40298
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
40299
- }
40300
- else {
40301
- selectType$f(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
40302
- }
40303
- reader.exitPath();
40304
- return sink;
38539
+ function buildSelectionForField$g(source, reader, sel, variables, fragments) {
38540
+ return buildSelectionForField(source, reader, sel, variables, fragments, true, getFieldData$f, getFieldType$z, selectType$f);
40305
38541
  }
40306
- function buildSelectionForNode$f(source, reader, parentNode, selectionNode, variables, fragments) {
40307
- const sink = {};
40308
- if (selectionNode.directives) {
40309
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
40310
- if (selectionWithDirectives === undefined) {
40311
- return;
40312
- }
40313
- selectionNode = selectionWithDirectives;
40314
- }
40315
- if (selectionNode.kind === "InlineFragment") {
40316
- if (isFragmentApplicable$g(selectionNode, source.data.__typename)) {
40317
- // Get selections out of the inline fragment
40318
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
40319
- // Call into field handling with selections
40320
- Object.assign(sink, buildSelectionForNode$f(source, reader, parentNode, fragmentSelection, variables, fragments));
40321
- });
40322
- }
40323
- }
40324
- if (selectionNode.kind === "FragmentSpread") {
40325
- const namedFragment = fragments[selectionNode.name.value];
40326
- if (namedFragment && isFragmentApplicable$g(namedFragment, source.data.__typename)) {
40327
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
40328
- // Call into field handling with selections
40329
- Object.assign(sink, buildSelectionForNode$f(source, reader, parentNode, fragmentSelection, variables, fragments));
40330
- });
40331
- }
40332
- }
40333
- if (selectionNode.kind === "Field") {
40334
- Object.assign(sink, buildSelectionForField$f(source, reader, selectionNode, variables, fragments));
40335
- }
40336
- return sink;
38542
+ function buildSelectionForNode$g(source, reader, parentNode, selectionNode, variables, fragments) {
38543
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$g, buildSelectionForField$g);
40337
38544
  }
40338
38545
  function select$o(field, variables, fragments) {
40339
38546
  return (source, reader) => {
40340
38547
  var _a;
40341
38548
  const sink = {};
40342
38549
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
40343
- const builtSelection = buildSelectionForNode$f(source, reader, field, sel, variables, fragments);
38550
+ const builtSelection = buildSelectionForNode$g(source, reader, field, sel, variables, fragments);
40344
38551
  if (builtSelection !== undefined) {
40345
38552
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
40346
38553
  Object.keys(builtSelection).forEach((key, value) => {
@@ -40598,7 +38805,7 @@
40598
38805
  }
40599
38806
  else {
40600
38807
  trimmedEdges = trimEdges(source.edges, startOffset, endOffset);
40601
- maxOffset = !listIsComplete ? findMaxOffset(metadata) : Object.keys(metadata).length - 2;
38808
+ maxOffset = findMaxOffset(metadata);
40602
38809
  const listHasEnoughItems = (endOffset - 1 <= maxOffset);
40603
38810
  if (trimmedEdges === undefined || !listHasEnoughItems) {
40604
38811
  reader.markMissingLink(fieldData.__ref);
@@ -40636,79 +38843,18 @@
40636
38843
  }
40637
38844
  return sink;
40638
38845
  }
40639
- function buildSelectionForField$e(source, reader, sel, variables, fragments) {
40640
- const sink = {};
40641
- const fieldData = getFieldData$e(source, sel, variables);
40642
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
40643
- reader.enterPath(requestedFieldName);
40644
- if (fieldData === undefined) {
40645
- reader.markMissing();
40646
- reader.exitPath();
40647
- return;
40648
- }
40649
- if (fieldData === null) {
40650
- reader.assignScalar(requestedFieldName, sink, fieldData);
40651
- return sink;
40652
- }
40653
- const fieldType = getFieldType$y(sel);
40654
- if (fieldType === undefined) {
40655
- // This field's type is unknown to us. This breaks normalization.
40656
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
40657
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
40658
- }
40659
- else if (fieldType.isArray) {
40660
- const arraySink = [];
40661
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
40662
- reader.enterPath(i);
40663
- selectType$e(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
40664
- reader.exitPath();
40665
- }
40666
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
40667
- }
40668
- else {
40669
- selectType$e(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
40670
- }
40671
- reader.exitPath();
40672
- return sink;
38846
+ function buildSelectionForField$f(source, reader, sel, variables, fragments) {
38847
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$e, getFieldType$y, selectType$e);
40673
38848
  }
40674
- function buildSelectionForNode$e(source, reader, parentNode, selectionNode, variables, fragments) {
40675
- const sink = {};
40676
- if (selectionNode.directives) {
40677
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
40678
- if (selectionWithDirectives === undefined) {
40679
- return;
40680
- }
40681
- selectionNode = selectionWithDirectives;
40682
- }
40683
- if (selectionNode.kind === "InlineFragment") {
40684
- if (isFragmentApplicable$f(selectionNode, source.data.__typename)) {
40685
- // Get selections out of the inline fragment
40686
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
40687
- // Call into field handling with selections
40688
- Object.assign(sink, buildSelectionForNode$e(source, reader, parentNode, fragmentSelection, variables, fragments));
40689
- });
40690
- }
40691
- }
40692
- if (selectionNode.kind === "FragmentSpread") {
40693
- const namedFragment = fragments[selectionNode.name.value];
40694
- if (namedFragment && isFragmentApplicable$f(namedFragment, source.data.__typename)) {
40695
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
40696
- // Call into field handling with selections
40697
- Object.assign(sink, buildSelectionForNode$e(source, reader, parentNode, fragmentSelection, variables, fragments));
40698
- });
40699
- }
40700
- }
40701
- if (selectionNode.kind === "Field") {
40702
- Object.assign(sink, buildSelectionForField$e(source, reader, selectionNode, variables, fragments));
40703
- }
40704
- return sink;
38849
+ function buildSelectionForNode$f(source, reader, parentNode, selectionNode, variables, fragments) {
38850
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$f, buildSelectionForField$f);
40705
38851
  }
40706
38852
  function select$n(field, variables, fragments) {
40707
38853
  return (source, reader) => {
40708
38854
  var _a;
40709
38855
  const sink = {};
40710
38856
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
40711
- const builtSelection = buildSelectionForNode$e(source, reader, field, sel, variables, fragments);
38857
+ const builtSelection = buildSelectionForNode$f(source, reader, field, sel, variables, fragments);
40712
38858
  if (builtSelection !== undefined) {
40713
38859
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
40714
38860
  Object.keys(builtSelection).forEach((key, value) => {
@@ -40925,79 +39071,18 @@
40925
39071
  }
40926
39072
  return sink;
40927
39073
  }
40928
- function buildSelectionForField$d(source, reader, sel, variables, fragments) {
40929
- const sink = {};
40930
- const fieldData = getFieldData$d(source, sel, variables);
40931
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
40932
- reader.enterPath(requestedFieldName);
40933
- if (fieldData === undefined) {
40934
- reader.markMissing();
40935
- reader.exitPath();
40936
- return;
40937
- }
40938
- if (fieldData === null) {
40939
- reader.assignScalar(requestedFieldName, sink, fieldData);
40940
- return sink;
40941
- }
40942
- const fieldType = getFieldType$x(sel);
40943
- if (fieldType === undefined) {
40944
- // This field's type is unknown to us. This breaks normalization.
40945
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
40946
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
40947
- }
40948
- else if (fieldType.isArray) {
40949
- const arraySink = [];
40950
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
40951
- reader.enterPath(i);
40952
- selectType$d(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
40953
- reader.exitPath();
40954
- }
40955
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
40956
- }
40957
- else {
40958
- selectType$d(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
40959
- }
40960
- reader.exitPath();
40961
- return sink;
39074
+ function buildSelectionForField$e(source, reader, sel, variables, fragments) {
39075
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$d, getFieldType$x, selectType$d);
40962
39076
  }
40963
- function buildSelectionForNode$d(source, reader, parentNode, selectionNode, variables, fragments) {
40964
- const sink = {};
40965
- if (selectionNode.directives) {
40966
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
40967
- if (selectionWithDirectives === undefined) {
40968
- return;
40969
- }
40970
- selectionNode = selectionWithDirectives;
40971
- }
40972
- if (selectionNode.kind === "InlineFragment") {
40973
- if (isFragmentApplicable$e(selectionNode, source.data.__typename)) {
40974
- // Get selections out of the inline fragment
40975
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
40976
- // Call into field handling with selections
40977
- Object.assign(sink, buildSelectionForNode$d(source, reader, parentNode, fragmentSelection, variables, fragments));
40978
- });
40979
- }
40980
- }
40981
- if (selectionNode.kind === "FragmentSpread") {
40982
- const namedFragment = fragments[selectionNode.name.value];
40983
- if (namedFragment && isFragmentApplicable$e(namedFragment, source.data.__typename)) {
40984
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
40985
- // Call into field handling with selections
40986
- Object.assign(sink, buildSelectionForNode$d(source, reader, parentNode, fragmentSelection, variables, fragments));
40987
- });
40988
- }
40989
- }
40990
- if (selectionNode.kind === "Field") {
40991
- Object.assign(sink, buildSelectionForField$d(source, reader, selectionNode, variables, fragments));
40992
- }
40993
- return sink;
39077
+ function buildSelectionForNode$e(source, reader, parentNode, selectionNode, variables, fragments) {
39078
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$e, buildSelectionForField$e);
40994
39079
  }
40995
39080
  function select$m(field, variables, fragments) {
40996
39081
  return (source, reader) => {
40997
39082
  var _a;
40998
39083
  const sink = {};
40999
39084
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
41000
- const builtSelection = buildSelectionForNode$d(source, reader, field, sel, variables, fragments);
39085
+ const builtSelection = buildSelectionForNode$e(source, reader, field, sel, variables, fragments);
41001
39086
  if (builtSelection !== undefined) {
41002
39087
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
41003
39088
  Object.keys(builtSelection).forEach((key, value) => {
@@ -41208,79 +39293,18 @@
41208
39293
  }
41209
39294
  return sink;
41210
39295
  }
41211
- function buildSelectionForField$c(source, reader, sel, variables, fragments) {
41212
- const sink = {};
41213
- const fieldData = getFieldData$c(source, sel, variables);
41214
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
41215
- reader.enterPath(requestedFieldName);
41216
- if (fieldData === undefined) {
41217
- reader.markMissing();
41218
- reader.exitPath();
41219
- return;
41220
- }
41221
- if (fieldData === null) {
41222
- reader.assignScalar(requestedFieldName, sink, fieldData);
41223
- return sink;
41224
- }
41225
- const fieldType = getFieldType$w(sel);
41226
- if (fieldType === undefined) {
41227
- // This field's type is unknown to us. This breaks normalization.
41228
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
41229
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
41230
- }
41231
- else if (fieldType.isArray) {
41232
- const arraySink = [];
41233
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
41234
- reader.enterPath(i);
41235
- selectType$c(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
41236
- reader.exitPath();
41237
- }
41238
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
41239
- }
41240
- else {
41241
- selectType$c(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
41242
- }
41243
- reader.exitPath();
41244
- return sink;
39296
+ function buildSelectionForField$d(source, reader, sel, variables, fragments) {
39297
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$c, getFieldType$w, selectType$c);
41245
39298
  }
41246
- function buildSelectionForNode$c(source, reader, parentNode, selectionNode, variables, fragments) {
41247
- const sink = {};
41248
- if (selectionNode.directives) {
41249
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
41250
- if (selectionWithDirectives === undefined) {
41251
- return;
41252
- }
41253
- selectionNode = selectionWithDirectives;
41254
- }
41255
- if (selectionNode.kind === "InlineFragment") {
41256
- if (isFragmentApplicable$d(selectionNode, source.data.__typename)) {
41257
- // Get selections out of the inline fragment
41258
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
41259
- // Call into field handling with selections
41260
- Object.assign(sink, buildSelectionForNode$c(source, reader, parentNode, fragmentSelection, variables, fragments));
41261
- });
41262
- }
41263
- }
41264
- if (selectionNode.kind === "FragmentSpread") {
41265
- const namedFragment = fragments[selectionNode.name.value];
41266
- if (namedFragment && isFragmentApplicable$d(namedFragment, source.data.__typename)) {
41267
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
41268
- // Call into field handling with selections
41269
- Object.assign(sink, buildSelectionForNode$c(source, reader, parentNode, fragmentSelection, variables, fragments));
41270
- });
41271
- }
41272
- }
41273
- if (selectionNode.kind === "Field") {
41274
- Object.assign(sink, buildSelectionForField$c(source, reader, selectionNode, variables));
41275
- }
41276
- return sink;
39299
+ function buildSelectionForNode$d(source, reader, parentNode, selectionNode, variables, fragments) {
39300
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$d, buildSelectionForField$d);
41277
39301
  }
41278
39302
  function select$l(field, variables, fragments) {
41279
39303
  return (source, reader) => {
41280
39304
  var _a;
41281
39305
  const sink = {};
41282
39306
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
41283
- const builtSelection = buildSelectionForNode$c(source, reader, field, sel, variables, fragments);
39307
+ const builtSelection = buildSelectionForNode$d(source, reader, field, sel, variables, fragments);
41284
39308
  if (builtSelection !== undefined) {
41285
39309
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
41286
39310
  Object.keys(builtSelection).forEach((key, value) => {
@@ -41430,79 +39454,18 @@
41430
39454
  }
41431
39455
  return sink;
41432
39456
  }
41433
- function buildSelectionForField$b(source, reader, sel, variables, fragments) {
41434
- const sink = {};
41435
- const fieldData = getFieldData$b(source, sel, variables);
41436
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
41437
- reader.enterPath(requestedFieldName);
41438
- if (fieldData === undefined) {
41439
- reader.markMissing();
41440
- reader.exitPath();
41441
- return;
41442
- }
41443
- if (fieldData === null) {
41444
- reader.assignScalar(requestedFieldName, sink, fieldData);
41445
- return sink;
41446
- }
41447
- const fieldType = getFieldType$v(sel);
41448
- if (fieldType === undefined) {
41449
- // This field's type is unknown to us. This breaks normalization.
41450
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
41451
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
41452
- }
41453
- else if (fieldType.isArray) {
41454
- const arraySink = [];
41455
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
41456
- reader.enterPath(i);
41457
- selectType$b(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
41458
- reader.exitPath();
41459
- }
41460
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
41461
- }
41462
- else {
41463
- selectType$b(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
41464
- }
41465
- reader.exitPath();
41466
- return sink;
39457
+ function buildSelectionForField$c(source, reader, sel, variables, fragments) {
39458
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$b, getFieldType$v, selectType$b);
41467
39459
  }
41468
- function buildSelectionForNode$b(source, reader, parentNode, selectionNode, variables, fragments) {
41469
- const sink = {};
41470
- if (selectionNode.directives) {
41471
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
41472
- if (selectionWithDirectives === undefined) {
41473
- return;
41474
- }
41475
- selectionNode = selectionWithDirectives;
41476
- }
41477
- if (selectionNode.kind === "InlineFragment") {
41478
- if (isFragmentApplicable$c(selectionNode, source.data.__typename)) {
41479
- // Get selections out of the inline fragment
41480
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
41481
- // Call into field handling with selections
41482
- Object.assign(sink, buildSelectionForNode$b(source, reader, parentNode, fragmentSelection, variables, fragments));
41483
- });
41484
- }
41485
- }
41486
- if (selectionNode.kind === "FragmentSpread") {
41487
- const namedFragment = fragments[selectionNode.name.value];
41488
- if (namedFragment && isFragmentApplicable$c(namedFragment, source.data.__typename)) {
41489
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
41490
- // Call into field handling with selections
41491
- Object.assign(sink, buildSelectionForNode$b(source, reader, parentNode, fragmentSelection, variables, fragments));
41492
- });
41493
- }
41494
- }
41495
- if (selectionNode.kind === "Field") {
41496
- Object.assign(sink, buildSelectionForField$b(source, reader, selectionNode, variables));
41497
- }
41498
- return sink;
39460
+ function buildSelectionForNode$c(source, reader, parentNode, selectionNode, variables, fragments) {
39461
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$c, buildSelectionForField$c);
41499
39462
  }
41500
39463
  function select$k(field, variables, fragments) {
41501
39464
  return (source, reader) => {
41502
39465
  var _a;
41503
39466
  const sink = {};
41504
39467
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
41505
- const builtSelection = buildSelectionForNode$b(source, reader, field, sel, variables, fragments);
39468
+ const builtSelection = buildSelectionForNode$c(source, reader, field, sel, variables, fragments);
41506
39469
  if (builtSelection !== undefined) {
41507
39470
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
41508
39471
  Object.keys(builtSelection).forEach((key, value) => {
@@ -41680,79 +39643,18 @@
41680
39643
  }
41681
39644
  return sink;
41682
39645
  }
41683
- function buildSelectionForField$a(source, reader, sel, variables, fragments) {
41684
- const sink = {};
41685
- const fieldData = getFieldData$a(source, sel, variables);
41686
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
41687
- reader.enterPath(requestedFieldName);
41688
- if (fieldData === undefined) {
41689
- reader.markMissing();
41690
- reader.exitPath();
41691
- return;
41692
- }
41693
- if (fieldData === null) {
41694
- reader.assignScalar(requestedFieldName, sink, fieldData);
41695
- return sink;
41696
- }
41697
- const fieldType = getFieldType$u(sel);
41698
- if (fieldType === undefined) {
41699
- // This field's type is unknown to us. This breaks normalization.
41700
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
41701
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
41702
- }
41703
- else if (fieldType.isArray) {
41704
- const arraySink = [];
41705
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
41706
- reader.enterPath(i);
41707
- selectType$a(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
41708
- reader.exitPath();
41709
- }
41710
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
41711
- }
41712
- else {
41713
- selectType$a(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
41714
- }
41715
- reader.exitPath();
41716
- return sink;
39646
+ function buildSelectionForField$b(source, reader, sel, variables, fragments) {
39647
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$a, getFieldType$u, selectType$a);
41717
39648
  }
41718
- function buildSelectionForNode$a(source, reader, parentNode, selectionNode, variables, fragments) {
41719
- const sink = {};
41720
- if (selectionNode.directives) {
41721
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
41722
- if (selectionWithDirectives === undefined) {
41723
- return;
41724
- }
41725
- selectionNode = selectionWithDirectives;
41726
- }
41727
- if (selectionNode.kind === "InlineFragment") {
41728
- if (isFragmentApplicable$b(selectionNode, source.data.__typename)) {
41729
- // Get selections out of the inline fragment
41730
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
41731
- // Call into field handling with selections
41732
- Object.assign(sink, buildSelectionForNode$a(source, reader, parentNode, fragmentSelection, variables, fragments));
41733
- });
41734
- }
41735
- }
41736
- if (selectionNode.kind === "FragmentSpread") {
41737
- const namedFragment = fragments[selectionNode.name.value];
41738
- if (namedFragment && isFragmentApplicable$b(namedFragment, source.data.__typename)) {
41739
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
41740
- // Call into field handling with selections
41741
- Object.assign(sink, buildSelectionForNode$a(source, reader, parentNode, fragmentSelection, variables, fragments));
41742
- });
41743
- }
41744
- }
41745
- if (selectionNode.kind === "Field") {
41746
- Object.assign(sink, buildSelectionForField$a(source, reader, selectionNode, variables, fragments));
41747
- }
41748
- return sink;
39649
+ function buildSelectionForNode$b(source, reader, parentNode, selectionNode, variables, fragments) {
39650
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$b, buildSelectionForField$b);
41749
39651
  }
41750
39652
  function select$j(field, variables, fragments) {
41751
39653
  return (source, reader) => {
41752
39654
  var _a;
41753
39655
  const sink = {};
41754
39656
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
41755
- const builtSelection = buildSelectionForNode$a(source, reader, field, sel, variables, fragments);
39657
+ const builtSelection = buildSelectionForNode$b(source, reader, field, sel, variables, fragments);
41756
39658
  if (builtSelection !== undefined) {
41757
39659
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
41758
39660
  Object.keys(builtSelection).forEach((key, value) => {
@@ -42005,79 +39907,18 @@
42005
39907
  }
42006
39908
  return sink;
42007
39909
  }
42008
- function buildSelectionForField$9(source, reader, sel, variables, fragments) {
42009
- const sink = {};
42010
- const fieldData = getFieldData$9(source, sel, variables);
42011
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
42012
- reader.enterPath(requestedFieldName);
42013
- if (fieldData === undefined) {
42014
- reader.markMissing();
42015
- reader.exitPath();
42016
- return;
42017
- }
42018
- if (fieldData === null) {
42019
- reader.assignScalar(requestedFieldName, sink, fieldData);
42020
- return sink;
42021
- }
42022
- const fieldType = getFieldType$t(sel);
42023
- if (fieldType === undefined) {
42024
- // This field's type is unknown to us. This breaks normalization.
42025
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
42026
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
42027
- }
42028
- else if (fieldType.isArray) {
42029
- const arraySink = [];
42030
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
42031
- reader.enterPath(i);
42032
- selectType$9(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
42033
- reader.exitPath();
42034
- }
42035
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
42036
- }
42037
- else {
42038
- selectType$9(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
42039
- }
42040
- reader.exitPath();
42041
- return sink;
39910
+ function buildSelectionForField$a(source, reader, sel, variables, fragments) {
39911
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$9, getFieldType$t, selectType$9);
42042
39912
  }
42043
- function buildSelectionForNode$9(source, reader, parentNode, selectionNode, variables, fragments) {
42044
- const sink = {};
42045
- if (selectionNode.directives) {
42046
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
42047
- if (selectionWithDirectives === undefined) {
42048
- return;
42049
- }
42050
- selectionNode = selectionWithDirectives;
42051
- }
42052
- if (selectionNode.kind === "InlineFragment") {
42053
- if (isFragmentApplicable$a(selectionNode, source.data.__typename)) {
42054
- // Get selections out of the inline fragment
42055
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
42056
- // Call into field handling with selections
42057
- Object.assign(sink, buildSelectionForNode$9(source, reader, parentNode, fragmentSelection, variables, fragments));
42058
- });
42059
- }
42060
- }
42061
- if (selectionNode.kind === "FragmentSpread") {
42062
- const namedFragment = fragments[selectionNode.name.value];
42063
- if (namedFragment && isFragmentApplicable$a(namedFragment, source.data.__typename)) {
42064
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
42065
- // Call into field handling with selections
42066
- Object.assign(sink, buildSelectionForNode$9(source, reader, parentNode, fragmentSelection, variables, fragments));
42067
- });
42068
- }
42069
- }
42070
- if (selectionNode.kind === "Field") {
42071
- Object.assign(sink, buildSelectionForField$9(source, reader, selectionNode, variables, fragments));
42072
- }
42073
- return sink;
39913
+ function buildSelectionForNode$a(source, reader, parentNode, selectionNode, variables, fragments) {
39914
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$a, buildSelectionForField$a);
42074
39915
  }
42075
39916
  function select$i(field, variables, fragments) {
42076
39917
  return (source, reader) => {
42077
39918
  var _a;
42078
39919
  const sink = {};
42079
39920
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
42080
- const builtSelection = buildSelectionForNode$9(source, reader, field, sel, variables, fragments);
39921
+ const builtSelection = buildSelectionForNode$a(source, reader, field, sel, variables, fragments);
42081
39922
  if (builtSelection !== undefined) {
42082
39923
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
42083
39924
  Object.keys(builtSelection).forEach((key, value) => {
@@ -42480,79 +40321,18 @@
42480
40321
  }
42481
40322
  return sink;
42482
40323
  }
42483
- function buildSelectionForField$8(source, reader, sel, variables, fragments) {
42484
- const sink = {};
42485
- const fieldData = getFieldData$8(source, sel, variables);
42486
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
42487
- reader.enterPath(requestedFieldName);
42488
- if (fieldData === undefined) {
42489
- reader.markMissing();
42490
- reader.exitPath();
42491
- return;
42492
- }
42493
- if (fieldData === null) {
42494
- reader.assignScalar(requestedFieldName, sink, fieldData);
42495
- return sink;
42496
- }
42497
- const fieldType = getFieldType$s(sel);
42498
- if (fieldType === undefined) {
42499
- // This field's type is unknown to us. This breaks normalization.
42500
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
42501
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
42502
- }
42503
- else if (fieldType.isArray) {
42504
- const arraySink = [];
42505
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
42506
- reader.enterPath(i);
42507
- selectType$8(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
42508
- reader.exitPath();
42509
- }
42510
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
42511
- }
42512
- else {
42513
- selectType$8(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
42514
- }
42515
- reader.exitPath();
42516
- return sink;
40324
+ function buildSelectionForField$9(source, reader, sel, variables, fragments) {
40325
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$8, getFieldType$s, selectType$8);
42517
40326
  }
42518
- function buildSelectionForNode$8(source, reader, parentNode, selectionNode, variables, fragments) {
42519
- const sink = {};
42520
- if (selectionNode.directives) {
42521
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
42522
- if (selectionWithDirectives === undefined) {
42523
- return;
42524
- }
42525
- selectionNode = selectionWithDirectives;
42526
- }
42527
- if (selectionNode.kind === "InlineFragment") {
42528
- if (isFragmentApplicable$9(selectionNode, source.data.__typename)) {
42529
- // Get selections out of the inline fragment
42530
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
42531
- // Call into field handling with selections
42532
- Object.assign(sink, buildSelectionForNode$8(source, reader, parentNode, fragmentSelection, variables, fragments));
42533
- });
42534
- }
42535
- }
42536
- if (selectionNode.kind === "FragmentSpread") {
42537
- const namedFragment = fragments[selectionNode.name.value];
42538
- if (namedFragment && isFragmentApplicable$9(namedFragment, source.data.__typename)) {
42539
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
42540
- // Call into field handling with selections
42541
- Object.assign(sink, buildSelectionForNode$8(source, reader, parentNode, fragmentSelection, variables, fragments));
42542
- });
42543
- }
42544
- }
42545
- if (selectionNode.kind === "Field") {
42546
- Object.assign(sink, buildSelectionForField$8(source, reader, selectionNode, variables));
42547
- }
42548
- return sink;
40327
+ function buildSelectionForNode$9(source, reader, parentNode, selectionNode, variables, fragments) {
40328
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$9, buildSelectionForField$9);
42549
40329
  }
42550
40330
  function select$h(field, variables, fragments) {
42551
40331
  return (source, reader) => {
42552
40332
  var _a;
42553
40333
  const sink = {};
42554
40334
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
42555
- const builtSelection = buildSelectionForNode$8(source, reader, field, sel, variables, fragments);
40335
+ const builtSelection = buildSelectionForNode$9(source, reader, field, sel, variables, fragments);
42556
40336
  if (builtSelection !== undefined) {
42557
40337
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
42558
40338
  Object.keys(builtSelection).forEach((key, value) => {
@@ -42724,79 +40504,18 @@
42724
40504
  }
42725
40505
  return sink;
42726
40506
  }
42727
- function buildSelectionForField$7(source, reader, sel, variables, fragments) {
42728
- const sink = {};
42729
- const fieldData = getFieldData$7(source, sel, variables);
42730
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
42731
- reader.enterPath(requestedFieldName);
42732
- if (fieldData === undefined) {
42733
- reader.markMissing();
42734
- reader.exitPath();
42735
- return;
42736
- }
42737
- if (fieldData === null) {
42738
- reader.assignScalar(requestedFieldName, sink, fieldData);
42739
- return sink;
42740
- }
42741
- const fieldType = getFieldType$r(sel);
42742
- if (fieldType === undefined) {
42743
- // This field's type is unknown to us. This breaks normalization.
42744
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
42745
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
42746
- }
42747
- else if (fieldType.isArray) {
42748
- const arraySink = [];
42749
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
42750
- reader.enterPath(i);
42751
- selectType$7(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
42752
- reader.exitPath();
42753
- }
42754
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
42755
- }
42756
- else {
42757
- selectType$7(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
42758
- }
42759
- reader.exitPath();
42760
- return sink;
40507
+ function buildSelectionForField$8(source, reader, sel, variables, fragments) {
40508
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$7, getFieldType$r, selectType$7);
42761
40509
  }
42762
- function buildSelectionForNode$7(source, reader, parentNode, selectionNode, variables, fragments) {
42763
- const sink = {};
42764
- if (selectionNode.directives) {
42765
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
42766
- if (selectionWithDirectives === undefined) {
42767
- return;
42768
- }
42769
- selectionNode = selectionWithDirectives;
42770
- }
42771
- if (selectionNode.kind === "InlineFragment") {
42772
- if (isFragmentApplicable$8(selectionNode, source.data.__typename)) {
42773
- // Get selections out of the inline fragment
42774
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
42775
- // Call into field handling with selections
42776
- Object.assign(sink, buildSelectionForNode$7(source, reader, parentNode, fragmentSelection, variables, fragments));
42777
- });
42778
- }
42779
- }
42780
- if (selectionNode.kind === "FragmentSpread") {
42781
- const namedFragment = fragments[selectionNode.name.value];
42782
- if (namedFragment && isFragmentApplicable$8(namedFragment, source.data.__typename)) {
42783
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
42784
- // Call into field handling with selections
42785
- Object.assign(sink, buildSelectionForNode$7(source, reader, parentNode, fragmentSelection, variables, fragments));
42786
- });
42787
- }
42788
- }
42789
- if (selectionNode.kind === "Field") {
42790
- Object.assign(sink, buildSelectionForField$7(source, reader, selectionNode, variables));
42791
- }
42792
- return sink;
40510
+ function buildSelectionForNode$8(source, reader, parentNode, selectionNode, variables, fragments) {
40511
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$8, buildSelectionForField$8);
42793
40512
  }
42794
40513
  function select$g(field, variables, fragments) {
42795
40514
  return (source, reader) => {
42796
40515
  var _a;
42797
40516
  const sink = {};
42798
40517
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
42799
- const builtSelection = buildSelectionForNode$7(source, reader, field, sel, variables, fragments);
40518
+ const builtSelection = buildSelectionForNode$8(source, reader, field, sel, variables, fragments);
42800
40519
  if (builtSelection !== undefined) {
42801
40520
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
42802
40521
  Object.keys(builtSelection).forEach((key, value) => {
@@ -43061,79 +40780,18 @@
43061
40780
  }
43062
40781
  return sink;
43063
40782
  }
43064
- function buildSelectionForField$6(source, reader, sel, variables, fragments) {
43065
- const sink = {};
43066
- const fieldData = getFieldData$6(source, sel, variables);
43067
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
43068
- reader.enterPath(requestedFieldName);
43069
- if (fieldData === undefined) {
43070
- reader.markMissing();
43071
- reader.exitPath();
43072
- return;
43073
- }
43074
- if (fieldData === null) {
43075
- reader.assignScalar(requestedFieldName, sink, fieldData);
43076
- return sink;
43077
- }
43078
- const fieldType = getFieldType$q(sel);
43079
- if (fieldType === undefined) {
43080
- // This field's type is unknown to us. This breaks normalization.
43081
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
43082
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
43083
- }
43084
- else if (fieldType.isArray) {
43085
- const arraySink = [];
43086
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
43087
- reader.enterPath(i);
43088
- selectType$6(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
43089
- reader.exitPath();
43090
- }
43091
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
43092
- }
43093
- else {
43094
- selectType$6(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
43095
- }
43096
- reader.exitPath();
43097
- return sink;
40783
+ function buildSelectionForField$7(source, reader, sel, variables, fragments) {
40784
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$6, getFieldType$q, selectType$6);
43098
40785
  }
43099
- function buildSelectionForNode$6(source, reader, parentNode, selectionNode, variables, fragments) {
43100
- const sink = {};
43101
- if (selectionNode.directives) {
43102
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
43103
- if (selectionWithDirectives === undefined) {
43104
- return;
43105
- }
43106
- selectionNode = selectionWithDirectives;
43107
- }
43108
- if (selectionNode.kind === "InlineFragment") {
43109
- if (isFragmentApplicable$7(selectionNode, source.data.__typename)) {
43110
- // Get selections out of the inline fragment
43111
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
43112
- // Call into field handling with selections
43113
- Object.assign(sink, buildSelectionForNode$6(source, reader, parentNode, fragmentSelection, variables, fragments));
43114
- });
43115
- }
43116
- }
43117
- if (selectionNode.kind === "FragmentSpread") {
43118
- const namedFragment = fragments[selectionNode.name.value];
43119
- if (namedFragment && isFragmentApplicable$7(namedFragment, source.data.__typename)) {
43120
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
43121
- // Call into field handling with selections
43122
- Object.assign(sink, buildSelectionForNode$6(source, reader, parentNode, fragmentSelection, variables, fragments));
43123
- });
43124
- }
43125
- }
43126
- if (selectionNode.kind === "Field") {
43127
- Object.assign(sink, buildSelectionForField$6(source, reader, selectionNode, variables, fragments));
43128
- }
43129
- return sink;
40786
+ function buildSelectionForNode$7(source, reader, parentNode, selectionNode, variables, fragments) {
40787
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$7, buildSelectionForField$7);
43130
40788
  }
43131
40789
  function select$f(field, variables, fragments) {
43132
40790
  return (source, reader) => {
43133
40791
  var _a;
43134
40792
  const sink = {};
43135
40793
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
43136
- const builtSelection = buildSelectionForNode$6(source, reader, field, sel, variables, fragments);
40794
+ const builtSelection = buildSelectionForNode$7(source, reader, field, sel, variables, fragments);
43137
40795
  if (builtSelection !== undefined) {
43138
40796
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
43139
40797
  Object.keys(builtSelection).forEach((key, value) => {
@@ -43560,79 +41218,18 @@
43560
41218
  }
43561
41219
  return sink;
43562
41220
  }
43563
- function buildSelectionForField$5(source, reader, sel, variables, fragments) {
43564
- const sink = {};
43565
- const fieldData = getFieldData$5(source, sel, variables);
43566
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
43567
- reader.enterPath(requestedFieldName);
43568
- if (fieldData === undefined) {
43569
- reader.markMissing();
43570
- reader.exitPath();
43571
- return;
43572
- }
43573
- if (fieldData === null) {
43574
- reader.assignScalar(requestedFieldName, sink, fieldData);
43575
- return sink;
43576
- }
43577
- const fieldType = getFieldType$p(sel);
43578
- if (fieldType === undefined) {
43579
- // This field's type is unknown to us. This breaks normalization.
43580
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
43581
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
43582
- }
43583
- else if (fieldType.isArray) {
43584
- const arraySink = [];
43585
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
43586
- reader.enterPath(i);
43587
- selectType$5(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
43588
- reader.exitPath();
43589
- }
43590
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
43591
- }
43592
- else {
43593
- selectType$5(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
43594
- }
43595
- reader.exitPath();
43596
- return sink;
41221
+ function buildSelectionForField$6(source, reader, sel, variables, fragments) {
41222
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$5, getFieldType$p, selectType$5);
43597
41223
  }
43598
- function buildSelectionForNode$5(source, reader, parentNode, selectionNode, variables, fragments) {
43599
- const sink = {};
43600
- if (selectionNode.directives) {
43601
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
43602
- if (selectionWithDirectives === undefined) {
43603
- return;
43604
- }
43605
- selectionNode = selectionWithDirectives;
43606
- }
43607
- if (selectionNode.kind === "InlineFragment") {
43608
- if (isFragmentApplicable$6(selectionNode, source.data.__typename)) {
43609
- // Get selections out of the inline fragment
43610
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
43611
- // Call into field handling with selections
43612
- Object.assign(sink, buildSelectionForNode$5(source, reader, parentNode, fragmentSelection, variables, fragments));
43613
- });
43614
- }
43615
- }
43616
- if (selectionNode.kind === "FragmentSpread") {
43617
- const namedFragment = fragments[selectionNode.name.value];
43618
- if (namedFragment && isFragmentApplicable$6(namedFragment, source.data.__typename)) {
43619
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
43620
- // Call into field handling with selections
43621
- Object.assign(sink, buildSelectionForNode$5(source, reader, parentNode, fragmentSelection, variables, fragments));
43622
- });
43623
- }
43624
- }
43625
- if (selectionNode.kind === "Field") {
43626
- Object.assign(sink, buildSelectionForField$5(source, reader, selectionNode, variables));
43627
- }
43628
- return sink;
41224
+ function buildSelectionForNode$6(source, reader, parentNode, selectionNode, variables, fragments) {
41225
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$6, buildSelectionForField$6);
43629
41226
  }
43630
41227
  function select$e(field, variables, fragments) {
43631
41228
  return (source, reader) => {
43632
41229
  var _a;
43633
41230
  const sink = {};
43634
41231
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
43635
- const builtSelection = buildSelectionForNode$5(source, reader, field, sel, variables, fragments);
41232
+ const builtSelection = buildSelectionForNode$6(source, reader, field, sel, variables, fragments);
43636
41233
  if (builtSelection !== undefined) {
43637
41234
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
43638
41235
  Object.keys(builtSelection).forEach((key, value) => {
@@ -43798,79 +41395,18 @@
43798
41395
  }
43799
41396
  return sink;
43800
41397
  }
43801
- function buildSelectionForField$4(source, reader, sel, variables, fragments) {
43802
- const sink = {};
43803
- const fieldData = getFieldData$4(source, sel, variables);
43804
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
43805
- reader.enterPath(requestedFieldName);
43806
- if (fieldData === undefined) {
43807
- reader.markMissing();
43808
- reader.exitPath();
43809
- return;
43810
- }
43811
- if (fieldData === null) {
43812
- reader.assignScalar(requestedFieldName, sink, fieldData);
43813
- return sink;
43814
- }
43815
- const fieldType = getFieldType$o(sel);
43816
- if (fieldType === undefined) {
43817
- // This field's type is unknown to us. This breaks normalization.
43818
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
43819
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
43820
- }
43821
- else if (fieldType.isArray) {
43822
- const arraySink = [];
43823
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
43824
- reader.enterPath(i);
43825
- selectType$4(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
43826
- reader.exitPath();
43827
- }
43828
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
43829
- }
43830
- else {
43831
- selectType$4(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
43832
- }
43833
- reader.exitPath();
43834
- return sink;
41398
+ function buildSelectionForField$5(source, reader, sel, variables, fragments) {
41399
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$4, getFieldType$o, selectType$4);
43835
41400
  }
43836
- function buildSelectionForNode$4(source, reader, parentNode, selectionNode, variables, fragments) {
43837
- const sink = {};
43838
- if (selectionNode.directives) {
43839
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
43840
- if (selectionWithDirectives === undefined) {
43841
- return;
43842
- }
43843
- selectionNode = selectionWithDirectives;
43844
- }
43845
- if (selectionNode.kind === "InlineFragment") {
43846
- if (isFragmentApplicable$5(selectionNode, source.data.__typename)) {
43847
- // Get selections out of the inline fragment
43848
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
43849
- // Call into field handling with selections
43850
- Object.assign(sink, buildSelectionForNode$4(source, reader, parentNode, fragmentSelection, variables, fragments));
43851
- });
43852
- }
43853
- }
43854
- if (selectionNode.kind === "FragmentSpread") {
43855
- const namedFragment = fragments[selectionNode.name.value];
43856
- if (namedFragment && isFragmentApplicable$5(namedFragment, source.data.__typename)) {
43857
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
43858
- // Call into field handling with selections
43859
- Object.assign(sink, buildSelectionForNode$4(source, reader, parentNode, fragmentSelection, variables, fragments));
43860
- });
43861
- }
43862
- }
43863
- if (selectionNode.kind === "Field") {
43864
- Object.assign(sink, buildSelectionForField$4(source, reader, selectionNode, variables));
43865
- }
43866
- return sink;
41401
+ function buildSelectionForNode$5(source, reader, parentNode, selectionNode, variables, fragments) {
41402
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$5, buildSelectionForField$5);
43867
41403
  }
43868
41404
  function select$d(field, variables, fragments) {
43869
41405
  return (source, reader) => {
43870
41406
  var _a;
43871
41407
  const sink = {};
43872
41408
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
43873
- const builtSelection = buildSelectionForNode$4(source, reader, field, sel, variables, fragments);
41409
+ const builtSelection = buildSelectionForNode$5(source, reader, field, sel, variables, fragments);
43874
41410
  if (builtSelection !== undefined) {
43875
41411
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
43876
41412
  Object.keys(builtSelection).forEach((key, value) => {
@@ -44065,79 +41601,18 @@
44065
41601
  }
44066
41602
  return sink;
44067
41603
  }
44068
- function buildSelectionForField$3(source, reader, sel, variables, fragments) {
44069
- const sink = {};
44070
- const fieldData = getFieldData$3(source, sel, variables);
44071
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
44072
- reader.enterPath(requestedFieldName);
44073
- if (fieldData === undefined) {
44074
- reader.markMissing();
44075
- reader.exitPath();
44076
- return;
44077
- }
44078
- if (fieldData === null) {
44079
- reader.assignScalar(requestedFieldName, sink, fieldData);
44080
- return sink;
44081
- }
44082
- const fieldType = getFieldType$n(sel);
44083
- if (fieldType === undefined) {
44084
- // This field's type is unknown to us. This breaks normalization.
44085
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
44086
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
44087
- }
44088
- else if (fieldType.isArray) {
44089
- const arraySink = [];
44090
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
44091
- reader.enterPath(i);
44092
- selectType$3(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
44093
- reader.exitPath();
44094
- }
44095
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
44096
- }
44097
- else {
44098
- selectType$3(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
44099
- }
44100
- reader.exitPath();
44101
- return sink;
41604
+ function buildSelectionForField$4(source, reader, sel, variables, fragments) {
41605
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$3, getFieldType$n, selectType$3);
44102
41606
  }
44103
- function buildSelectionForNode$3(source, reader, parentNode, selectionNode, variables, fragments) {
44104
- const sink = {};
44105
- if (selectionNode.directives) {
44106
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
44107
- if (selectionWithDirectives === undefined) {
44108
- return;
44109
- }
44110
- selectionNode = selectionWithDirectives;
44111
- }
44112
- if (selectionNode.kind === "InlineFragment") {
44113
- if (isFragmentApplicable$4(selectionNode, source.data.__typename)) {
44114
- // Get selections out of the inline fragment
44115
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
44116
- // Call into field handling with selections
44117
- Object.assign(sink, buildSelectionForNode$3(source, reader, parentNode, fragmentSelection, variables, fragments));
44118
- });
44119
- }
44120
- }
44121
- if (selectionNode.kind === "FragmentSpread") {
44122
- const namedFragment = fragments[selectionNode.name.value];
44123
- if (namedFragment && isFragmentApplicable$4(namedFragment, source.data.__typename)) {
44124
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
44125
- // Call into field handling with selections
44126
- Object.assign(sink, buildSelectionForNode$3(source, reader, parentNode, fragmentSelection, variables, fragments));
44127
- });
44128
- }
44129
- }
44130
- if (selectionNode.kind === "Field") {
44131
- Object.assign(sink, buildSelectionForField$3(source, reader, selectionNode, variables, fragments));
44132
- }
44133
- return sink;
41607
+ function buildSelectionForNode$4(source, reader, parentNode, selectionNode, variables, fragments) {
41608
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$4, buildSelectionForField$4);
44134
41609
  }
44135
41610
  function select$c(field, variables, fragments) {
44136
41611
  return (source, reader) => {
44137
41612
  var _a;
44138
41613
  const sink = {};
44139
41614
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
44140
- const builtSelection = buildSelectionForNode$3(source, reader, field, sel, variables, fragments);
41615
+ const builtSelection = buildSelectionForNode$4(source, reader, field, sel, variables, fragments);
44141
41616
  if (builtSelection !== undefined) {
44142
41617
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
44143
41618
  Object.keys(builtSelection).forEach((key, value) => {
@@ -44454,79 +41929,18 @@
44454
41929
  }
44455
41930
  return sink;
44456
41931
  }
44457
- function buildSelectionForField$2(source, reader, sel, variables, fragments) {
44458
- const sink = {};
44459
- const fieldData = getFieldData$2(source, sel, variables);
44460
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
44461
- reader.enterPath(requestedFieldName);
44462
- if (fieldData === undefined) {
44463
- reader.markMissing();
44464
- reader.exitPath();
44465
- return;
44466
- }
44467
- if (fieldData === null) {
44468
- reader.assignScalar(requestedFieldName, sink, fieldData);
44469
- return sink;
44470
- }
44471
- const fieldType = getFieldType$m(sel);
44472
- if (fieldType === undefined) {
44473
- // This field's type is unknown to us. This breaks normalization.
44474
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
44475
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
44476
- }
44477
- else if (fieldType.isArray) {
44478
- const arraySink = [];
44479
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
44480
- reader.enterPath(i);
44481
- selectType$2(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
44482
- reader.exitPath();
44483
- }
44484
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
44485
- }
44486
- else {
44487
- selectType$2(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
44488
- }
44489
- reader.exitPath();
44490
- return sink;
41932
+ function buildSelectionForField$3(source, reader, sel, variables, fragments) {
41933
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$2, getFieldType$m, selectType$2);
44491
41934
  }
44492
- function buildSelectionForNode$2(source, reader, parentNode, selectionNode, variables, fragments) {
44493
- const sink = {};
44494
- if (selectionNode.directives) {
44495
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
44496
- if (selectionWithDirectives === undefined) {
44497
- return;
44498
- }
44499
- selectionNode = selectionWithDirectives;
44500
- }
44501
- if (selectionNode.kind === "InlineFragment") {
44502
- if (isFragmentApplicable$3(selectionNode, source.data.__typename)) {
44503
- // Get selections out of the inline fragment
44504
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
44505
- // Call into field handling with selections
44506
- Object.assign(sink, buildSelectionForNode$2(source, reader, parentNode, fragmentSelection, variables, fragments));
44507
- });
44508
- }
44509
- }
44510
- if (selectionNode.kind === "FragmentSpread") {
44511
- const namedFragment = fragments[selectionNode.name.value];
44512
- if (namedFragment && isFragmentApplicable$3(namedFragment, source.data.__typename)) {
44513
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
44514
- // Call into field handling with selections
44515
- Object.assign(sink, buildSelectionForNode$2(source, reader, parentNode, fragmentSelection, variables, fragments));
44516
- });
44517
- }
44518
- }
44519
- if (selectionNode.kind === "Field") {
44520
- Object.assign(sink, buildSelectionForField$2(source, reader, selectionNode, variables, fragments));
44521
- }
44522
- return sink;
41935
+ function buildSelectionForNode$3(source, reader, parentNode, selectionNode, variables, fragments) {
41936
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$3, buildSelectionForField$3);
44523
41937
  }
44524
41938
  function select$b(field, variables, fragments) {
44525
41939
  return (source, reader) => {
44526
41940
  var _a;
44527
41941
  const sink = {};
44528
41942
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
44529
- const builtSelection = buildSelectionForNode$2(source, reader, field, sel, variables, fragments);
41943
+ const builtSelection = buildSelectionForNode$3(source, reader, field, sel, variables, fragments);
44530
41944
  if (builtSelection !== undefined) {
44531
41945
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
44532
41946
  Object.keys(builtSelection).forEach((key, value) => {
@@ -44783,79 +42197,18 @@
44783
42197
  }
44784
42198
  return sink;
44785
42199
  }
44786
- function buildSelectionForField$1(source, reader, sel, variables, fragments) {
44787
- const sink = {};
44788
- const fieldData = getFieldData$1(source, sel, variables);
44789
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
44790
- reader.enterPath(requestedFieldName);
44791
- if (fieldData === undefined) {
44792
- reader.markMissing();
44793
- reader.exitPath();
44794
- return;
44795
- }
44796
- if (fieldData === null) {
44797
- reader.assignScalar(requestedFieldName, sink, fieldData);
44798
- return sink;
44799
- }
44800
- const fieldType = getFieldType$l(sel);
44801
- if (fieldType === undefined) {
44802
- // This field's type is unknown to us. This breaks normalization.
44803
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
44804
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
44805
- }
44806
- else if (fieldType.isArray) {
44807
- const arraySink = [];
44808
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
44809
- reader.enterPath(i);
44810
- selectType$1(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
44811
- reader.exitPath();
44812
- }
44813
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
44814
- }
44815
- else {
44816
- selectType$1(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
44817
- }
44818
- reader.exitPath();
44819
- return sink;
42200
+ function buildSelectionForField$2(source, reader, sel, variables, fragments) {
42201
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$1, getFieldType$l, selectType$1);
44820
42202
  }
44821
- function buildSelectionForNode$1(source, reader, parentNode, selectionNode, variables, fragments) {
44822
- const sink = {};
44823
- if (selectionNode.directives) {
44824
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
44825
- if (selectionWithDirectives === undefined) {
44826
- return;
44827
- }
44828
- selectionNode = selectionWithDirectives;
44829
- }
44830
- if (selectionNode.kind === "InlineFragment") {
44831
- if (isFragmentApplicable$2(selectionNode, source.data.__typename)) {
44832
- // Get selections out of the inline fragment
44833
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
44834
- // Call into field handling with selections
44835
- Object.assign(sink, buildSelectionForNode$1(source, reader, parentNode, fragmentSelection, variables, fragments));
44836
- });
44837
- }
44838
- }
44839
- if (selectionNode.kind === "FragmentSpread") {
44840
- const namedFragment = fragments[selectionNode.name.value];
44841
- if (namedFragment && isFragmentApplicable$2(namedFragment, source.data.__typename)) {
44842
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
44843
- // Call into field handling with selections
44844
- Object.assign(sink, buildSelectionForNode$1(source, reader, parentNode, fragmentSelection, variables, fragments));
44845
- });
44846
- }
44847
- }
44848
- if (selectionNode.kind === "Field") {
44849
- Object.assign(sink, buildSelectionForField$1(source, reader, selectionNode, variables));
44850
- }
44851
- return sink;
42203
+ function buildSelectionForNode$2(source, reader, parentNode, selectionNode, variables, fragments) {
42204
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$2, buildSelectionForField$2);
44852
42205
  }
44853
42206
  function select$a(field, variables, fragments) {
44854
42207
  return (source, reader) => {
44855
42208
  var _a;
44856
42209
  const sink = {};
44857
42210
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
44858
- const builtSelection = buildSelectionForNode$1(source, reader, field, sel, variables, fragments);
42211
+ const builtSelection = buildSelectionForNode$2(source, reader, field, sel, variables, fragments);
44859
42212
  if (builtSelection !== undefined) {
44860
42213
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
44861
42214
  Object.keys(builtSelection).forEach((key, value) => {
@@ -45065,79 +42418,18 @@
45065
42418
  }
45066
42419
  return sink;
45067
42420
  }
45068
- function buildSelectionForField(source, reader, sel, variables, fragments) {
45069
- const sink = {};
45070
- const fieldData = getFieldData(source, sel, variables);
45071
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
45072
- reader.enterPath(requestedFieldName);
45073
- if (fieldData === undefined) {
45074
- reader.markMissing();
45075
- reader.exitPath();
45076
- return;
45077
- }
45078
- if (fieldData === null) {
45079
- reader.assignScalar(requestedFieldName, sink, fieldData);
45080
- return sink;
45081
- }
45082
- const fieldType = getFieldType$k(sel);
45083
- if (fieldType === undefined) {
45084
- // This field's type is unknown to us. This breaks normalization.
45085
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
45086
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
45087
- }
45088
- else if (fieldType.isArray) {
45089
- const arraySink = [];
45090
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
45091
- reader.enterPath(i);
45092
- selectType(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
45093
- reader.exitPath();
45094
- }
45095
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
45096
- }
45097
- else {
45098
- selectType(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
45099
- }
45100
- reader.exitPath();
45101
- return sink;
42421
+ function buildSelectionForField$1(source, reader, sel, variables, fragments) {
42422
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData, getFieldType$k, selectType);
45102
42423
  }
45103
- function buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments) {
45104
- const sink = {};
45105
- if (selectionNode.directives) {
45106
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
45107
- if (selectionWithDirectives === undefined) {
45108
- return;
45109
- }
45110
- selectionNode = selectionWithDirectives;
45111
- }
45112
- if (selectionNode.kind === "InlineFragment") {
45113
- if (isFragmentApplicable$1(selectionNode, source.data.__typename)) {
45114
- // Get selections out of the inline fragment
45115
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
45116
- // Call into field handling with selections
45117
- Object.assign(sink, buildSelectionForNode(source, reader, parentNode, fragmentSelection, variables, fragments));
45118
- });
45119
- }
45120
- }
45121
- if (selectionNode.kind === "FragmentSpread") {
45122
- const namedFragment = fragments[selectionNode.name.value];
45123
- if (namedFragment && isFragmentApplicable$1(namedFragment, source.data.__typename)) {
45124
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
45125
- // Call into field handling with selections
45126
- Object.assign(sink, buildSelectionForNode(source, reader, parentNode, fragmentSelection, variables, fragments));
45127
- });
45128
- }
45129
- }
45130
- if (selectionNode.kind === "Field") {
45131
- Object.assign(sink, buildSelectionForField(source, reader, selectionNode, variables, fragments));
45132
- }
45133
- return sink;
42424
+ function buildSelectionForNode$1(source, reader, parentNode, selectionNode, variables, fragments) {
42425
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$1, buildSelectionForField$1);
45134
42426
  }
45135
42427
  function select$9(field, variables, fragments) {
45136
42428
  return (source, reader) => {
45137
42429
  var _a;
45138
42430
  const sink = {};
45139
42431
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
45140
- const builtSelection = buildSelectionForNode(source, reader, field, sel, variables, fragments);
42432
+ const builtSelection = buildSelectionForNode$1(source, reader, field, sel, variables, fragments);
45141
42433
  if (builtSelection !== undefined) {
45142
42434
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
45143
42435
  Object.keys(builtSelection).forEach((key, value) => {
@@ -46910,6 +44202,93 @@
46910
44202
  return sharedGetFragmentType(fragment, fragmentMap);
46911
44203
  }
46912
44204
 
44205
+ function applyToSelection$6(selection, directive, variables) {
44206
+ return selection;
44207
+ }
44208
+
44209
+ function applyToSelection$5(selection, directive, variables) {
44210
+ return selection;
44211
+ }
44212
+
44213
+ function applyToSelection$4(selection, directive, variables) {
44214
+ return selection;
44215
+ }
44216
+
44217
+ function applyToSelection$3(selection, directive, variables) {
44218
+ var _a;
44219
+ const ifArg = (_a = directive.arguments) === null || _a === void 0 ? void 0 : _a.find(argument => argument.name.value === "if");
44220
+ if (ifArg && ifArg.value) {
44221
+ if (ifArg.value.kind === "BooleanValue") {
44222
+ return ifArg.value.value ? selection : undefined;
44223
+ }
44224
+ if (ifArg.value.kind === "Variable") {
44225
+ return variables[ifArg.value.name.value] ? selection : undefined;
44226
+ }
44227
+ }
44228
+ return selection;
44229
+ }
44230
+
44231
+ function applyToSelection$2(selection, directive, variables) {
44232
+ var _a;
44233
+ const ifArg = (_a = directive.arguments) === null || _a === void 0 ? void 0 : _a.find(argument => argument.name.value === "if");
44234
+ if (ifArg && ifArg.value) {
44235
+ if (ifArg.value.kind === "BooleanValue") {
44236
+ return ifArg.value.value ? undefined : selection;
44237
+ }
44238
+ if (ifArg.value.kind === "Variable") {
44239
+ return variables[ifArg.value.name.value] ? undefined : selection;
44240
+ }
44241
+ }
44242
+ return selection;
44243
+ }
44244
+
44245
+ function applyToSelection$1(selection, directive, variables) {
44246
+ return selection;
44247
+ }
44248
+
44249
+ function applyToSelection(selection, directive, variables) {
44250
+ return selection;
44251
+ }
44252
+
44253
+ function applyDirectivesForSelection(selection, variables) {
44254
+ let result = selection;
44255
+ if (selection && selection.directives) {
44256
+ // iterate through directives in order. Directives _can_ be stacked.
44257
+ for (var i = 0; i < selection.directives.length; i++) {
44258
+ const directive = selection.directives[i];
44259
+ switch (directive.name.value) {
44260
+ // Generate Case for each directive in the schema that supports SelectionNodes
44261
+ case ("generic"):
44262
+ result = applyToSelection$6(selection);
44263
+ break;
44264
+ case ("fieldCategory"):
44265
+ result = applyToSelection$5(selection);
44266
+ break;
44267
+ case ("category"):
44268
+ result = applyToSelection$4(selection);
44269
+ break;
44270
+ case ("include"):
44271
+ result = applyToSelection$3(selection, directive, variables);
44272
+ break;
44273
+ case ("skip"):
44274
+ result = applyToSelection$2(selection, directive, variables);
44275
+ break;
44276
+ case ("deprecated"):
44277
+ result = applyToSelection$1(selection);
44278
+ break;
44279
+ case ("specifiedBy"):
44280
+ result = applyToSelection(selection);
44281
+ break;
44282
+ }
44283
+ if (result === undefined) {
44284
+ // Selection was removed.
44285
+ break;
44286
+ }
44287
+ }
44288
+ }
44289
+ return result;
44290
+ }
44291
+
46913
44292
  function createLink(ref) {
46914
44293
  return {
46915
44294
  __ref: engine.serializeStructuredKey(ref),
@@ -47674,6 +45053,76 @@
47674
45053
  const doesImplementInterface = !isUntypedInlineFragment && implementedInterfaces.includes(fragmentNode.typeCondition.name.value);
47675
45054
  const typenameMatchesCondition = typename !== undefined && !isUntypedInlineFragment && typename === fragmentNode.typeCondition.name.value;
47676
45055
  return isUntypedInlineFragment || matchesTypeCondition || doesImplementInterface || typenameMatchesCondition;
45056
+ }
45057
+ function buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable, buildSelectionForField) {
45058
+ const sink = {};
45059
+ if (selectionNode.directives) {
45060
+ const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
45061
+ if (selectionWithDirectives === undefined) {
45062
+ return;
45063
+ }
45064
+ selectionNode = selectionWithDirectives;
45065
+ }
45066
+ if (selectionNode.kind === "InlineFragment") {
45067
+ if (isFragmentApplicable(selectionNode, source.data.__typename)) {
45068
+ // Get selections out of the inline fragment
45069
+ selectionNode.selectionSet.selections.forEach(fragmentSelection => {
45070
+ // Call into field handling with selections
45071
+ Object.assign(sink, buildSelectionForNode(source, reader, parentNode, fragmentSelection, variables, fragments, isFragmentApplicable, buildSelectionForField));
45072
+ });
45073
+ }
45074
+ }
45075
+ if (selectionNode.kind === "FragmentSpread") {
45076
+ const namedFragment = fragments[selectionNode.name.value];
45077
+ if (namedFragment && isFragmentApplicable(namedFragment, source.data.__typename)) {
45078
+ namedFragment.selectionSet.selections.forEach(fragmentSelection => {
45079
+ // Call into field handling with selections
45080
+ Object.assign(sink, buildSelectionForNode(source, reader, parentNode, fragmentSelection, variables, fragments, isFragmentApplicable, buildSelectionForField));
45081
+ });
45082
+ }
45083
+ }
45084
+ if (selectionNode.kind === "Field") {
45085
+ Object.assign(sink, buildSelectionForField(source, reader, selectionNode, variables, fragments));
45086
+ }
45087
+ return sink;
45088
+ }
45089
+ function buildSelectionForField(source, reader, sel, variables, fragments, isCursorConnectionType, getFieldData, getFieldType, selectType) {
45090
+ const sink = {};
45091
+ const fieldData = getFieldData(source, sel, variables);
45092
+ const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
45093
+ if (isCursorConnectionType && requestedFieldName === 'pageInfo') {
45094
+ return;
45095
+ }
45096
+ reader.enterPath(requestedFieldName);
45097
+ if (fieldData === undefined) {
45098
+ reader.markMissing();
45099
+ reader.exitPath();
45100
+ return;
45101
+ }
45102
+ if (fieldData === null) {
45103
+ reader.assignScalar(requestedFieldName, sink, fieldData);
45104
+ return sink;
45105
+ }
45106
+ const fieldType = getFieldType(sel);
45107
+ if (fieldType === undefined) {
45108
+ // This field's type is unknown to us. This breaks normalization.
45109
+ console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
45110
+ reader.assignNonScalar(sink, requestedFieldName, fieldData);
45111
+ }
45112
+ else if (fieldType.isArray) {
45113
+ const arraySink = [];
45114
+ for (let i = 0, len = fieldData.length; i < len; i += 1) {
45115
+ reader.enterPath(i);
45116
+ selectType(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
45117
+ reader.exitPath();
45118
+ }
45119
+ reader.assignNonScalar(sink, requestedFieldName, arraySink);
45120
+ }
45121
+ else {
45122
+ selectType(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
45123
+ }
45124
+ reader.exitPath();
45125
+ return sink;
47677
45126
  }
47678
45127
 
47679
45128
  const TTL$5 = 900000;