@salesforce/lds-worker-api 1.114.4 → 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.
@@ -3655,7 +3655,7 @@
3655
3655
  return this.environment.buildStructuredKey(namespace, representationName, idValues);
3656
3656
  }
3657
3657
  }
3658
- // engine version: 0.137.1-cdbdc5cd
3658
+ // engine version: 0.137.4-ec6f5c6d
3659
3659
 
3660
3660
  /**
3661
3661
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -3782,7 +3782,7 @@
3782
3782
  }
3783
3783
  callbacks.push(callback);
3784
3784
  }
3785
- // version: 1.114.4-844684b4c
3785
+ // version: 1.114.6-435b32f3e
3786
3786
 
3787
3787
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
3788
3788
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15206,7 +15206,7 @@
15206
15206
  updateReferenceMapWithKnownKey(ast, luvioDocumentNode);
15207
15207
  return luvioDocumentNode;
15208
15208
  }
15209
- // version: 1.114.4-844684b4c
15209
+ // version: 1.114.6-435b32f3e
15210
15210
 
15211
15211
  function unwrap(data) {
15212
15212
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16119,7 +16119,7 @@
16119
16119
  const { apiFamily, name } = metadata;
16120
16120
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16121
16121
  }
16122
- // version: 1.114.4-844684b4c
16122
+ // version: 1.114.6-435b32f3e
16123
16123
 
16124
16124
  /**
16125
16125
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -16202,7 +16202,7 @@
16202
16202
  ({
16203
16203
  state: FragmentReadResultState.Missing,
16204
16204
  });
16205
- // engine version: 0.137.1-cdbdc5cd
16205
+ // engine version: 0.137.4-ec6f5c6d
16206
16206
 
16207
16207
  const { keys: ObjectKeys$3, freeze: ObjectFreeze$3, create: ObjectCreate$3 } = Object;
16208
16208
 
@@ -44353,7 +44353,7 @@
44353
44353
  dropFunction: instrumentation$2.notifyRecordUpdateAvailableDropped,
44354
44354
  });
44355
44355
  });
44356
- // version: 1.114.4-efecf667d
44356
+ // version: 1.114.6-f2429e60e
44357
44357
 
44358
44358
  var caseSensitiveUserId = '005B0000000GR4OIAW';
44359
44359
 
@@ -49574,11 +49574,11 @@
49574
49574
  mergeActions(targetActionId, sourceActionId) {
49575
49575
  // ids must be unique
49576
49576
  if (targetActionId === sourceActionId) {
49577
- return Promise.reject(new Error('target and source action ids cannot be the same'));
49577
+ return Promise.reject(new Error('targetActionId and sourceActionId cannot be the same.'));
49578
49578
  }
49579
49579
  // cannot have a replace action already in progress
49580
49580
  if (this.replacingAction !== undefined) {
49581
- return Promise.reject(new Error('Cannot replace actions while a replace action is in progress'));
49581
+ return Promise.reject(new Error('Cannot merge actions while a replace/merge action operation is in progress.'));
49582
49582
  }
49583
49583
  this.stopQueueManually();
49584
49584
  const promise = this.getQueueActions().then(async (actions) => {
@@ -49586,13 +49586,13 @@
49586
49586
  if (target === undefined) {
49587
49587
  this.replacingAction = undefined;
49588
49588
  await this.startQueueSafe();
49589
- throw Error('No action to replace');
49589
+ throw Error('targetActionId not found in the draft queue.');
49590
49590
  }
49591
49591
  const source = actions.find((action) => action.id === sourceActionId);
49592
49592
  if (source === undefined) {
49593
49593
  this.replacingAction = undefined;
49594
49594
  await this.startQueueSafe();
49595
- throw Error('No action to replace');
49595
+ throw Error('sourceActionId not found in the draft queue.');
49596
49596
  }
49597
49597
  // put in a try/finally block so we don't leave this.replacingAction
49598
49598
  // indefinitely set
@@ -55940,28 +55940,28 @@
55940
55940
  const { method: sourceMethod, body: sourceBody } = sourceData;
55941
55941
  // pre-requisites
55942
55942
  if (targetCacheKey !== sourceCacheKey) {
55943
- throw Error('Cannot merge actions for different targetIds');
55943
+ throw Error('Cannot merge actions for different targetIds.');
55944
55944
  }
55945
55945
  if (targetTag !== sourceTag) {
55946
- throw Error('Cannot merge actions for different tags');
55946
+ throw Error('Cannot merge actions for different tags.');
55947
55947
  }
55948
55948
  if (targetStatus === DraftActionStatus.Completed ||
55949
55949
  targetStatus === DraftActionStatus.Uploading) {
55950
- throw Error(`cannot merge actions when targetAction is in ${targetStatus} status`);
55950
+ throw Error(`Cannot merge actions when targetAction is in ${targetStatus} status.`);
55951
55951
  }
55952
55952
  if (sourceStatus === DraftActionStatus.Completed ||
55953
55953
  sourceStatus === DraftActionStatus.Uploading) {
55954
- throw Error(`cannot merge actions when sourceAction is in ${sourceStatus} status`);
55954
+ throw Error(`Cannot merge actions when sourceAction is in ${sourceStatus} status.`);
55955
55955
  }
55956
55956
  if (targetMethod.toLowerCase() === 'delete' || sourceMethod.toLowerCase() === 'delete') {
55957
- throw Error('cannot merge DELETE actions');
55957
+ throw Error('Cannot merge DELETE actions.');
55958
55958
  }
55959
55959
  if (targetMethod.toLowerCase() === 'patch' && sourceMethod.toLowerCase() === 'post') {
55960
55960
  // overlaying a POST over a PATCH is not supported
55961
- throw Error('cannot merge a POST action over top of a PATCH action');
55961
+ throw Error('Cannot merge a POST action over top of a PATCH action.');
55962
55962
  }
55963
55963
  if (targetVersion !== sourceVersion) {
55964
- throw Error('cannot merge actions with different versions');
55964
+ throw Error('Cannot merge actions with different versions.');
55965
55965
  }
55966
55966
  // overlay top-level properties, maintain target's timestamp and id
55967
55967
  const merged = {
@@ -59845,7 +59845,7 @@
59845
59845
  id: '@salesforce/lds-network-adapter',
59846
59846
  instrument: instrument$1,
59847
59847
  });
59848
- // version: 1.114.4-844684b4c
59848
+ // version: 1.114.6-435b32f3e
59849
59849
 
59850
59850
  const { create: create$2, keys: keys$2 } = Object;
59851
59851
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -60049,6 +60049,10 @@
60049
60049
  function findMaxOffset(metadata) {
60050
60050
  if (metadata === undefined)
60051
60051
  return -1;
60052
+ const endOfList = metadata["__END__"];
60053
+ if (endOfList !== undefined) {
60054
+ return endOfList > 0 ? endOfList - 1 : 0; // Cursor based pagination in gql is off by one :)
60055
+ }
60052
60056
  const { __END__: _, ...cursorMetadata } = metadata;
60053
60057
  const values = Object.values(cursorMetadata).filter((value) => value !== undefined);
60054
60058
  return Math.max(...values);
@@ -60180,93 +60184,6 @@
60180
60184
  }
60181
60185
  }
60182
60186
 
60183
- function applyToSelection$6(selection, directive, variables) {
60184
- return selection;
60185
- }
60186
-
60187
- function applyToSelection$5(selection, directive, variables) {
60188
- return selection;
60189
- }
60190
-
60191
- function applyToSelection$4(selection, directive, variables) {
60192
- return selection;
60193
- }
60194
-
60195
- function applyToSelection$3(selection, directive, variables) {
60196
- var _a;
60197
- const ifArg = (_a = directive.arguments) === null || _a === void 0 ? void 0 : _a.find(argument => argument.name.value === "if");
60198
- if (ifArg && ifArg.value) {
60199
- if (ifArg.value.kind === "BooleanValue") {
60200
- return ifArg.value.value ? selection : undefined;
60201
- }
60202
- if (ifArg.value.kind === "Variable") {
60203
- return variables[ifArg.value.name.value] ? selection : undefined;
60204
- }
60205
- }
60206
- return selection;
60207
- }
60208
-
60209
- function applyToSelection$2(selection, directive, variables) {
60210
- var _a;
60211
- const ifArg = (_a = directive.arguments) === null || _a === void 0 ? void 0 : _a.find(argument => argument.name.value === "if");
60212
- if (ifArg && ifArg.value) {
60213
- if (ifArg.value.kind === "BooleanValue") {
60214
- return ifArg.value.value ? undefined : selection;
60215
- }
60216
- if (ifArg.value.kind === "Variable") {
60217
- return variables[ifArg.value.name.value] ? undefined : selection;
60218
- }
60219
- }
60220
- return selection;
60221
- }
60222
-
60223
- function applyToSelection$1(selection, directive, variables) {
60224
- return selection;
60225
- }
60226
-
60227
- function applyToSelection(selection, directive, variables) {
60228
- return selection;
60229
- }
60230
-
60231
- function applyDirectivesForSelection(selection, variables) {
60232
- let result = selection;
60233
- if (selection && selection.directives) {
60234
- // iterate through directives in order. Directives _can_ be stacked.
60235
- for (var i = 0; i < selection.directives.length; i++) {
60236
- const directive = selection.directives[i];
60237
- switch (directive.name.value) {
60238
- // Generate Case for each directive in the schema that supports SelectionNodes
60239
- case ("generic"):
60240
- result = applyToSelection$6(selection);
60241
- break;
60242
- case ("fieldCategory"):
60243
- result = applyToSelection$5(selection);
60244
- break;
60245
- case ("category"):
60246
- result = applyToSelection$4(selection);
60247
- break;
60248
- case ("include"):
60249
- result = applyToSelection$3(selection, directive, variables);
60250
- break;
60251
- case ("skip"):
60252
- result = applyToSelection$2(selection, directive, variables);
60253
- break;
60254
- case ("deprecated"):
60255
- result = applyToSelection$1(selection);
60256
- break;
60257
- case ("specifiedBy"):
60258
- result = applyToSelection(selection);
60259
- break;
60260
- }
60261
- if (result === undefined) {
60262
- // Selection was removed.
60263
- break;
60264
- }
60265
- }
60266
- }
60267
- return result;
60268
- }
60269
-
60270
60187
  const name$G = 'DoubleValue';
60271
60188
  const VERSION$Q = 'de69c0962aca45d77a5bc8d9abacfa7d';
60272
60189
  function keyBuilder$L(luvio, path, data) {
@@ -60326,79 +60243,18 @@
60326
60243
  }
60327
60244
  return sink;
60328
60245
  }
60329
- function buildSelectionForField$G(source, reader, sel, variables, fragments) {
60330
- const sink = {};
60331
- const fieldData = getFieldData$G(source, sel, variables);
60332
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
60333
- reader.enterPath(requestedFieldName);
60334
- if (fieldData === undefined) {
60335
- reader.markMissing();
60336
- reader.exitPath();
60337
- return;
60338
- }
60339
- if (fieldData === null) {
60340
- reader.assignScalar(requestedFieldName, sink, fieldData);
60341
- return sink;
60342
- }
60343
- const fieldType = getFieldType$11(sel);
60344
- if (fieldType === undefined) {
60345
- // This field's type is unknown to us. This breaks normalization.
60346
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
60347
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
60348
- }
60349
- else if (fieldType.isArray) {
60350
- const arraySink = [];
60351
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
60352
- reader.enterPath(i);
60353
- selectType$H(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
60354
- reader.exitPath();
60355
- }
60356
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
60357
- }
60358
- else {
60359
- selectType$H(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
60360
- }
60361
- reader.exitPath();
60362
- return sink;
60246
+ function buildSelectionForField$H(source, reader, sel, variables, fragments) {
60247
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$G, getFieldType$11, selectType$H);
60363
60248
  }
60364
- function buildSelectionForNode$G(source, reader, parentNode, selectionNode, variables, fragments) {
60365
- const sink = {};
60366
- if (selectionNode.directives) {
60367
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
60368
- if (selectionWithDirectives === undefined) {
60369
- return;
60370
- }
60371
- selectionNode = selectionWithDirectives;
60372
- }
60373
- if (selectionNode.kind === "InlineFragment") {
60374
- if (isFragmentApplicable$H(selectionNode, source.data.__typename)) {
60375
- // Get selections out of the inline fragment
60376
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
60377
- // Call into field handling with selections
60378
- Object.assign(sink, buildSelectionForNode$G(source, reader, parentNode, fragmentSelection, variables, fragments));
60379
- });
60380
- }
60381
- }
60382
- if (selectionNode.kind === "FragmentSpread") {
60383
- const namedFragment = fragments[selectionNode.name.value];
60384
- if (namedFragment && isFragmentApplicable$H(namedFragment, source.data.__typename)) {
60385
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
60386
- // Call into field handling with selections
60387
- Object.assign(sink, buildSelectionForNode$G(source, reader, parentNode, fragmentSelection, variables, fragments));
60388
- });
60389
- }
60390
- }
60391
- if (selectionNode.kind === "Field") {
60392
- Object.assign(sink, buildSelectionForField$G(source, reader, selectionNode, variables));
60393
- }
60394
- return sink;
60249
+ function buildSelectionForNode$H(source, reader, parentNode, selectionNode, variables, fragments) {
60250
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$H, buildSelectionForField$H);
60395
60251
  }
60396
60252
  function select$Q(field, variables, fragments) {
60397
60253
  return (source, reader) => {
60398
60254
  var _a;
60399
60255
  const sink = {};
60400
60256
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
60401
- const builtSelection = buildSelectionForNode$G(source, reader, field, sel, variables, fragments);
60257
+ const builtSelection = buildSelectionForNode$H(source, reader, field, sel, variables, fragments);
60402
60258
  if (builtSelection !== undefined) {
60403
60259
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
60404
60260
  Object.keys(builtSelection).forEach((key, value) => {
@@ -60546,79 +60402,18 @@
60546
60402
  }
60547
60403
  return sink;
60548
60404
  }
60549
- function buildSelectionForField$F(source, reader, sel, variables, fragments) {
60550
- const sink = {};
60551
- const fieldData = getFieldData$F(source, sel, variables);
60552
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
60553
- reader.enterPath(requestedFieldName);
60554
- if (fieldData === undefined) {
60555
- reader.markMissing();
60556
- reader.exitPath();
60557
- return;
60558
- }
60559
- if (fieldData === null) {
60560
- reader.assignScalar(requestedFieldName, sink, fieldData);
60561
- return sink;
60562
- }
60563
- const fieldType = getFieldType$10(sel);
60564
- if (fieldType === undefined) {
60565
- // This field's type is unknown to us. This breaks normalization.
60566
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
60567
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
60568
- }
60569
- else if (fieldType.isArray) {
60570
- const arraySink = [];
60571
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
60572
- reader.enterPath(i);
60573
- selectType$G(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
60574
- reader.exitPath();
60575
- }
60576
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
60577
- }
60578
- else {
60579
- selectType$G(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
60580
- }
60581
- reader.exitPath();
60582
- return sink;
60405
+ function buildSelectionForField$G(source, reader, sel, variables, fragments) {
60406
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$F, getFieldType$10, selectType$G);
60583
60407
  }
60584
- function buildSelectionForNode$F(source, reader, parentNode, selectionNode, variables, fragments) {
60585
- const sink = {};
60586
- if (selectionNode.directives) {
60587
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
60588
- if (selectionWithDirectives === undefined) {
60589
- return;
60590
- }
60591
- selectionNode = selectionWithDirectives;
60592
- }
60593
- if (selectionNode.kind === "InlineFragment") {
60594
- if (isFragmentApplicable$G(selectionNode, source.data.__typename)) {
60595
- // Get selections out of the inline fragment
60596
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
60597
- // Call into field handling with selections
60598
- Object.assign(sink, buildSelectionForNode$F(source, reader, parentNode, fragmentSelection, variables, fragments));
60599
- });
60600
- }
60601
- }
60602
- if (selectionNode.kind === "FragmentSpread") {
60603
- const namedFragment = fragments[selectionNode.name.value];
60604
- if (namedFragment && isFragmentApplicable$G(namedFragment, source.data.__typename)) {
60605
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
60606
- // Call into field handling with selections
60607
- Object.assign(sink, buildSelectionForNode$F(source, reader, parentNode, fragmentSelection, variables, fragments));
60608
- });
60609
- }
60610
- }
60611
- if (selectionNode.kind === "Field") {
60612
- Object.assign(sink, buildSelectionForField$F(source, reader, selectionNode, variables));
60613
- }
60614
- return sink;
60408
+ function buildSelectionForNode$G(source, reader, parentNode, selectionNode, variables, fragments) {
60409
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$G, buildSelectionForField$G);
60615
60410
  }
60616
60411
  function select$P(field, variables, fragments) {
60617
60412
  return (source, reader) => {
60618
60413
  var _a;
60619
60414
  const sink = {};
60620
60415
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
60621
- const builtSelection = buildSelectionForNode$F(source, reader, field, sel, variables, fragments);
60416
+ const builtSelection = buildSelectionForNode$G(source, reader, field, sel, variables, fragments);
60622
60417
  if (builtSelection !== undefined) {
60623
60418
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
60624
60419
  Object.keys(builtSelection).forEach((key, value) => {
@@ -60766,79 +60561,18 @@
60766
60561
  }
60767
60562
  return sink;
60768
60563
  }
60769
- function buildSelectionForField$E(source, reader, sel, variables, fragments) {
60770
- const sink = {};
60771
- const fieldData = getFieldData$E(source, sel, variables);
60772
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
60773
- reader.enterPath(requestedFieldName);
60774
- if (fieldData === undefined) {
60775
- reader.markMissing();
60776
- reader.exitPath();
60777
- return;
60778
- }
60779
- if (fieldData === null) {
60780
- reader.assignScalar(requestedFieldName, sink, fieldData);
60781
- return sink;
60782
- }
60783
- const fieldType = getFieldType$$(sel);
60784
- if (fieldType === undefined) {
60785
- // This field's type is unknown to us. This breaks normalization.
60786
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
60787
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
60788
- }
60789
- else if (fieldType.isArray) {
60790
- const arraySink = [];
60791
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
60792
- reader.enterPath(i);
60793
- selectType$F(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
60794
- reader.exitPath();
60795
- }
60796
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
60797
- }
60798
- else {
60799
- selectType$F(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
60800
- }
60801
- reader.exitPath();
60802
- return sink;
60564
+ function buildSelectionForField$F(source, reader, sel, variables, fragments) {
60565
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$E, getFieldType$$, selectType$F);
60803
60566
  }
60804
- function buildSelectionForNode$E(source, reader, parentNode, selectionNode, variables, fragments) {
60805
- const sink = {};
60806
- if (selectionNode.directives) {
60807
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
60808
- if (selectionWithDirectives === undefined) {
60809
- return;
60810
- }
60811
- selectionNode = selectionWithDirectives;
60812
- }
60813
- if (selectionNode.kind === "InlineFragment") {
60814
- if (isFragmentApplicable$F(selectionNode, source.data.__typename)) {
60815
- // Get selections out of the inline fragment
60816
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
60817
- // Call into field handling with selections
60818
- Object.assign(sink, buildSelectionForNode$E(source, reader, parentNode, fragmentSelection, variables, fragments));
60819
- });
60820
- }
60821
- }
60822
- if (selectionNode.kind === "FragmentSpread") {
60823
- const namedFragment = fragments[selectionNode.name.value];
60824
- if (namedFragment && isFragmentApplicable$F(namedFragment, source.data.__typename)) {
60825
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
60826
- // Call into field handling with selections
60827
- Object.assign(sink, buildSelectionForNode$E(source, reader, parentNode, fragmentSelection, variables, fragments));
60828
- });
60829
- }
60830
- }
60831
- if (selectionNode.kind === "Field") {
60832
- Object.assign(sink, buildSelectionForField$E(source, reader, selectionNode, variables));
60833
- }
60834
- return sink;
60567
+ function buildSelectionForNode$F(source, reader, parentNode, selectionNode, variables, fragments) {
60568
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$F, buildSelectionForField$F);
60835
60569
  }
60836
60570
  function select$O(field, variables, fragments) {
60837
60571
  return (source, reader) => {
60838
60572
  var _a;
60839
60573
  const sink = {};
60840
60574
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
60841
- const builtSelection = buildSelectionForNode$E(source, reader, field, sel, variables, fragments);
60575
+ const builtSelection = buildSelectionForNode$F(source, reader, field, sel, variables, fragments);
60842
60576
  if (builtSelection !== undefined) {
60843
60577
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
60844
60578
  Object.keys(builtSelection).forEach((key, value) => {
@@ -61068,79 +60802,18 @@
61068
60802
  }
61069
60803
  return sink;
61070
60804
  }
61071
- function buildSelectionForField$D(source, reader, sel, variables, fragments) {
61072
- const sink = {};
61073
- const fieldData = getFieldData$D(source, sel, variables);
61074
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
61075
- reader.enterPath(requestedFieldName);
61076
- if (fieldData === undefined) {
61077
- reader.markMissing();
61078
- reader.exitPath();
61079
- return;
61080
- }
61081
- if (fieldData === null) {
61082
- reader.assignScalar(requestedFieldName, sink, fieldData);
61083
- return sink;
61084
- }
61085
- const fieldType = getFieldType$Z(sel);
61086
- if (fieldType === undefined) {
61087
- // This field's type is unknown to us. This breaks normalization.
61088
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
61089
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
61090
- }
61091
- else if (fieldType.isArray) {
61092
- const arraySink = [];
61093
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
61094
- reader.enterPath(i);
61095
- selectType$E(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
61096
- reader.exitPath();
61097
- }
61098
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
61099
- }
61100
- else {
61101
- selectType$E(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
61102
- }
61103
- reader.exitPath();
61104
- return sink;
60805
+ function buildSelectionForField$E(source, reader, sel, variables, fragments) {
60806
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$D, getFieldType$Z, selectType$E);
61105
60807
  }
61106
- function buildSelectionForNode$D(source, reader, parentNode, selectionNode, variables, fragments) {
61107
- const sink = {};
61108
- if (selectionNode.directives) {
61109
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
61110
- if (selectionWithDirectives === undefined) {
61111
- return;
61112
- }
61113
- selectionNode = selectionWithDirectives;
61114
- }
61115
- if (selectionNode.kind === "InlineFragment") {
61116
- if (isFragmentApplicable$E(selectionNode, source.data.__typename)) {
61117
- // Get selections out of the inline fragment
61118
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
61119
- // Call into field handling with selections
61120
- Object.assign(sink, buildSelectionForNode$D(source, reader, parentNode, fragmentSelection, variables, fragments));
61121
- });
61122
- }
61123
- }
61124
- if (selectionNode.kind === "FragmentSpread") {
61125
- const namedFragment = fragments[selectionNode.name.value];
61126
- if (namedFragment && isFragmentApplicable$E(namedFragment, source.data.__typename)) {
61127
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
61128
- // Call into field handling with selections
61129
- Object.assign(sink, buildSelectionForNode$D(source, reader, parentNode, fragmentSelection, variables, fragments));
61130
- });
61131
- }
61132
- }
61133
- if (selectionNode.kind === "Field") {
61134
- Object.assign(sink, buildSelectionForField$D(source, reader, selectionNode, variables));
61135
- }
61136
- return sink;
60808
+ function buildSelectionForNode$E(source, reader, parentNode, selectionNode, variables, fragments) {
60809
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$E, buildSelectionForField$E);
61137
60810
  }
61138
60811
  function select$N(field, variables, fragments) {
61139
60812
  return (source, reader) => {
61140
60813
  var _a;
61141
60814
  const sink = {};
61142
60815
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
61143
- const builtSelection = buildSelectionForNode$D(source, reader, field, sel, variables, fragments);
60816
+ const builtSelection = buildSelectionForNode$E(source, reader, field, sel, variables, fragments);
61144
60817
  if (builtSelection !== undefined) {
61145
60818
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
61146
60819
  Object.keys(builtSelection).forEach((key, value) => {
@@ -61284,79 +60957,18 @@
61284
60957
  }
61285
60958
  return sink;
61286
60959
  }
61287
- function buildSelectionForField$C(source, reader, sel, variables, fragments) {
61288
- const sink = {};
61289
- const fieldData = getFieldData$C(source, sel, variables);
61290
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
61291
- reader.enterPath(requestedFieldName);
61292
- if (fieldData === undefined) {
61293
- reader.markMissing();
61294
- reader.exitPath();
61295
- return;
61296
- }
61297
- if (fieldData === null) {
61298
- reader.assignScalar(requestedFieldName, sink, fieldData);
61299
- return sink;
61300
- }
61301
- const fieldType = getFieldType$Y(sel);
61302
- if (fieldType === undefined) {
61303
- // This field's type is unknown to us. This breaks normalization.
61304
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
61305
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
61306
- }
61307
- else if (fieldType.isArray) {
61308
- const arraySink = [];
61309
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
61310
- reader.enterPath(i);
61311
- selectType$D(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
61312
- reader.exitPath();
61313
- }
61314
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
61315
- }
61316
- else {
61317
- selectType$D(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
61318
- }
61319
- reader.exitPath();
61320
- return sink;
60960
+ function buildSelectionForField$D(source, reader, sel, variables, fragments) {
60961
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$C, getFieldType$Y, selectType$D);
61321
60962
  }
61322
- function buildSelectionForNode$C(source, reader, parentNode, selectionNode, variables, fragments) {
61323
- const sink = {};
61324
- if (selectionNode.directives) {
61325
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
61326
- if (selectionWithDirectives === undefined) {
61327
- return;
61328
- }
61329
- selectionNode = selectionWithDirectives;
61330
- }
61331
- if (selectionNode.kind === "InlineFragment") {
61332
- if (isFragmentApplicable$D(selectionNode, source.data.__typename)) {
61333
- // Get selections out of the inline fragment
61334
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
61335
- // Call into field handling with selections
61336
- Object.assign(sink, buildSelectionForNode$C(source, reader, parentNode, fragmentSelection, variables, fragments));
61337
- });
61338
- }
61339
- }
61340
- if (selectionNode.kind === "FragmentSpread") {
61341
- const namedFragment = fragments[selectionNode.name.value];
61342
- if (namedFragment && isFragmentApplicable$D(namedFragment, source.data.__typename)) {
61343
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
61344
- // Call into field handling with selections
61345
- Object.assign(sink, buildSelectionForNode$C(source, reader, parentNode, fragmentSelection, variables, fragments));
61346
- });
61347
- }
61348
- }
61349
- if (selectionNode.kind === "Field") {
61350
- Object.assign(sink, buildSelectionForField$C(source, reader, selectionNode, variables));
61351
- }
61352
- return sink;
60963
+ function buildSelectionForNode$D(source, reader, parentNode, selectionNode, variables, fragments) {
60964
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$D, buildSelectionForField$D);
61353
60965
  }
61354
60966
  function select$M(field, variables, fragments) {
61355
60967
  return (source, reader) => {
61356
60968
  var _a;
61357
60969
  const sink = {};
61358
60970
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
61359
- const builtSelection = buildSelectionForNode$C(source, reader, field, sel, variables, fragments);
60971
+ const builtSelection = buildSelectionForNode$D(source, reader, field, sel, variables, fragments);
61360
60972
  if (builtSelection !== undefined) {
61361
60973
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
61362
60974
  Object.keys(builtSelection).forEach((key, value) => {
@@ -61576,79 +61188,18 @@
61576
61188
  }
61577
61189
  return sink;
61578
61190
  }
61579
- function buildSelectionForField$B(source, reader, sel, variables, fragments) {
61580
- const sink = {};
61581
- const fieldData = getFieldData$B(source, sel, variables);
61582
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
61583
- reader.enterPath(requestedFieldName);
61584
- if (fieldData === undefined) {
61585
- reader.markMissing();
61586
- reader.exitPath();
61587
- return;
61588
- }
61589
- if (fieldData === null) {
61590
- reader.assignScalar(requestedFieldName, sink, fieldData);
61591
- return sink;
61592
- }
61593
- const fieldType = getFieldType$W(sel);
61594
- if (fieldType === undefined) {
61595
- // This field's type is unknown to us. This breaks normalization.
61596
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
61597
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
61598
- }
61599
- else if (fieldType.isArray) {
61600
- const arraySink = [];
61601
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
61602
- reader.enterPath(i);
61603
- selectType$C(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
61604
- reader.exitPath();
61605
- }
61606
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
61607
- }
61608
- else {
61609
- selectType$C(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
61610
- }
61611
- reader.exitPath();
61612
- return sink;
61191
+ function buildSelectionForField$C(source, reader, sel, variables, fragments) {
61192
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$B, getFieldType$W, selectType$C);
61613
61193
  }
61614
- function buildSelectionForNode$B(source, reader, parentNode, selectionNode, variables, fragments) {
61615
- const sink = {};
61616
- if (selectionNode.directives) {
61617
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
61618
- if (selectionWithDirectives === undefined) {
61619
- return;
61620
- }
61621
- selectionNode = selectionWithDirectives;
61622
- }
61623
- if (selectionNode.kind === "InlineFragment") {
61624
- if (isFragmentApplicable$C(selectionNode, source.data.__typename)) {
61625
- // Get selections out of the inline fragment
61626
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
61627
- // Call into field handling with selections
61628
- Object.assign(sink, buildSelectionForNode$B(source, reader, parentNode, fragmentSelection, variables, fragments));
61629
- });
61630
- }
61631
- }
61632
- if (selectionNode.kind === "FragmentSpread") {
61633
- const namedFragment = fragments[selectionNode.name.value];
61634
- if (namedFragment && isFragmentApplicable$C(namedFragment, source.data.__typename)) {
61635
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
61636
- // Call into field handling with selections
61637
- Object.assign(sink, buildSelectionForNode$B(source, reader, parentNode, fragmentSelection, variables, fragments));
61638
- });
61639
- }
61640
- }
61641
- if (selectionNode.kind === "Field") {
61642
- Object.assign(sink, buildSelectionForField$B(source, reader, selectionNode, variables));
61643
- }
61644
- return sink;
61194
+ function buildSelectionForNode$C(source, reader, parentNode, selectionNode, variables, fragments) {
61195
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$C, buildSelectionForField$C);
61645
61196
  }
61646
61197
  function select$L(field, variables, fragments) {
61647
61198
  return (source, reader) => {
61648
61199
  var _a;
61649
61200
  const sink = {};
61650
61201
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
61651
- const builtSelection = buildSelectionForNode$B(source, reader, field, sel, variables, fragments);
61202
+ const builtSelection = buildSelectionForNode$C(source, reader, field, sel, variables, fragments);
61652
61203
  if (builtSelection !== undefined) {
61653
61204
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
61654
61205
  Object.keys(builtSelection).forEach((key, value) => {
@@ -61790,79 +61341,18 @@
61790
61341
  }
61791
61342
  return sink;
61792
61343
  }
61793
- function buildSelectionForField$A(source, reader, sel, variables, fragments) {
61794
- const sink = {};
61795
- const fieldData = getFieldData$A(source, sel, variables);
61796
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
61797
- reader.enterPath(requestedFieldName);
61798
- if (fieldData === undefined) {
61799
- reader.markMissing();
61800
- reader.exitPath();
61801
- return;
61802
- }
61803
- if (fieldData === null) {
61804
- reader.assignScalar(requestedFieldName, sink, fieldData);
61805
- return sink;
61806
- }
61807
- const fieldType = getFieldType$V(sel);
61808
- if (fieldType === undefined) {
61809
- // This field's type is unknown to us. This breaks normalization.
61810
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
61811
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
61812
- }
61813
- else if (fieldType.isArray) {
61814
- const arraySink = [];
61815
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
61816
- reader.enterPath(i);
61817
- selectType$B(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
61818
- reader.exitPath();
61819
- }
61820
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
61821
- }
61822
- else {
61823
- selectType$B(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
61824
- }
61825
- reader.exitPath();
61826
- return sink;
61344
+ function buildSelectionForField$B(source, reader, sel, variables, fragments) {
61345
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$A, getFieldType$V, selectType$B);
61827
61346
  }
61828
- function buildSelectionForNode$A(source, reader, parentNode, selectionNode, variables, fragments) {
61829
- const sink = {};
61830
- if (selectionNode.directives) {
61831
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
61832
- if (selectionWithDirectives === undefined) {
61833
- return;
61834
- }
61835
- selectionNode = selectionWithDirectives;
61836
- }
61837
- if (selectionNode.kind === "InlineFragment") {
61838
- if (isFragmentApplicable$B(selectionNode, source.data.__typename)) {
61839
- // Get selections out of the inline fragment
61840
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
61841
- // Call into field handling with selections
61842
- Object.assign(sink, buildSelectionForNode$A(source, reader, parentNode, fragmentSelection, variables, fragments));
61843
- });
61844
- }
61845
- }
61846
- if (selectionNode.kind === "FragmentSpread") {
61847
- const namedFragment = fragments[selectionNode.name.value];
61848
- if (namedFragment && isFragmentApplicable$B(namedFragment, source.data.__typename)) {
61849
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
61850
- // Call into field handling with selections
61851
- Object.assign(sink, buildSelectionForNode$A(source, reader, parentNode, fragmentSelection, variables, fragments));
61852
- });
61853
- }
61854
- }
61855
- if (selectionNode.kind === "Field") {
61856
- Object.assign(sink, buildSelectionForField$A(source, reader, selectionNode, variables));
61857
- }
61858
- return sink;
61347
+ function buildSelectionForNode$B(source, reader, parentNode, selectionNode, variables, fragments) {
61348
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$B, buildSelectionForField$B);
61859
61349
  }
61860
61350
  function select$K(field, variables, fragments) {
61861
61351
  return (source, reader) => {
61862
61352
  var _a;
61863
61353
  const sink = {};
61864
61354
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
61865
- const builtSelection = buildSelectionForNode$A(source, reader, field, sel, variables, fragments);
61355
+ const builtSelection = buildSelectionForNode$B(source, reader, field, sel, variables, fragments);
61866
61356
  if (builtSelection !== undefined) {
61867
61357
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
61868
61358
  Object.keys(builtSelection).forEach((key, value) => {
@@ -62010,79 +61500,18 @@
62010
61500
  }
62011
61501
  return sink;
62012
61502
  }
62013
- function buildSelectionForField$z(source, reader, sel, variables, fragments) {
62014
- const sink = {};
62015
- const fieldData = getFieldData$z(source, sel, variables);
62016
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
62017
- reader.enterPath(requestedFieldName);
62018
- if (fieldData === undefined) {
62019
- reader.markMissing();
62020
- reader.exitPath();
62021
- return;
62022
- }
62023
- if (fieldData === null) {
62024
- reader.assignScalar(requestedFieldName, sink, fieldData);
62025
- return sink;
62026
- }
62027
- const fieldType = getFieldType$U(sel);
62028
- if (fieldType === undefined) {
62029
- // This field's type is unknown to us. This breaks normalization.
62030
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
62031
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
62032
- }
62033
- else if (fieldType.isArray) {
62034
- const arraySink = [];
62035
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
62036
- reader.enterPath(i);
62037
- selectType$A(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
62038
- reader.exitPath();
62039
- }
62040
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
62041
- }
62042
- else {
62043
- selectType$A(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
62044
- }
62045
- reader.exitPath();
62046
- return sink;
61503
+ function buildSelectionForField$A(source, reader, sel, variables, fragments) {
61504
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$z, getFieldType$U, selectType$A);
62047
61505
  }
62048
- function buildSelectionForNode$z(source, reader, parentNode, selectionNode, variables, fragments) {
62049
- const sink = {};
62050
- if (selectionNode.directives) {
62051
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
62052
- if (selectionWithDirectives === undefined) {
62053
- return;
62054
- }
62055
- selectionNode = selectionWithDirectives;
62056
- }
62057
- if (selectionNode.kind === "InlineFragment") {
62058
- if (isFragmentApplicable$A(selectionNode, source.data.__typename)) {
62059
- // Get selections out of the inline fragment
62060
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
62061
- // Call into field handling with selections
62062
- Object.assign(sink, buildSelectionForNode$z(source, reader, parentNode, fragmentSelection, variables, fragments));
62063
- });
62064
- }
62065
- }
62066
- if (selectionNode.kind === "FragmentSpread") {
62067
- const namedFragment = fragments[selectionNode.name.value];
62068
- if (namedFragment && isFragmentApplicable$A(namedFragment, source.data.__typename)) {
62069
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
62070
- // Call into field handling with selections
62071
- Object.assign(sink, buildSelectionForNode$z(source, reader, parentNode, fragmentSelection, variables, fragments));
62072
- });
62073
- }
62074
- }
62075
- if (selectionNode.kind === "Field") {
62076
- Object.assign(sink, buildSelectionForField$z(source, reader, selectionNode, variables));
62077
- }
62078
- return sink;
61506
+ function buildSelectionForNode$A(source, reader, parentNode, selectionNode, variables, fragments) {
61507
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$A, buildSelectionForField$A);
62079
61508
  }
62080
61509
  function select$J(field, variables, fragments) {
62081
61510
  return (source, reader) => {
62082
61511
  var _a;
62083
61512
  const sink = {};
62084
61513
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
62085
- const builtSelection = buildSelectionForNode$z(source, reader, field, sel, variables, fragments);
61514
+ const builtSelection = buildSelectionForNode$A(source, reader, field, sel, variables, fragments);
62086
61515
  if (builtSelection !== undefined) {
62087
61516
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
62088
61517
  Object.keys(builtSelection).forEach((key, value) => {
@@ -62224,79 +61653,18 @@
62224
61653
  }
62225
61654
  return sink;
62226
61655
  }
62227
- function buildSelectionForField$y(source, reader, sel, variables, fragments) {
62228
- const sink = {};
62229
- const fieldData = getFieldData$y(source, sel, variables);
62230
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
62231
- reader.enterPath(requestedFieldName);
62232
- if (fieldData === undefined) {
62233
- reader.markMissing();
62234
- reader.exitPath();
62235
- return;
62236
- }
62237
- if (fieldData === null) {
62238
- reader.assignScalar(requestedFieldName, sink, fieldData);
62239
- return sink;
62240
- }
62241
- const fieldType = getFieldType$T(sel);
62242
- if (fieldType === undefined) {
62243
- // This field's type is unknown to us. This breaks normalization.
62244
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
62245
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
62246
- }
62247
- else if (fieldType.isArray) {
62248
- const arraySink = [];
62249
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
62250
- reader.enterPath(i);
62251
- selectType$z(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
62252
- reader.exitPath();
62253
- }
62254
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
62255
- }
62256
- else {
62257
- selectType$z(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
62258
- }
62259
- reader.exitPath();
62260
- return sink;
61656
+ function buildSelectionForField$z(source, reader, sel, variables, fragments) {
61657
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$y, getFieldType$T, selectType$z);
62261
61658
  }
62262
- function buildSelectionForNode$y(source, reader, parentNode, selectionNode, variables, fragments) {
62263
- const sink = {};
62264
- if (selectionNode.directives) {
62265
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
62266
- if (selectionWithDirectives === undefined) {
62267
- return;
62268
- }
62269
- selectionNode = selectionWithDirectives;
62270
- }
62271
- if (selectionNode.kind === "InlineFragment") {
62272
- if (isFragmentApplicable$z(selectionNode, source.data.__typename)) {
62273
- // Get selections out of the inline fragment
62274
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
62275
- // Call into field handling with selections
62276
- Object.assign(sink, buildSelectionForNode$y(source, reader, parentNode, fragmentSelection, variables, fragments));
62277
- });
62278
- }
62279
- }
62280
- if (selectionNode.kind === "FragmentSpread") {
62281
- const namedFragment = fragments[selectionNode.name.value];
62282
- if (namedFragment && isFragmentApplicable$z(namedFragment, source.data.__typename)) {
62283
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
62284
- // Call into field handling with selections
62285
- Object.assign(sink, buildSelectionForNode$y(source, reader, parentNode, fragmentSelection, variables, fragments));
62286
- });
62287
- }
62288
- }
62289
- if (selectionNode.kind === "Field") {
62290
- Object.assign(sink, buildSelectionForField$y(source, reader, selectionNode, variables));
62291
- }
62292
- return sink;
61659
+ function buildSelectionForNode$z(source, reader, parentNode, selectionNode, variables, fragments) {
61660
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$z, buildSelectionForField$z);
62293
61661
  }
62294
61662
  function select$I(field, variables, fragments) {
62295
61663
  return (source, reader) => {
62296
61664
  var _a;
62297
61665
  const sink = {};
62298
61666
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
62299
- const builtSelection = buildSelectionForNode$y(source, reader, field, sel, variables, fragments);
61667
+ const builtSelection = buildSelectionForNode$z(source, reader, field, sel, variables, fragments);
62300
61668
  if (builtSelection !== undefined) {
62301
61669
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
62302
61670
  Object.keys(builtSelection).forEach((key, value) => {
@@ -62444,79 +61812,18 @@
62444
61812
  }
62445
61813
  return sink;
62446
61814
  }
62447
- function buildSelectionForField$x(source, reader, sel, variables, fragments) {
62448
- const sink = {};
62449
- const fieldData = getFieldData$x(source, sel, variables);
62450
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
62451
- reader.enterPath(requestedFieldName);
62452
- if (fieldData === undefined) {
62453
- reader.markMissing();
62454
- reader.exitPath();
62455
- return;
62456
- }
62457
- if (fieldData === null) {
62458
- reader.assignScalar(requestedFieldName, sink, fieldData);
62459
- return sink;
62460
- }
62461
- const fieldType = getFieldType$S(sel);
62462
- if (fieldType === undefined) {
62463
- // This field's type is unknown to us. This breaks normalization.
62464
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
62465
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
62466
- }
62467
- else if (fieldType.isArray) {
62468
- const arraySink = [];
62469
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
62470
- reader.enterPath(i);
62471
- selectType$y(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
62472
- reader.exitPath();
62473
- }
62474
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
62475
- }
62476
- else {
62477
- selectType$y(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
62478
- }
62479
- reader.exitPath();
62480
- return sink;
61815
+ function buildSelectionForField$y(source, reader, sel, variables, fragments) {
61816
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$x, getFieldType$S, selectType$y);
62481
61817
  }
62482
- function buildSelectionForNode$x(source, reader, parentNode, selectionNode, variables, fragments) {
62483
- const sink = {};
62484
- if (selectionNode.directives) {
62485
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
62486
- if (selectionWithDirectives === undefined) {
62487
- return;
62488
- }
62489
- selectionNode = selectionWithDirectives;
62490
- }
62491
- if (selectionNode.kind === "InlineFragment") {
62492
- if (isFragmentApplicable$y(selectionNode, source.data.__typename)) {
62493
- // Get selections out of the inline fragment
62494
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
62495
- // Call into field handling with selections
62496
- Object.assign(sink, buildSelectionForNode$x(source, reader, parentNode, fragmentSelection, variables, fragments));
62497
- });
62498
- }
62499
- }
62500
- if (selectionNode.kind === "FragmentSpread") {
62501
- const namedFragment = fragments[selectionNode.name.value];
62502
- if (namedFragment && isFragmentApplicable$y(namedFragment, source.data.__typename)) {
62503
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
62504
- // Call into field handling with selections
62505
- Object.assign(sink, buildSelectionForNode$x(source, reader, parentNode, fragmentSelection, variables, fragments));
62506
- });
62507
- }
62508
- }
62509
- if (selectionNode.kind === "Field") {
62510
- Object.assign(sink, buildSelectionForField$x(source, reader, selectionNode, variables));
62511
- }
62512
- return sink;
61818
+ function buildSelectionForNode$y(source, reader, parentNode, selectionNode, variables, fragments) {
61819
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$y, buildSelectionForField$y);
62513
61820
  }
62514
61821
  function select$H(field, variables, fragments) {
62515
61822
  return (source, reader) => {
62516
61823
  var _a;
62517
61824
  const sink = {};
62518
61825
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
62519
- const builtSelection = buildSelectionForNode$x(source, reader, field, sel, variables, fragments);
61826
+ const builtSelection = buildSelectionForNode$y(source, reader, field, sel, variables, fragments);
62520
61827
  if (builtSelection !== undefined) {
62521
61828
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
62522
61829
  Object.keys(builtSelection).forEach((key, value) => {
@@ -62664,79 +61971,18 @@
62664
61971
  }
62665
61972
  return sink;
62666
61973
  }
62667
- function buildSelectionForField$w(source, reader, sel, variables, fragments) {
62668
- const sink = {};
62669
- const fieldData = getFieldData$w(source, sel, variables);
62670
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
62671
- reader.enterPath(requestedFieldName);
62672
- if (fieldData === undefined) {
62673
- reader.markMissing();
62674
- reader.exitPath();
62675
- return;
62676
- }
62677
- if (fieldData === null) {
62678
- reader.assignScalar(requestedFieldName, sink, fieldData);
62679
- return sink;
62680
- }
62681
- const fieldType = getFieldType$R(sel);
62682
- if (fieldType === undefined) {
62683
- // This field's type is unknown to us. This breaks normalization.
62684
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
62685
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
62686
- }
62687
- else if (fieldType.isArray) {
62688
- const arraySink = [];
62689
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
62690
- reader.enterPath(i);
62691
- selectType$x(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
62692
- reader.exitPath();
62693
- }
62694
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
62695
- }
62696
- else {
62697
- selectType$x(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
62698
- }
62699
- reader.exitPath();
62700
- return sink;
61974
+ function buildSelectionForField$x(source, reader, sel, variables, fragments) {
61975
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$w, getFieldType$R, selectType$x);
62701
61976
  }
62702
- function buildSelectionForNode$w(source, reader, parentNode, selectionNode, variables, fragments) {
62703
- const sink = {};
62704
- if (selectionNode.directives) {
62705
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
62706
- if (selectionWithDirectives === undefined) {
62707
- return;
62708
- }
62709
- selectionNode = selectionWithDirectives;
62710
- }
62711
- if (selectionNode.kind === "InlineFragment") {
62712
- if (isFragmentApplicable$x(selectionNode, source.data.__typename)) {
62713
- // Get selections out of the inline fragment
62714
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
62715
- // Call into field handling with selections
62716
- Object.assign(sink, buildSelectionForNode$w(source, reader, parentNode, fragmentSelection, variables, fragments));
62717
- });
62718
- }
62719
- }
62720
- if (selectionNode.kind === "FragmentSpread") {
62721
- const namedFragment = fragments[selectionNode.name.value];
62722
- if (namedFragment && isFragmentApplicable$x(namedFragment, source.data.__typename)) {
62723
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
62724
- // Call into field handling with selections
62725
- Object.assign(sink, buildSelectionForNode$w(source, reader, parentNode, fragmentSelection, variables, fragments));
62726
- });
62727
- }
62728
- }
62729
- if (selectionNode.kind === "Field") {
62730
- Object.assign(sink, buildSelectionForField$w(source, reader, selectionNode, variables));
62731
- }
62732
- return sink;
61977
+ function buildSelectionForNode$x(source, reader, parentNode, selectionNode, variables, fragments) {
61978
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$x, buildSelectionForField$x);
62733
61979
  }
62734
61980
  function select$G(field, variables, fragments) {
62735
61981
  return (source, reader) => {
62736
61982
  var _a;
62737
61983
  const sink = {};
62738
61984
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
62739
- const builtSelection = buildSelectionForNode$w(source, reader, field, sel, variables, fragments);
61985
+ const builtSelection = buildSelectionForNode$x(source, reader, field, sel, variables, fragments);
62740
61986
  if (builtSelection !== undefined) {
62741
61987
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
62742
61988
  Object.keys(builtSelection).forEach((key, value) => {
@@ -62878,79 +62124,18 @@
62878
62124
  }
62879
62125
  return sink;
62880
62126
  }
62881
- function buildSelectionForField$v(source, reader, sel, variables, fragments) {
62882
- const sink = {};
62883
- const fieldData = getFieldData$v(source, sel, variables);
62884
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
62885
- reader.enterPath(requestedFieldName);
62886
- if (fieldData === undefined) {
62887
- reader.markMissing();
62888
- reader.exitPath();
62889
- return;
62890
- }
62891
- if (fieldData === null) {
62892
- reader.assignScalar(requestedFieldName, sink, fieldData);
62893
- return sink;
62894
- }
62895
- const fieldType = getFieldType$Q(sel);
62896
- if (fieldType === undefined) {
62897
- // This field's type is unknown to us. This breaks normalization.
62898
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
62899
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
62900
- }
62901
- else if (fieldType.isArray) {
62902
- const arraySink = [];
62903
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
62904
- reader.enterPath(i);
62905
- selectType$w(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
62906
- reader.exitPath();
62907
- }
62908
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
62909
- }
62910
- else {
62911
- selectType$w(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
62912
- }
62913
- reader.exitPath();
62914
- return sink;
62127
+ function buildSelectionForField$w(source, reader, sel, variables, fragments) {
62128
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$v, getFieldType$Q, selectType$w);
62915
62129
  }
62916
- function buildSelectionForNode$v(source, reader, parentNode, selectionNode, variables, fragments) {
62917
- const sink = {};
62918
- if (selectionNode.directives) {
62919
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
62920
- if (selectionWithDirectives === undefined) {
62921
- return;
62922
- }
62923
- selectionNode = selectionWithDirectives;
62924
- }
62925
- if (selectionNode.kind === "InlineFragment") {
62926
- if (isFragmentApplicable$w(selectionNode, source.data.__typename)) {
62927
- // Get selections out of the inline fragment
62928
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
62929
- // Call into field handling with selections
62930
- Object.assign(sink, buildSelectionForNode$v(source, reader, parentNode, fragmentSelection, variables, fragments));
62931
- });
62932
- }
62933
- }
62934
- if (selectionNode.kind === "FragmentSpread") {
62935
- const namedFragment = fragments[selectionNode.name.value];
62936
- if (namedFragment && isFragmentApplicable$w(namedFragment, source.data.__typename)) {
62937
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
62938
- // Call into field handling with selections
62939
- Object.assign(sink, buildSelectionForNode$v(source, reader, parentNode, fragmentSelection, variables, fragments));
62940
- });
62941
- }
62942
- }
62943
- if (selectionNode.kind === "Field") {
62944
- Object.assign(sink, buildSelectionForField$v(source, reader, selectionNode, variables));
62945
- }
62946
- return sink;
62130
+ function buildSelectionForNode$w(source, reader, parentNode, selectionNode, variables, fragments) {
62131
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$w, buildSelectionForField$w);
62947
62132
  }
62948
62133
  function select$F(field, variables, fragments) {
62949
62134
  return (source, reader) => {
62950
62135
  var _a;
62951
62136
  const sink = {};
62952
62137
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
62953
- const builtSelection = buildSelectionForNode$v(source, reader, field, sel, variables, fragments);
62138
+ const builtSelection = buildSelectionForNode$w(source, reader, field, sel, variables, fragments);
62954
62139
  if (builtSelection !== undefined) {
62955
62140
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
62956
62141
  Object.keys(builtSelection).forEach((key, value) => {
@@ -63092,79 +62277,18 @@
63092
62277
  }
63093
62278
  return sink;
63094
62279
  }
63095
- function buildSelectionForField$u(source, reader, sel, variables, fragments) {
63096
- const sink = {};
63097
- const fieldData = getFieldData$u(source, sel, variables);
63098
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
63099
- reader.enterPath(requestedFieldName);
63100
- if (fieldData === undefined) {
63101
- reader.markMissing();
63102
- reader.exitPath();
63103
- return;
63104
- }
63105
- if (fieldData === null) {
63106
- reader.assignScalar(requestedFieldName, sink, fieldData);
63107
- return sink;
63108
- }
63109
- const fieldType = getFieldType$P(sel);
63110
- if (fieldType === undefined) {
63111
- // This field's type is unknown to us. This breaks normalization.
63112
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
63113
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
63114
- }
63115
- else if (fieldType.isArray) {
63116
- const arraySink = [];
63117
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
63118
- reader.enterPath(i);
63119
- selectType$v(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
63120
- reader.exitPath();
63121
- }
63122
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
63123
- }
63124
- else {
63125
- selectType$v(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
63126
- }
63127
- reader.exitPath();
63128
- return sink;
62280
+ function buildSelectionForField$v(source, reader, sel, variables, fragments) {
62281
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$u, getFieldType$P, selectType$v);
63129
62282
  }
63130
- function buildSelectionForNode$u(source, reader, parentNode, selectionNode, variables, fragments) {
63131
- const sink = {};
63132
- if (selectionNode.directives) {
63133
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
63134
- if (selectionWithDirectives === undefined) {
63135
- return;
63136
- }
63137
- selectionNode = selectionWithDirectives;
63138
- }
63139
- if (selectionNode.kind === "InlineFragment") {
63140
- if (isFragmentApplicable$v(selectionNode, source.data.__typename)) {
63141
- // Get selections out of the inline fragment
63142
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
63143
- // Call into field handling with selections
63144
- Object.assign(sink, buildSelectionForNode$u(source, reader, parentNode, fragmentSelection, variables, fragments));
63145
- });
63146
- }
63147
- }
63148
- if (selectionNode.kind === "FragmentSpread") {
63149
- const namedFragment = fragments[selectionNode.name.value];
63150
- if (namedFragment && isFragmentApplicable$v(namedFragment, source.data.__typename)) {
63151
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
63152
- // Call into field handling with selections
63153
- Object.assign(sink, buildSelectionForNode$u(source, reader, parentNode, fragmentSelection, variables, fragments));
63154
- });
63155
- }
63156
- }
63157
- if (selectionNode.kind === "Field") {
63158
- Object.assign(sink, buildSelectionForField$u(source, reader, selectionNode, variables));
63159
- }
63160
- return sink;
62283
+ function buildSelectionForNode$v(source, reader, parentNode, selectionNode, variables, fragments) {
62284
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$v, buildSelectionForField$v);
63161
62285
  }
63162
62286
  function select$E(field, variables, fragments) {
63163
62287
  return (source, reader) => {
63164
62288
  var _a;
63165
62289
  const sink = {};
63166
62290
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
63167
- const builtSelection = buildSelectionForNode$u(source, reader, field, sel, variables, fragments);
62291
+ const builtSelection = buildSelectionForNode$v(source, reader, field, sel, variables, fragments);
63168
62292
  if (builtSelection !== undefined) {
63169
62293
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
63170
62294
  Object.keys(builtSelection).forEach((key, value) => {
@@ -63306,79 +62430,18 @@
63306
62430
  }
63307
62431
  return sink;
63308
62432
  }
63309
- function buildSelectionForField$t(source, reader, sel, variables, fragments) {
63310
- const sink = {};
63311
- const fieldData = getFieldData$t(source, sel, variables);
63312
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
63313
- reader.enterPath(requestedFieldName);
63314
- if (fieldData === undefined) {
63315
- reader.markMissing();
63316
- reader.exitPath();
63317
- return;
63318
- }
63319
- if (fieldData === null) {
63320
- reader.assignScalar(requestedFieldName, sink, fieldData);
63321
- return sink;
63322
- }
63323
- const fieldType = getFieldType$O(sel);
63324
- if (fieldType === undefined) {
63325
- // This field's type is unknown to us. This breaks normalization.
63326
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
63327
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
63328
- }
63329
- else if (fieldType.isArray) {
63330
- const arraySink = [];
63331
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
63332
- reader.enterPath(i);
63333
- selectType$u(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
63334
- reader.exitPath();
63335
- }
63336
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
63337
- }
63338
- else {
63339
- selectType$u(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
63340
- }
63341
- reader.exitPath();
63342
- return sink;
62433
+ function buildSelectionForField$u(source, reader, sel, variables, fragments) {
62434
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$t, getFieldType$O, selectType$u);
63343
62435
  }
63344
- function buildSelectionForNode$t(source, reader, parentNode, selectionNode, variables, fragments) {
63345
- const sink = {};
63346
- if (selectionNode.directives) {
63347
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
63348
- if (selectionWithDirectives === undefined) {
63349
- return;
63350
- }
63351
- selectionNode = selectionWithDirectives;
63352
- }
63353
- if (selectionNode.kind === "InlineFragment") {
63354
- if (isFragmentApplicable$u(selectionNode, source.data.__typename)) {
63355
- // Get selections out of the inline fragment
63356
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
63357
- // Call into field handling with selections
63358
- Object.assign(sink, buildSelectionForNode$t(source, reader, parentNode, fragmentSelection, variables, fragments));
63359
- });
63360
- }
63361
- }
63362
- if (selectionNode.kind === "FragmentSpread") {
63363
- const namedFragment = fragments[selectionNode.name.value];
63364
- if (namedFragment && isFragmentApplicable$u(namedFragment, source.data.__typename)) {
63365
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
63366
- // Call into field handling with selections
63367
- Object.assign(sink, buildSelectionForNode$t(source, reader, parentNode, fragmentSelection, variables, fragments));
63368
- });
63369
- }
63370
- }
63371
- if (selectionNode.kind === "Field") {
63372
- Object.assign(sink, buildSelectionForField$t(source, reader, selectionNode, variables));
63373
- }
63374
- return sink;
62436
+ function buildSelectionForNode$u(source, reader, parentNode, selectionNode, variables, fragments) {
62437
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$u, buildSelectionForField$u);
63375
62438
  }
63376
62439
  function select$D(field, variables, fragments) {
63377
62440
  return (source, reader) => {
63378
62441
  var _a;
63379
62442
  const sink = {};
63380
62443
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
63381
- const builtSelection = buildSelectionForNode$t(source, reader, field, sel, variables, fragments);
62444
+ const builtSelection = buildSelectionForNode$u(source, reader, field, sel, variables, fragments);
63382
62445
  if (builtSelection !== undefined) {
63383
62446
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
63384
62447
  Object.keys(builtSelection).forEach((key, value) => {
@@ -63520,79 +62583,18 @@
63520
62583
  }
63521
62584
  return sink;
63522
62585
  }
63523
- function buildSelectionForField$s(source, reader, sel, variables, fragments) {
63524
- const sink = {};
63525
- const fieldData = getFieldData$s(source, sel, variables);
63526
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
63527
- reader.enterPath(requestedFieldName);
63528
- if (fieldData === undefined) {
63529
- reader.markMissing();
63530
- reader.exitPath();
63531
- return;
63532
- }
63533
- if (fieldData === null) {
63534
- reader.assignScalar(requestedFieldName, sink, fieldData);
63535
- return sink;
63536
- }
63537
- const fieldType = getFieldType$N(sel);
63538
- if (fieldType === undefined) {
63539
- // This field's type is unknown to us. This breaks normalization.
63540
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
63541
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
63542
- }
63543
- else if (fieldType.isArray) {
63544
- const arraySink = [];
63545
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
63546
- reader.enterPath(i);
63547
- selectType$t(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
63548
- reader.exitPath();
63549
- }
63550
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
63551
- }
63552
- else {
63553
- selectType$t(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
63554
- }
63555
- reader.exitPath();
63556
- return sink;
62586
+ function buildSelectionForField$t(source, reader, sel, variables, fragments) {
62587
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$s, getFieldType$N, selectType$t);
63557
62588
  }
63558
- function buildSelectionForNode$s(source, reader, parentNode, selectionNode, variables, fragments) {
63559
- const sink = {};
63560
- if (selectionNode.directives) {
63561
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
63562
- if (selectionWithDirectives === undefined) {
63563
- return;
63564
- }
63565
- selectionNode = selectionWithDirectives;
63566
- }
63567
- if (selectionNode.kind === "InlineFragment") {
63568
- if (isFragmentApplicable$t(selectionNode, source.data.__typename)) {
63569
- // Get selections out of the inline fragment
63570
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
63571
- // Call into field handling with selections
63572
- Object.assign(sink, buildSelectionForNode$s(source, reader, parentNode, fragmentSelection, variables, fragments));
63573
- });
63574
- }
63575
- }
63576
- if (selectionNode.kind === "FragmentSpread") {
63577
- const namedFragment = fragments[selectionNode.name.value];
63578
- if (namedFragment && isFragmentApplicable$t(namedFragment, source.data.__typename)) {
63579
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
63580
- // Call into field handling with selections
63581
- Object.assign(sink, buildSelectionForNode$s(source, reader, parentNode, fragmentSelection, variables, fragments));
63582
- });
63583
- }
63584
- }
63585
- if (selectionNode.kind === "Field") {
63586
- Object.assign(sink, buildSelectionForField$s(source, reader, selectionNode, variables));
63587
- }
63588
- return sink;
62589
+ function buildSelectionForNode$t(source, reader, parentNode, selectionNode, variables, fragments) {
62590
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$t, buildSelectionForField$t);
63589
62591
  }
63590
62592
  function select$C(field, variables, fragments) {
63591
62593
  return (source, reader) => {
63592
62594
  var _a;
63593
62595
  const sink = {};
63594
62596
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
63595
- const builtSelection = buildSelectionForNode$s(source, reader, field, sel, variables, fragments);
62597
+ const builtSelection = buildSelectionForNode$t(source, reader, field, sel, variables, fragments);
63596
62598
  if (builtSelection !== undefined) {
63597
62599
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
63598
62600
  Object.keys(builtSelection).forEach((key, value) => {
@@ -63734,79 +62736,18 @@
63734
62736
  }
63735
62737
  return sink;
63736
62738
  }
63737
- function buildSelectionForField$r(source, reader, sel, variables, fragments) {
63738
- const sink = {};
63739
- const fieldData = getFieldData$r(source, sel, variables);
63740
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
63741
- reader.enterPath(requestedFieldName);
63742
- if (fieldData === undefined) {
63743
- reader.markMissing();
63744
- reader.exitPath();
63745
- return;
63746
- }
63747
- if (fieldData === null) {
63748
- reader.assignScalar(requestedFieldName, sink, fieldData);
63749
- return sink;
63750
- }
63751
- const fieldType = getFieldType$M(sel);
63752
- if (fieldType === undefined) {
63753
- // This field's type is unknown to us. This breaks normalization.
63754
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
63755
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
63756
- }
63757
- else if (fieldType.isArray) {
63758
- const arraySink = [];
63759
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
63760
- reader.enterPath(i);
63761
- selectType$s(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
63762
- reader.exitPath();
63763
- }
63764
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
63765
- }
63766
- else {
63767
- selectType$s(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
63768
- }
63769
- reader.exitPath();
63770
- return sink;
62739
+ function buildSelectionForField$s(source, reader, sel, variables, fragments) {
62740
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$r, getFieldType$M, selectType$s);
63771
62741
  }
63772
- function buildSelectionForNode$r(source, reader, parentNode, selectionNode, variables, fragments) {
63773
- const sink = {};
63774
- if (selectionNode.directives) {
63775
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
63776
- if (selectionWithDirectives === undefined) {
63777
- return;
63778
- }
63779
- selectionNode = selectionWithDirectives;
63780
- }
63781
- if (selectionNode.kind === "InlineFragment") {
63782
- if (isFragmentApplicable$s(selectionNode, source.data.__typename)) {
63783
- // Get selections out of the inline fragment
63784
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
63785
- // Call into field handling with selections
63786
- Object.assign(sink, buildSelectionForNode$r(source, reader, parentNode, fragmentSelection, variables, fragments));
63787
- });
63788
- }
63789
- }
63790
- if (selectionNode.kind === "FragmentSpread") {
63791
- const namedFragment = fragments[selectionNode.name.value];
63792
- if (namedFragment && isFragmentApplicable$s(namedFragment, source.data.__typename)) {
63793
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
63794
- // Call into field handling with selections
63795
- Object.assign(sink, buildSelectionForNode$r(source, reader, parentNode, fragmentSelection, variables, fragments));
63796
- });
63797
- }
63798
- }
63799
- if (selectionNode.kind === "Field") {
63800
- Object.assign(sink, buildSelectionForField$r(source, reader, selectionNode, variables));
63801
- }
63802
- return sink;
62742
+ function buildSelectionForNode$s(source, reader, parentNode, selectionNode, variables, fragments) {
62743
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$s, buildSelectionForField$s);
63803
62744
  }
63804
62745
  function select$B(field, variables, fragments) {
63805
62746
  return (source, reader) => {
63806
62747
  var _a;
63807
62748
  const sink = {};
63808
62749
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
63809
- const builtSelection = buildSelectionForNode$r(source, reader, field, sel, variables, fragments);
62750
+ const builtSelection = buildSelectionForNode$s(source, reader, field, sel, variables, fragments);
63810
62751
  if (builtSelection !== undefined) {
63811
62752
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
63812
62753
  Object.keys(builtSelection).forEach((key, value) => {
@@ -63948,79 +62889,18 @@
63948
62889
  }
63949
62890
  return sink;
63950
62891
  }
63951
- function buildSelectionForField$q(source, reader, sel, variables, fragments) {
63952
- const sink = {};
63953
- const fieldData = getFieldData$q(source, sel, variables);
63954
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
63955
- reader.enterPath(requestedFieldName);
63956
- if (fieldData === undefined) {
63957
- reader.markMissing();
63958
- reader.exitPath();
63959
- return;
63960
- }
63961
- if (fieldData === null) {
63962
- reader.assignScalar(requestedFieldName, sink, fieldData);
63963
- return sink;
63964
- }
63965
- const fieldType = getFieldType$L(sel);
63966
- if (fieldType === undefined) {
63967
- // This field's type is unknown to us. This breaks normalization.
63968
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
63969
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
63970
- }
63971
- else if (fieldType.isArray) {
63972
- const arraySink = [];
63973
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
63974
- reader.enterPath(i);
63975
- selectType$r(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
63976
- reader.exitPath();
63977
- }
63978
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
63979
- }
63980
- else {
63981
- selectType$r(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
63982
- }
63983
- reader.exitPath();
63984
- return sink;
62892
+ function buildSelectionForField$r(source, reader, sel, variables, fragments) {
62893
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$q, getFieldType$L, selectType$r);
63985
62894
  }
63986
- function buildSelectionForNode$q(source, reader, parentNode, selectionNode, variables, fragments) {
63987
- const sink = {};
63988
- if (selectionNode.directives) {
63989
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
63990
- if (selectionWithDirectives === undefined) {
63991
- return;
63992
- }
63993
- selectionNode = selectionWithDirectives;
63994
- }
63995
- if (selectionNode.kind === "InlineFragment") {
63996
- if (isFragmentApplicable$r(selectionNode, source.data.__typename)) {
63997
- // Get selections out of the inline fragment
63998
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
63999
- // Call into field handling with selections
64000
- Object.assign(sink, buildSelectionForNode$q(source, reader, parentNode, fragmentSelection, variables, fragments));
64001
- });
64002
- }
64003
- }
64004
- if (selectionNode.kind === "FragmentSpread") {
64005
- const namedFragment = fragments[selectionNode.name.value];
64006
- if (namedFragment && isFragmentApplicable$r(namedFragment, source.data.__typename)) {
64007
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
64008
- // Call into field handling with selections
64009
- Object.assign(sink, buildSelectionForNode$q(source, reader, parentNode, fragmentSelection, variables, fragments));
64010
- });
64011
- }
64012
- }
64013
- if (selectionNode.kind === "Field") {
64014
- Object.assign(sink, buildSelectionForField$q(source, reader, selectionNode, variables));
64015
- }
64016
- return sink;
62895
+ function buildSelectionForNode$r(source, reader, parentNode, selectionNode, variables, fragments) {
62896
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$r, buildSelectionForField$r);
64017
62897
  }
64018
62898
  function select$A(field, variables, fragments) {
64019
62899
  return (source, reader) => {
64020
62900
  var _a;
64021
62901
  const sink = {};
64022
62902
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
64023
- const builtSelection = buildSelectionForNode$q(source, reader, field, sel, variables, fragments);
62903
+ const builtSelection = buildSelectionForNode$r(source, reader, field, sel, variables, fragments);
64024
62904
  if (builtSelection !== undefined) {
64025
62905
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
64026
62906
  Object.keys(builtSelection).forEach((key, value) => {
@@ -64162,79 +63042,18 @@
64162
63042
  }
64163
63043
  return sink;
64164
63044
  }
64165
- function buildSelectionForField$p(source, reader, sel, variables, fragments) {
64166
- const sink = {};
64167
- const fieldData = getFieldData$p(source, sel, variables);
64168
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
64169
- reader.enterPath(requestedFieldName);
64170
- if (fieldData === undefined) {
64171
- reader.markMissing();
64172
- reader.exitPath();
64173
- return;
64174
- }
64175
- if (fieldData === null) {
64176
- reader.assignScalar(requestedFieldName, sink, fieldData);
64177
- return sink;
64178
- }
64179
- const fieldType = getFieldType$K(sel);
64180
- if (fieldType === undefined) {
64181
- // This field's type is unknown to us. This breaks normalization.
64182
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
64183
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
64184
- }
64185
- else if (fieldType.isArray) {
64186
- const arraySink = [];
64187
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
64188
- reader.enterPath(i);
64189
- selectType$q(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
64190
- reader.exitPath();
64191
- }
64192
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
64193
- }
64194
- else {
64195
- selectType$q(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
64196
- }
64197
- reader.exitPath();
64198
- return sink;
63045
+ function buildSelectionForField$q(source, reader, sel, variables, fragments) {
63046
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$p, getFieldType$K, selectType$q);
64199
63047
  }
64200
- function buildSelectionForNode$p(source, reader, parentNode, selectionNode, variables, fragments) {
64201
- const sink = {};
64202
- if (selectionNode.directives) {
64203
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
64204
- if (selectionWithDirectives === undefined) {
64205
- return;
64206
- }
64207
- selectionNode = selectionWithDirectives;
64208
- }
64209
- if (selectionNode.kind === "InlineFragment") {
64210
- if (isFragmentApplicable$q(selectionNode, source.data.__typename)) {
64211
- // Get selections out of the inline fragment
64212
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
64213
- // Call into field handling with selections
64214
- Object.assign(sink, buildSelectionForNode$p(source, reader, parentNode, fragmentSelection, variables, fragments));
64215
- });
64216
- }
64217
- }
64218
- if (selectionNode.kind === "FragmentSpread") {
64219
- const namedFragment = fragments[selectionNode.name.value];
64220
- if (namedFragment && isFragmentApplicable$q(namedFragment, source.data.__typename)) {
64221
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
64222
- // Call into field handling with selections
64223
- Object.assign(sink, buildSelectionForNode$p(source, reader, parentNode, fragmentSelection, variables, fragments));
64224
- });
64225
- }
64226
- }
64227
- if (selectionNode.kind === "Field") {
64228
- Object.assign(sink, buildSelectionForField$p(source, reader, selectionNode, variables));
64229
- }
64230
- return sink;
63048
+ function buildSelectionForNode$q(source, reader, parentNode, selectionNode, variables, fragments) {
63049
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$q, buildSelectionForField$q);
64231
63050
  }
64232
63051
  function select$z(field, variables, fragments) {
64233
63052
  return (source, reader) => {
64234
63053
  var _a;
64235
63054
  const sink = {};
64236
63055
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
64237
- const builtSelection = buildSelectionForNode$p(source, reader, field, sel, variables, fragments);
63056
+ const builtSelection = buildSelectionForNode$q(source, reader, field, sel, variables, fragments);
64238
63057
  if (builtSelection !== undefined) {
64239
63058
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
64240
63059
  Object.keys(builtSelection).forEach((key, value) => {
@@ -64382,79 +63201,18 @@
64382
63201
  }
64383
63202
  return sink;
64384
63203
  }
64385
- function buildSelectionForField$o(source, reader, sel, variables, fragments) {
64386
- const sink = {};
64387
- const fieldData = getFieldData$o(source, sel, variables);
64388
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
64389
- reader.enterPath(requestedFieldName);
64390
- if (fieldData === undefined) {
64391
- reader.markMissing();
64392
- reader.exitPath();
64393
- return;
64394
- }
64395
- if (fieldData === null) {
64396
- reader.assignScalar(requestedFieldName, sink, fieldData);
64397
- return sink;
64398
- }
64399
- const fieldType = getFieldType$J(sel);
64400
- if (fieldType === undefined) {
64401
- // This field's type is unknown to us. This breaks normalization.
64402
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
64403
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
64404
- }
64405
- else if (fieldType.isArray) {
64406
- const arraySink = [];
64407
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
64408
- reader.enterPath(i);
64409
- selectType$p(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
64410
- reader.exitPath();
64411
- }
64412
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
64413
- }
64414
- else {
64415
- selectType$p(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
64416
- }
64417
- reader.exitPath();
64418
- return sink;
63204
+ function buildSelectionForField$p(source, reader, sel, variables, fragments) {
63205
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$o, getFieldType$J, selectType$p);
64419
63206
  }
64420
- function buildSelectionForNode$o(source, reader, parentNode, selectionNode, variables, fragments) {
64421
- const sink = {};
64422
- if (selectionNode.directives) {
64423
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
64424
- if (selectionWithDirectives === undefined) {
64425
- return;
64426
- }
64427
- selectionNode = selectionWithDirectives;
64428
- }
64429
- if (selectionNode.kind === "InlineFragment") {
64430
- if (isFragmentApplicable$p(selectionNode, source.data.__typename)) {
64431
- // Get selections out of the inline fragment
64432
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
64433
- // Call into field handling with selections
64434
- Object.assign(sink, buildSelectionForNode$o(source, reader, parentNode, fragmentSelection, variables, fragments));
64435
- });
64436
- }
64437
- }
64438
- if (selectionNode.kind === "FragmentSpread") {
64439
- const namedFragment = fragments[selectionNode.name.value];
64440
- if (namedFragment && isFragmentApplicable$p(namedFragment, source.data.__typename)) {
64441
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
64442
- // Call into field handling with selections
64443
- Object.assign(sink, buildSelectionForNode$o(source, reader, parentNode, fragmentSelection, variables, fragments));
64444
- });
64445
- }
64446
- }
64447
- if (selectionNode.kind === "Field") {
64448
- Object.assign(sink, buildSelectionForField$o(source, reader, selectionNode, variables));
64449
- }
64450
- return sink;
63207
+ function buildSelectionForNode$p(source, reader, parentNode, selectionNode, variables, fragments) {
63208
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$p, buildSelectionForField$p);
64451
63209
  }
64452
63210
  function select$y(field, variables, fragments) {
64453
63211
  return (source, reader) => {
64454
63212
  var _a;
64455
63213
  const sink = {};
64456
63214
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
64457
- const builtSelection = buildSelectionForNode$o(source, reader, field, sel, variables, fragments);
63215
+ const builtSelection = buildSelectionForNode$p(source, reader, field, sel, variables, fragments);
64458
63216
  if (builtSelection !== undefined) {
64459
63217
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
64460
63218
  Object.keys(builtSelection).forEach((key, value) => {
@@ -64596,79 +63354,18 @@
64596
63354
  }
64597
63355
  return sink;
64598
63356
  }
64599
- function buildSelectionForField$n(source, reader, sel, variables, fragments) {
64600
- const sink = {};
64601
- const fieldData = getFieldData$n(source, sel, variables);
64602
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
64603
- reader.enterPath(requestedFieldName);
64604
- if (fieldData === undefined) {
64605
- reader.markMissing();
64606
- reader.exitPath();
64607
- return;
64608
- }
64609
- if (fieldData === null) {
64610
- reader.assignScalar(requestedFieldName, sink, fieldData);
64611
- return sink;
64612
- }
64613
- const fieldType = getFieldType$I(sel);
64614
- if (fieldType === undefined) {
64615
- // This field's type is unknown to us. This breaks normalization.
64616
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
64617
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
64618
- }
64619
- else if (fieldType.isArray) {
64620
- const arraySink = [];
64621
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
64622
- reader.enterPath(i);
64623
- selectType$o(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
64624
- reader.exitPath();
64625
- }
64626
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
64627
- }
64628
- else {
64629
- selectType$o(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
64630
- }
64631
- reader.exitPath();
64632
- return sink;
63357
+ function buildSelectionForField$o(source, reader, sel, variables, fragments) {
63358
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$n, getFieldType$I, selectType$o);
64633
63359
  }
64634
- function buildSelectionForNode$n(source, reader, parentNode, selectionNode, variables, fragments) {
64635
- const sink = {};
64636
- if (selectionNode.directives) {
64637
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
64638
- if (selectionWithDirectives === undefined) {
64639
- return;
64640
- }
64641
- selectionNode = selectionWithDirectives;
64642
- }
64643
- if (selectionNode.kind === "InlineFragment") {
64644
- if (isFragmentApplicable$o(selectionNode, source.data.__typename)) {
64645
- // Get selections out of the inline fragment
64646
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
64647
- // Call into field handling with selections
64648
- Object.assign(sink, buildSelectionForNode$n(source, reader, parentNode, fragmentSelection, variables, fragments));
64649
- });
64650
- }
64651
- }
64652
- if (selectionNode.kind === "FragmentSpread") {
64653
- const namedFragment = fragments[selectionNode.name.value];
64654
- if (namedFragment && isFragmentApplicable$o(namedFragment, source.data.__typename)) {
64655
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
64656
- // Call into field handling with selections
64657
- Object.assign(sink, buildSelectionForNode$n(source, reader, parentNode, fragmentSelection, variables, fragments));
64658
- });
64659
- }
64660
- }
64661
- if (selectionNode.kind === "Field") {
64662
- Object.assign(sink, buildSelectionForField$n(source, reader, selectionNode, variables));
64663
- }
64664
- return sink;
63360
+ function buildSelectionForNode$o(source, reader, parentNode, selectionNode, variables, fragments) {
63361
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$o, buildSelectionForField$o);
64665
63362
  }
64666
63363
  function select$x(field, variables, fragments) {
64667
63364
  return (source, reader) => {
64668
63365
  var _a;
64669
63366
  const sink = {};
64670
63367
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
64671
- const builtSelection = buildSelectionForNode$n(source, reader, field, sel, variables, fragments);
63368
+ const builtSelection = buildSelectionForNode$o(source, reader, field, sel, variables, fragments);
64672
63369
  if (builtSelection !== undefined) {
64673
63370
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
64674
63371
  Object.keys(builtSelection).forEach((key, value) => {
@@ -64810,79 +63507,18 @@
64810
63507
  }
64811
63508
  return sink;
64812
63509
  }
64813
- function buildSelectionForField$m(source, reader, sel, variables, fragments) {
64814
- const sink = {};
64815
- const fieldData = getFieldData$m(source, sel, variables);
64816
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
64817
- reader.enterPath(requestedFieldName);
64818
- if (fieldData === undefined) {
64819
- reader.markMissing();
64820
- reader.exitPath();
64821
- return;
64822
- }
64823
- if (fieldData === null) {
64824
- reader.assignScalar(requestedFieldName, sink, fieldData);
64825
- return sink;
64826
- }
64827
- const fieldType = getFieldType$H(sel);
64828
- if (fieldType === undefined) {
64829
- // This field's type is unknown to us. This breaks normalization.
64830
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
64831
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
64832
- }
64833
- else if (fieldType.isArray) {
64834
- const arraySink = [];
64835
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
64836
- reader.enterPath(i);
64837
- selectType$n(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
64838
- reader.exitPath();
64839
- }
64840
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
64841
- }
64842
- else {
64843
- selectType$n(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
64844
- }
64845
- reader.exitPath();
64846
- return sink;
63510
+ function buildSelectionForField$n(source, reader, sel, variables, fragments) {
63511
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$m, getFieldType$H, selectType$n);
64847
63512
  }
64848
- function buildSelectionForNode$m(source, reader, parentNode, selectionNode, variables, fragments) {
64849
- const sink = {};
64850
- if (selectionNode.directives) {
64851
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
64852
- if (selectionWithDirectives === undefined) {
64853
- return;
64854
- }
64855
- selectionNode = selectionWithDirectives;
64856
- }
64857
- if (selectionNode.kind === "InlineFragment") {
64858
- if (isFragmentApplicable$n(selectionNode, source.data.__typename)) {
64859
- // Get selections out of the inline fragment
64860
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
64861
- // Call into field handling with selections
64862
- Object.assign(sink, buildSelectionForNode$m(source, reader, parentNode, fragmentSelection, variables, fragments));
64863
- });
64864
- }
64865
- }
64866
- if (selectionNode.kind === "FragmentSpread") {
64867
- const namedFragment = fragments[selectionNode.name.value];
64868
- if (namedFragment && isFragmentApplicable$n(namedFragment, source.data.__typename)) {
64869
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
64870
- // Call into field handling with selections
64871
- Object.assign(sink, buildSelectionForNode$m(source, reader, parentNode, fragmentSelection, variables, fragments));
64872
- });
64873
- }
64874
- }
64875
- if (selectionNode.kind === "Field") {
64876
- Object.assign(sink, buildSelectionForField$m(source, reader, selectionNode, variables));
64877
- }
64878
- return sink;
63513
+ function buildSelectionForNode$n(source, reader, parentNode, selectionNode, variables, fragments) {
63514
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$n, buildSelectionForField$n);
64879
63515
  }
64880
63516
  function select$w(field, variables, fragments) {
64881
63517
  return (source, reader) => {
64882
63518
  var _a;
64883
63519
  const sink = {};
64884
63520
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
64885
- const builtSelection = buildSelectionForNode$m(source, reader, field, sel, variables, fragments);
63521
+ const builtSelection = buildSelectionForNode$n(source, reader, field, sel, variables, fragments);
64886
63522
  if (builtSelection !== undefined) {
64887
63523
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
64888
63524
  Object.keys(builtSelection).forEach((key, value) => {
@@ -65030,79 +63666,18 @@
65030
63666
  }
65031
63667
  return sink;
65032
63668
  }
65033
- function buildSelectionForField$l(source, reader, sel, variables, fragments) {
65034
- const sink = {};
65035
- const fieldData = getFieldData$l(source, sel, variables);
65036
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
65037
- reader.enterPath(requestedFieldName);
65038
- if (fieldData === undefined) {
65039
- reader.markMissing();
65040
- reader.exitPath();
65041
- return;
65042
- }
65043
- if (fieldData === null) {
65044
- reader.assignScalar(requestedFieldName, sink, fieldData);
65045
- return sink;
65046
- }
65047
- const fieldType = getFieldType$G(sel);
65048
- if (fieldType === undefined) {
65049
- // This field's type is unknown to us. This breaks normalization.
65050
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
65051
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
65052
- }
65053
- else if (fieldType.isArray) {
65054
- const arraySink = [];
65055
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
65056
- reader.enterPath(i);
65057
- selectType$m(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
65058
- reader.exitPath();
65059
- }
65060
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
65061
- }
65062
- else {
65063
- selectType$m(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
65064
- }
65065
- reader.exitPath();
65066
- return sink;
63669
+ function buildSelectionForField$m(source, reader, sel, variables, fragments) {
63670
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$l, getFieldType$G, selectType$m);
65067
63671
  }
65068
- function buildSelectionForNode$l(source, reader, parentNode, selectionNode, variables, fragments) {
65069
- const sink = {};
65070
- if (selectionNode.directives) {
65071
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
65072
- if (selectionWithDirectives === undefined) {
65073
- return;
65074
- }
65075
- selectionNode = selectionWithDirectives;
65076
- }
65077
- if (selectionNode.kind === "InlineFragment") {
65078
- if (isFragmentApplicable$m(selectionNode, source.data.__typename)) {
65079
- // Get selections out of the inline fragment
65080
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
65081
- // Call into field handling with selections
65082
- Object.assign(sink, buildSelectionForNode$l(source, reader, parentNode, fragmentSelection, variables, fragments));
65083
- });
65084
- }
65085
- }
65086
- if (selectionNode.kind === "FragmentSpread") {
65087
- const namedFragment = fragments[selectionNode.name.value];
65088
- if (namedFragment && isFragmentApplicable$m(namedFragment, source.data.__typename)) {
65089
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
65090
- // Call into field handling with selections
65091
- Object.assign(sink, buildSelectionForNode$l(source, reader, parentNode, fragmentSelection, variables, fragments));
65092
- });
65093
- }
65094
- }
65095
- if (selectionNode.kind === "Field") {
65096
- Object.assign(sink, buildSelectionForField$l(source, reader, selectionNode, variables));
65097
- }
65098
- return sink;
63672
+ function buildSelectionForNode$m(source, reader, parentNode, selectionNode, variables, fragments) {
63673
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$m, buildSelectionForField$m);
65099
63674
  }
65100
63675
  function select$v(field, variables, fragments) {
65101
63676
  return (source, reader) => {
65102
63677
  var _a;
65103
63678
  const sink = {};
65104
63679
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
65105
- const builtSelection = buildSelectionForNode$l(source, reader, field, sel, variables, fragments);
63680
+ const builtSelection = buildSelectionForNode$m(source, reader, field, sel, variables, fragments);
65106
63681
  if (builtSelection !== undefined) {
65107
63682
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
65108
63683
  Object.keys(builtSelection).forEach((key, value) => {
@@ -65250,79 +63825,18 @@
65250
63825
  }
65251
63826
  return sink;
65252
63827
  }
65253
- function buildSelectionForField$k(source, reader, sel, variables, fragments) {
65254
- const sink = {};
65255
- const fieldData = getFieldData$k(source, sel, variables);
65256
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
65257
- reader.enterPath(requestedFieldName);
65258
- if (fieldData === undefined) {
65259
- reader.markMissing();
65260
- reader.exitPath();
65261
- return;
65262
- }
65263
- if (fieldData === null) {
65264
- reader.assignScalar(requestedFieldName, sink, fieldData);
65265
- return sink;
65266
- }
65267
- const fieldType = getFieldType$F(sel);
65268
- if (fieldType === undefined) {
65269
- // This field's type is unknown to us. This breaks normalization.
65270
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
65271
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
65272
- }
65273
- else if (fieldType.isArray) {
65274
- const arraySink = [];
65275
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
65276
- reader.enterPath(i);
65277
- selectType$l(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
65278
- reader.exitPath();
65279
- }
65280
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
65281
- }
65282
- else {
65283
- selectType$l(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
65284
- }
65285
- reader.exitPath();
65286
- return sink;
63828
+ function buildSelectionForField$l(source, reader, sel, variables, fragments) {
63829
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$k, getFieldType$F, selectType$l);
65287
63830
  }
65288
- function buildSelectionForNode$k(source, reader, parentNode, selectionNode, variables, fragments) {
65289
- const sink = {};
65290
- if (selectionNode.directives) {
65291
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
65292
- if (selectionWithDirectives === undefined) {
65293
- return;
65294
- }
65295
- selectionNode = selectionWithDirectives;
65296
- }
65297
- if (selectionNode.kind === "InlineFragment") {
65298
- if (isFragmentApplicable$l(selectionNode, source.data.__typename)) {
65299
- // Get selections out of the inline fragment
65300
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
65301
- // Call into field handling with selections
65302
- Object.assign(sink, buildSelectionForNode$k(source, reader, parentNode, fragmentSelection, variables, fragments));
65303
- });
65304
- }
65305
- }
65306
- if (selectionNode.kind === "FragmentSpread") {
65307
- const namedFragment = fragments[selectionNode.name.value];
65308
- if (namedFragment && isFragmentApplicable$l(namedFragment, source.data.__typename)) {
65309
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
65310
- // Call into field handling with selections
65311
- Object.assign(sink, buildSelectionForNode$k(source, reader, parentNode, fragmentSelection, variables, fragments));
65312
- });
65313
- }
65314
- }
65315
- if (selectionNode.kind === "Field") {
65316
- Object.assign(sink, buildSelectionForField$k(source, reader, selectionNode, variables));
65317
- }
65318
- return sink;
63831
+ function buildSelectionForNode$l(source, reader, parentNode, selectionNode, variables, fragments) {
63832
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$l, buildSelectionForField$l);
65319
63833
  }
65320
63834
  function select$u(field, variables, fragments) {
65321
63835
  return (source, reader) => {
65322
63836
  var _a;
65323
63837
  const sink = {};
65324
63838
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
65325
- const builtSelection = buildSelectionForNode$k(source, reader, field, sel, variables, fragments);
63839
+ const builtSelection = buildSelectionForNode$l(source, reader, field, sel, variables, fragments);
65326
63840
  if (builtSelection !== undefined) {
65327
63841
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
65328
63842
  Object.keys(builtSelection).forEach((key, value) => {
@@ -65464,79 +63978,18 @@
65464
63978
  }
65465
63979
  return sink;
65466
63980
  }
65467
- function buildSelectionForField$j(source, reader, sel, variables, fragments) {
65468
- const sink = {};
65469
- const fieldData = getFieldData$j(source, sel, variables);
65470
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
65471
- reader.enterPath(requestedFieldName);
65472
- if (fieldData === undefined) {
65473
- reader.markMissing();
65474
- reader.exitPath();
65475
- return;
65476
- }
65477
- if (fieldData === null) {
65478
- reader.assignScalar(requestedFieldName, sink, fieldData);
65479
- return sink;
65480
- }
65481
- const fieldType = getFieldType$E(sel);
65482
- if (fieldType === undefined) {
65483
- // This field's type is unknown to us. This breaks normalization.
65484
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
65485
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
65486
- }
65487
- else if (fieldType.isArray) {
65488
- const arraySink = [];
65489
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
65490
- reader.enterPath(i);
65491
- selectType$k(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
65492
- reader.exitPath();
65493
- }
65494
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
65495
- }
65496
- else {
65497
- selectType$k(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
65498
- }
65499
- reader.exitPath();
65500
- return sink;
63981
+ function buildSelectionForField$k(source, reader, sel, variables, fragments) {
63982
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$j, getFieldType$E, selectType$k);
65501
63983
  }
65502
- function buildSelectionForNode$j(source, reader, parentNode, selectionNode, variables, fragments) {
65503
- const sink = {};
65504
- if (selectionNode.directives) {
65505
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
65506
- if (selectionWithDirectives === undefined) {
65507
- return;
65508
- }
65509
- selectionNode = selectionWithDirectives;
65510
- }
65511
- if (selectionNode.kind === "InlineFragment") {
65512
- if (isFragmentApplicable$k(selectionNode, source.data.__typename)) {
65513
- // Get selections out of the inline fragment
65514
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
65515
- // Call into field handling with selections
65516
- Object.assign(sink, buildSelectionForNode$j(source, reader, parentNode, fragmentSelection, variables, fragments));
65517
- });
65518
- }
65519
- }
65520
- if (selectionNode.kind === "FragmentSpread") {
65521
- const namedFragment = fragments[selectionNode.name.value];
65522
- if (namedFragment && isFragmentApplicable$k(namedFragment, source.data.__typename)) {
65523
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
65524
- // Call into field handling with selections
65525
- Object.assign(sink, buildSelectionForNode$j(source, reader, parentNode, fragmentSelection, variables, fragments));
65526
- });
65527
- }
65528
- }
65529
- if (selectionNode.kind === "Field") {
65530
- Object.assign(sink, buildSelectionForField$j(source, reader, selectionNode, variables));
65531
- }
65532
- return sink;
63984
+ function buildSelectionForNode$k(source, reader, parentNode, selectionNode, variables, fragments) {
63985
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$k, buildSelectionForField$k);
65533
63986
  }
65534
63987
  function select$t(field, variables, fragments) {
65535
63988
  return (source, reader) => {
65536
63989
  var _a;
65537
63990
  const sink = {};
65538
63991
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
65539
- const builtSelection = buildSelectionForNode$j(source, reader, field, sel, variables, fragments);
63992
+ const builtSelection = buildSelectionForNode$k(source, reader, field, sel, variables, fragments);
65540
63993
  if (builtSelection !== undefined) {
65541
63994
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
65542
63995
  Object.keys(builtSelection).forEach((key, value) => {
@@ -66537,79 +64990,18 @@
66537
64990
  }
66538
64991
  return sink;
66539
64992
  }
66540
- function buildSelectionForField$i(source, reader, sel, variables, fragments) {
66541
- const sink = {};
66542
- const fieldData = getFieldData$h(source, sel, variables);
66543
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
66544
- reader.enterPath(requestedFieldName);
66545
- if (fieldData === undefined) {
66546
- reader.markMissing();
66547
- reader.exitPath();
66548
- return;
66549
- }
66550
- if (fieldData === null) {
66551
- reader.assignScalar(requestedFieldName, sink, fieldData);
66552
- return sink;
66553
- }
66554
- const fieldType = getFieldType$B(sel);
66555
- if (fieldType === undefined) {
66556
- // This field's type is unknown to us. This breaks normalization.
66557
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
66558
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
66559
- }
66560
- else if (fieldType.isArray) {
66561
- const arraySink = [];
66562
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
66563
- reader.enterPath(i);
66564
- selectType$i(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
66565
- reader.exitPath();
66566
- }
66567
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
66568
- }
66569
- else {
66570
- selectType$i(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
66571
- }
66572
- reader.exitPath();
66573
- return sink;
64993
+ function buildSelectionForField$j(source, reader, sel, variables, fragments) {
64994
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$h, getFieldType$B, selectType$i);
66574
64995
  }
66575
- function buildSelectionForNode$i(source, reader, parentNode, selectionNode, variables, fragments) {
66576
- const sink = {};
66577
- if (selectionNode.directives) {
66578
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
66579
- if (selectionWithDirectives === undefined) {
66580
- return;
66581
- }
66582
- selectionNode = selectionWithDirectives;
66583
- }
66584
- if (selectionNode.kind === "InlineFragment") {
66585
- if (isFragmentApplicable$j(selectionNode, source.data.__typename)) {
66586
- // Get selections out of the inline fragment
66587
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
66588
- // Call into field handling with selections
66589
- Object.assign(sink, buildSelectionForNode$i(source, reader, parentNode, fragmentSelection, variables, fragments));
66590
- });
66591
- }
66592
- }
66593
- if (selectionNode.kind === "FragmentSpread") {
66594
- const namedFragment = fragments[selectionNode.name.value];
66595
- if (namedFragment && isFragmentApplicable$j(namedFragment, source.data.__typename)) {
66596
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
66597
- // Call into field handling with selections
66598
- Object.assign(sink, buildSelectionForNode$i(source, reader, parentNode, fragmentSelection, variables, fragments));
66599
- });
66600
- }
66601
- }
66602
- if (selectionNode.kind === "Field") {
66603
- Object.assign(sink, buildSelectionForField$i(source, reader, selectionNode, variables));
66604
- }
66605
- return sink;
64996
+ function buildSelectionForNode$j(source, reader, parentNode, selectionNode, variables, fragments) {
64997
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$j, buildSelectionForField$j);
66606
64998
  }
66607
64999
  function select$r(field, variables, fragments) {
66608
65000
  return (source, reader) => {
66609
65001
  var _a;
66610
65002
  const sink = {};
66611
65003
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
66612
- const builtSelection = buildSelectionForNode$i(source, reader, field, sel, variables, fragments);
65004
+ const builtSelection = buildSelectionForNode$j(source, reader, field, sel, variables, fragments);
66613
65005
  if (builtSelection !== undefined) {
66614
65006
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
66615
65007
  Object.keys(builtSelection).forEach((key, value) => {
@@ -67453,7 +65845,7 @@
67453
65845
  }
67454
65846
  else {
67455
65847
  trimmedEdges = trimEdges(source.edges, startOffset, endOffset);
67456
- maxOffset = !listIsComplete ? findMaxOffset(metadata) : Object.keys(metadata).length - 2;
65848
+ maxOffset = findMaxOffset(metadata);
67457
65849
  const listHasEnoughItems = (endOffset - 1 <= maxOffset);
67458
65850
  if (trimmedEdges === undefined || !listHasEnoughItems) {
67459
65851
  reader.markMissingLink(fieldData.__ref);
@@ -67491,72 +65883,11 @@
67491
65883
  }
67492
65884
  return sink;
67493
65885
  }
67494
- function buildSelectionForField$h(source, reader, sel, variables, fragments) {
67495
- const sink = {};
67496
- const fieldData = getFieldData$i(source, sel, variables);
67497
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
67498
- reader.enterPath(requestedFieldName);
67499
- if (fieldData === undefined) {
67500
- reader.markMissing();
67501
- reader.exitPath();
67502
- return;
67503
- }
67504
- if (fieldData === null) {
67505
- reader.assignScalar(requestedFieldName, sink, fieldData);
67506
- return sink;
67507
- }
67508
- const fieldType = getFieldType$C(sel);
67509
- if (fieldType === undefined) {
67510
- // This field's type is unknown to us. This breaks normalization.
67511
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
67512
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
67513
- }
67514
- else if (fieldType.isArray) {
67515
- const arraySink = [];
67516
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
67517
- reader.enterPath(i);
67518
- selectType$j(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
67519
- reader.exitPath();
67520
- }
67521
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
67522
- }
67523
- else {
67524
- selectType$j(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
67525
- }
67526
- reader.exitPath();
67527
- return sink;
65886
+ function buildSelectionForField$i(source, reader, sel, variables, fragments) {
65887
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$i, getFieldType$C, selectType$j);
67528
65888
  }
67529
- function buildSelectionForNode$h(source, reader, parentNode, selectionNode, variables, fragments) {
67530
- const sink = {};
67531
- if (selectionNode.directives) {
67532
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
67533
- if (selectionWithDirectives === undefined) {
67534
- return;
67535
- }
67536
- selectionNode = selectionWithDirectives;
67537
- }
67538
- if (selectionNode.kind === "InlineFragment") {
67539
- if (isFragmentApplicable$i(selectionNode, source.data.__typename)) {
67540
- // Get selections out of the inline fragment
67541
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
67542
- // Call into field handling with selections
67543
- Object.assign(sink, buildSelectionForNode$h(source, reader, parentNode, fragmentSelection, variables, fragments));
67544
- });
67545
- }
67546
- }
67547
- if (selectionNode.kind === "FragmentSpread") {
67548
- const namedFragment = fragments[selectionNode.name.value];
67549
- if (namedFragment && isFragmentApplicable$i(namedFragment, source.data.__typename)) {
67550
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
67551
- // Call into field handling with selections
67552
- Object.assign(sink, buildSelectionForNode$h(source, reader, parentNode, fragmentSelection, variables, fragments));
67553
- });
67554
- }
67555
- }
67556
- if (selectionNode.kind === "Field") {
67557
- Object.assign(sink, buildSelectionForField$h(source, reader, selectionNode, variables, fragments));
67558
- }
67559
- return sink;
65889
+ function buildSelectionForNode$i(source, reader, parentNode, selectionNode, variables, fragments) {
65890
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$i, buildSelectionForField$i);
67560
65891
  }
67561
65892
  function select$q(field, variables, fragments) {
67562
65893
  return (source, reader) => {
@@ -67564,7 +65895,7 @@
67564
65895
  const sink = {};
67565
65896
  source = attachMappedData(source, reader);
67566
65897
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
67567
- const builtSelection = buildSelectionForNode$h(source, reader, field, sel, variables, fragments);
65898
+ const builtSelection = buildSelectionForNode$i(source, reader, field, sel, variables, fragments);
67568
65899
  if (builtSelection !== undefined) {
67569
65900
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
67570
65901
  Object.keys(builtSelection).forEach((key, value) => {
@@ -68500,79 +66831,18 @@
68500
66831
  }
68501
66832
  return sink;
68502
66833
  }
68503
- function buildSelectionForField$g(source, reader, sel, variables, fragments) {
68504
- const sink = {};
68505
- const fieldData = getFieldData$g(source, sel, variables);
68506
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
68507
- reader.enterPath(requestedFieldName);
68508
- if (fieldData === undefined) {
68509
- reader.markMissing();
68510
- reader.exitPath();
68511
- return;
68512
- }
68513
- if (fieldData === null) {
68514
- reader.assignScalar(requestedFieldName, sink, fieldData);
68515
- return sink;
68516
- }
68517
- const fieldType = getFieldType$A(sel);
68518
- if (fieldType === undefined) {
68519
- // This field's type is unknown to us. This breaks normalization.
68520
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
68521
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
68522
- }
68523
- else if (fieldType.isArray) {
68524
- const arraySink = [];
68525
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
68526
- reader.enterPath(i);
68527
- selectType$g(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
68528
- reader.exitPath();
68529
- }
68530
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
68531
- }
68532
- else {
68533
- selectType$g(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
68534
- }
68535
- reader.exitPath();
68536
- return sink;
66834
+ function buildSelectionForField$h(source, reader, sel, variables, fragments) {
66835
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$g, getFieldType$A, selectType$g);
68537
66836
  }
68538
- function buildSelectionForNode$g(source, reader, parentNode, selectionNode, variables, fragments) {
68539
- const sink = {};
68540
- if (selectionNode.directives) {
68541
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
68542
- if (selectionWithDirectives === undefined) {
68543
- return;
68544
- }
68545
- selectionNode = selectionWithDirectives;
68546
- }
68547
- if (selectionNode.kind === "InlineFragment") {
68548
- if (isFragmentApplicable$h(selectionNode, source.data.__typename)) {
68549
- // Get selections out of the inline fragment
68550
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
68551
- // Call into field handling with selections
68552
- Object.assign(sink, buildSelectionForNode$g(source, reader, parentNode, fragmentSelection, variables, fragments));
68553
- });
68554
- }
68555
- }
68556
- if (selectionNode.kind === "FragmentSpread") {
68557
- const namedFragment = fragments[selectionNode.name.value];
68558
- if (namedFragment && isFragmentApplicable$h(namedFragment, source.data.__typename)) {
68559
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
68560
- // Call into field handling with selections
68561
- Object.assign(sink, buildSelectionForNode$g(source, reader, parentNode, fragmentSelection, variables, fragments));
68562
- });
68563
- }
68564
- }
68565
- if (selectionNode.kind === "Field") {
68566
- Object.assign(sink, buildSelectionForField$g(source, reader, selectionNode, variables, fragments));
68567
- }
68568
- return sink;
66837
+ function buildSelectionForNode$h(source, reader, parentNode, selectionNode, variables, fragments) {
66838
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$h, buildSelectionForField$h);
68569
66839
  }
68570
66840
  function select$p(field, variables, fragments) {
68571
66841
  return (source, reader) => {
68572
66842
  var _a;
68573
66843
  const sink = {};
68574
66844
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
68575
- const builtSelection = buildSelectionForNode$g(source, reader, field, sel, variables, fragments);
66845
+ const builtSelection = buildSelectionForNode$h(source, reader, field, sel, variables, fragments);
68576
66846
  if (builtSelection !== undefined) {
68577
66847
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
68578
66848
  Object.keys(builtSelection).forEach((key, value) => {
@@ -68853,81 +67123,18 @@
68853
67123
  }
68854
67124
  return sink;
68855
67125
  }
68856
- function buildSelectionForField$f(source, reader, sel, variables, fragments) {
68857
- const sink = {};
68858
- const fieldData = getFieldData$f(source, sel, variables);
68859
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
68860
- if (requestedFieldName === 'pageInfo')
68861
- return;
68862
- reader.enterPath(requestedFieldName);
68863
- if (fieldData === undefined) {
68864
- reader.markMissing();
68865
- reader.exitPath();
68866
- return;
68867
- }
68868
- if (fieldData === null) {
68869
- reader.assignScalar(requestedFieldName, sink, fieldData);
68870
- return sink;
68871
- }
68872
- const fieldType = getFieldType$z(sel);
68873
- if (fieldType === undefined) {
68874
- // This field's type is unknown to us. This breaks normalization.
68875
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
68876
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
68877
- }
68878
- else if (fieldType.isArray) {
68879
- const arraySink = [];
68880
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
68881
- reader.enterPath(i);
68882
- selectType$f(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
68883
- reader.exitPath();
68884
- }
68885
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
68886
- }
68887
- else {
68888
- selectType$f(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
68889
- }
68890
- reader.exitPath();
68891
- return sink;
67126
+ function buildSelectionForField$g(source, reader, sel, variables, fragments) {
67127
+ return buildSelectionForField(source, reader, sel, variables, fragments, true, getFieldData$f, getFieldType$z, selectType$f);
68892
67128
  }
68893
- function buildSelectionForNode$f(source, reader, parentNode, selectionNode, variables, fragments) {
68894
- const sink = {};
68895
- if (selectionNode.directives) {
68896
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
68897
- if (selectionWithDirectives === undefined) {
68898
- return;
68899
- }
68900
- selectionNode = selectionWithDirectives;
68901
- }
68902
- if (selectionNode.kind === "InlineFragment") {
68903
- if (isFragmentApplicable$g(selectionNode, source.data.__typename)) {
68904
- // Get selections out of the inline fragment
68905
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
68906
- // Call into field handling with selections
68907
- Object.assign(sink, buildSelectionForNode$f(source, reader, parentNode, fragmentSelection, variables, fragments));
68908
- });
68909
- }
68910
- }
68911
- if (selectionNode.kind === "FragmentSpread") {
68912
- const namedFragment = fragments[selectionNode.name.value];
68913
- if (namedFragment && isFragmentApplicable$g(namedFragment, source.data.__typename)) {
68914
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
68915
- // Call into field handling with selections
68916
- Object.assign(sink, buildSelectionForNode$f(source, reader, parentNode, fragmentSelection, variables, fragments));
68917
- });
68918
- }
68919
- }
68920
- if (selectionNode.kind === "Field") {
68921
- Object.assign(sink, buildSelectionForField$f(source, reader, selectionNode, variables, fragments));
68922
- }
68923
- return sink;
67129
+ function buildSelectionForNode$g(source, reader, parentNode, selectionNode, variables, fragments) {
67130
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$g, buildSelectionForField$g);
68924
67131
  }
68925
67132
  function select$o(field, variables, fragments) {
68926
67133
  return (source, reader) => {
68927
67134
  var _a;
68928
67135
  const sink = {};
68929
67136
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
68930
- const builtSelection = buildSelectionForNode$f(source, reader, field, sel, variables, fragments);
67137
+ const builtSelection = buildSelectionForNode$g(source, reader, field, sel, variables, fragments);
68931
67138
  if (builtSelection !== undefined) {
68932
67139
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
68933
67140
  Object.keys(builtSelection).forEach((key, value) => {
@@ -69179,7 +67386,7 @@
69179
67386
  }
69180
67387
  else {
69181
67388
  trimmedEdges = trimEdges(source.edges, startOffset, endOffset);
69182
- maxOffset = !listIsComplete ? findMaxOffset(metadata) : Object.keys(metadata).length - 2;
67389
+ maxOffset = findMaxOffset(metadata);
69183
67390
  const listHasEnoughItems = (endOffset - 1 <= maxOffset);
69184
67391
  if (trimmedEdges === undefined || !listHasEnoughItems) {
69185
67392
  reader.markMissingLink(fieldData.__ref);
@@ -69217,79 +67424,18 @@
69217
67424
  }
69218
67425
  return sink;
69219
67426
  }
69220
- function buildSelectionForField$e(source, reader, sel, variables, fragments) {
69221
- const sink = {};
69222
- const fieldData = getFieldData$e(source, sel, variables);
69223
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
69224
- reader.enterPath(requestedFieldName);
69225
- if (fieldData === undefined) {
69226
- reader.markMissing();
69227
- reader.exitPath();
69228
- return;
69229
- }
69230
- if (fieldData === null) {
69231
- reader.assignScalar(requestedFieldName, sink, fieldData);
69232
- return sink;
69233
- }
69234
- const fieldType = getFieldType$y(sel);
69235
- if (fieldType === undefined) {
69236
- // This field's type is unknown to us. This breaks normalization.
69237
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
69238
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
69239
- }
69240
- else if (fieldType.isArray) {
69241
- const arraySink = [];
69242
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
69243
- reader.enterPath(i);
69244
- selectType$e(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
69245
- reader.exitPath();
69246
- }
69247
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
69248
- }
69249
- else {
69250
- selectType$e(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
69251
- }
69252
- reader.exitPath();
69253
- return sink;
67427
+ function buildSelectionForField$f(source, reader, sel, variables, fragments) {
67428
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$e, getFieldType$y, selectType$e);
69254
67429
  }
69255
- function buildSelectionForNode$e(source, reader, parentNode, selectionNode, variables, fragments) {
69256
- const sink = {};
69257
- if (selectionNode.directives) {
69258
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
69259
- if (selectionWithDirectives === undefined) {
69260
- return;
69261
- }
69262
- selectionNode = selectionWithDirectives;
69263
- }
69264
- if (selectionNode.kind === "InlineFragment") {
69265
- if (isFragmentApplicable$f(selectionNode, source.data.__typename)) {
69266
- // Get selections out of the inline fragment
69267
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
69268
- // Call into field handling with selections
69269
- Object.assign(sink, buildSelectionForNode$e(source, reader, parentNode, fragmentSelection, variables, fragments));
69270
- });
69271
- }
69272
- }
69273
- if (selectionNode.kind === "FragmentSpread") {
69274
- const namedFragment = fragments[selectionNode.name.value];
69275
- if (namedFragment && isFragmentApplicable$f(namedFragment, source.data.__typename)) {
69276
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
69277
- // Call into field handling with selections
69278
- Object.assign(sink, buildSelectionForNode$e(source, reader, parentNode, fragmentSelection, variables, fragments));
69279
- });
69280
- }
69281
- }
69282
- if (selectionNode.kind === "Field") {
69283
- Object.assign(sink, buildSelectionForField$e(source, reader, selectionNode, variables, fragments));
69284
- }
69285
- return sink;
67430
+ function buildSelectionForNode$f(source, reader, parentNode, selectionNode, variables, fragments) {
67431
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$f, buildSelectionForField$f);
69286
67432
  }
69287
67433
  function select$n(field, variables, fragments) {
69288
67434
  return (source, reader) => {
69289
67435
  var _a;
69290
67436
  const sink = {};
69291
67437
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
69292
- const builtSelection = buildSelectionForNode$e(source, reader, field, sel, variables, fragments);
67438
+ const builtSelection = buildSelectionForNode$f(source, reader, field, sel, variables, fragments);
69293
67439
  if (builtSelection !== undefined) {
69294
67440
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
69295
67441
  Object.keys(builtSelection).forEach((key, value) => {
@@ -69506,79 +67652,18 @@
69506
67652
  }
69507
67653
  return sink;
69508
67654
  }
69509
- function buildSelectionForField$d(source, reader, sel, variables, fragments) {
69510
- const sink = {};
69511
- const fieldData = getFieldData$d(source, sel, variables);
69512
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
69513
- reader.enterPath(requestedFieldName);
69514
- if (fieldData === undefined) {
69515
- reader.markMissing();
69516
- reader.exitPath();
69517
- return;
69518
- }
69519
- if (fieldData === null) {
69520
- reader.assignScalar(requestedFieldName, sink, fieldData);
69521
- return sink;
69522
- }
69523
- const fieldType = getFieldType$x(sel);
69524
- if (fieldType === undefined) {
69525
- // This field's type is unknown to us. This breaks normalization.
69526
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
69527
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
69528
- }
69529
- else if (fieldType.isArray) {
69530
- const arraySink = [];
69531
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
69532
- reader.enterPath(i);
69533
- selectType$d(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
69534
- reader.exitPath();
69535
- }
69536
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
69537
- }
69538
- else {
69539
- selectType$d(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
69540
- }
69541
- reader.exitPath();
69542
- return sink;
67655
+ function buildSelectionForField$e(source, reader, sel, variables, fragments) {
67656
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$d, getFieldType$x, selectType$d);
69543
67657
  }
69544
- function buildSelectionForNode$d(source, reader, parentNode, selectionNode, variables, fragments) {
69545
- const sink = {};
69546
- if (selectionNode.directives) {
69547
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
69548
- if (selectionWithDirectives === undefined) {
69549
- return;
69550
- }
69551
- selectionNode = selectionWithDirectives;
69552
- }
69553
- if (selectionNode.kind === "InlineFragment") {
69554
- if (isFragmentApplicable$e(selectionNode, source.data.__typename)) {
69555
- // Get selections out of the inline fragment
69556
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
69557
- // Call into field handling with selections
69558
- Object.assign(sink, buildSelectionForNode$d(source, reader, parentNode, fragmentSelection, variables, fragments));
69559
- });
69560
- }
69561
- }
69562
- if (selectionNode.kind === "FragmentSpread") {
69563
- const namedFragment = fragments[selectionNode.name.value];
69564
- if (namedFragment && isFragmentApplicable$e(namedFragment, source.data.__typename)) {
69565
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
69566
- // Call into field handling with selections
69567
- Object.assign(sink, buildSelectionForNode$d(source, reader, parentNode, fragmentSelection, variables, fragments));
69568
- });
69569
- }
69570
- }
69571
- if (selectionNode.kind === "Field") {
69572
- Object.assign(sink, buildSelectionForField$d(source, reader, selectionNode, variables, fragments));
69573
- }
69574
- return sink;
67658
+ function buildSelectionForNode$e(source, reader, parentNode, selectionNode, variables, fragments) {
67659
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$e, buildSelectionForField$e);
69575
67660
  }
69576
67661
  function select$m(field, variables, fragments) {
69577
67662
  return (source, reader) => {
69578
67663
  var _a;
69579
67664
  const sink = {};
69580
67665
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
69581
- const builtSelection = buildSelectionForNode$d(source, reader, field, sel, variables, fragments);
67666
+ const builtSelection = buildSelectionForNode$e(source, reader, field, sel, variables, fragments);
69582
67667
  if (builtSelection !== undefined) {
69583
67668
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
69584
67669
  Object.keys(builtSelection).forEach((key, value) => {
@@ -69789,79 +67874,18 @@
69789
67874
  }
69790
67875
  return sink;
69791
67876
  }
69792
- function buildSelectionForField$c(source, reader, sel, variables, fragments) {
69793
- const sink = {};
69794
- const fieldData = getFieldData$c(source, sel, variables);
69795
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
69796
- reader.enterPath(requestedFieldName);
69797
- if (fieldData === undefined) {
69798
- reader.markMissing();
69799
- reader.exitPath();
69800
- return;
69801
- }
69802
- if (fieldData === null) {
69803
- reader.assignScalar(requestedFieldName, sink, fieldData);
69804
- return sink;
69805
- }
69806
- const fieldType = getFieldType$w(sel);
69807
- if (fieldType === undefined) {
69808
- // This field's type is unknown to us. This breaks normalization.
69809
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
69810
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
69811
- }
69812
- else if (fieldType.isArray) {
69813
- const arraySink = [];
69814
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
69815
- reader.enterPath(i);
69816
- selectType$c(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
69817
- reader.exitPath();
69818
- }
69819
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
69820
- }
69821
- else {
69822
- selectType$c(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
69823
- }
69824
- reader.exitPath();
69825
- return sink;
67877
+ function buildSelectionForField$d(source, reader, sel, variables, fragments) {
67878
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$c, getFieldType$w, selectType$c);
69826
67879
  }
69827
- function buildSelectionForNode$c(source, reader, parentNode, selectionNode, variables, fragments) {
69828
- const sink = {};
69829
- if (selectionNode.directives) {
69830
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
69831
- if (selectionWithDirectives === undefined) {
69832
- return;
69833
- }
69834
- selectionNode = selectionWithDirectives;
69835
- }
69836
- if (selectionNode.kind === "InlineFragment") {
69837
- if (isFragmentApplicable$d(selectionNode, source.data.__typename)) {
69838
- // Get selections out of the inline fragment
69839
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
69840
- // Call into field handling with selections
69841
- Object.assign(sink, buildSelectionForNode$c(source, reader, parentNode, fragmentSelection, variables, fragments));
69842
- });
69843
- }
69844
- }
69845
- if (selectionNode.kind === "FragmentSpread") {
69846
- const namedFragment = fragments[selectionNode.name.value];
69847
- if (namedFragment && isFragmentApplicable$d(namedFragment, source.data.__typename)) {
69848
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
69849
- // Call into field handling with selections
69850
- Object.assign(sink, buildSelectionForNode$c(source, reader, parentNode, fragmentSelection, variables, fragments));
69851
- });
69852
- }
69853
- }
69854
- if (selectionNode.kind === "Field") {
69855
- Object.assign(sink, buildSelectionForField$c(source, reader, selectionNode, variables));
69856
- }
69857
- return sink;
67880
+ function buildSelectionForNode$d(source, reader, parentNode, selectionNode, variables, fragments) {
67881
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$d, buildSelectionForField$d);
69858
67882
  }
69859
67883
  function select$l(field, variables, fragments) {
69860
67884
  return (source, reader) => {
69861
67885
  var _a;
69862
67886
  const sink = {};
69863
67887
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
69864
- const builtSelection = buildSelectionForNode$c(source, reader, field, sel, variables, fragments);
67888
+ const builtSelection = buildSelectionForNode$d(source, reader, field, sel, variables, fragments);
69865
67889
  if (builtSelection !== undefined) {
69866
67890
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
69867
67891
  Object.keys(builtSelection).forEach((key, value) => {
@@ -70011,79 +68035,18 @@
70011
68035
  }
70012
68036
  return sink;
70013
68037
  }
70014
- function buildSelectionForField$b(source, reader, sel, variables, fragments) {
70015
- const sink = {};
70016
- const fieldData = getFieldData$b(source, sel, variables);
70017
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
70018
- reader.enterPath(requestedFieldName);
70019
- if (fieldData === undefined) {
70020
- reader.markMissing();
70021
- reader.exitPath();
70022
- return;
70023
- }
70024
- if (fieldData === null) {
70025
- reader.assignScalar(requestedFieldName, sink, fieldData);
70026
- return sink;
70027
- }
70028
- const fieldType = getFieldType$v(sel);
70029
- if (fieldType === undefined) {
70030
- // This field's type is unknown to us. This breaks normalization.
70031
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
70032
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
70033
- }
70034
- else if (fieldType.isArray) {
70035
- const arraySink = [];
70036
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
70037
- reader.enterPath(i);
70038
- selectType$b(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
70039
- reader.exitPath();
70040
- }
70041
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
70042
- }
70043
- else {
70044
- selectType$b(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
70045
- }
70046
- reader.exitPath();
70047
- return sink;
68038
+ function buildSelectionForField$c(source, reader, sel, variables, fragments) {
68039
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$b, getFieldType$v, selectType$b);
70048
68040
  }
70049
- function buildSelectionForNode$b(source, reader, parentNode, selectionNode, variables, fragments) {
70050
- const sink = {};
70051
- if (selectionNode.directives) {
70052
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
70053
- if (selectionWithDirectives === undefined) {
70054
- return;
70055
- }
70056
- selectionNode = selectionWithDirectives;
70057
- }
70058
- if (selectionNode.kind === "InlineFragment") {
70059
- if (isFragmentApplicable$c(selectionNode, source.data.__typename)) {
70060
- // Get selections out of the inline fragment
70061
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
70062
- // Call into field handling with selections
70063
- Object.assign(sink, buildSelectionForNode$b(source, reader, parentNode, fragmentSelection, variables, fragments));
70064
- });
70065
- }
70066
- }
70067
- if (selectionNode.kind === "FragmentSpread") {
70068
- const namedFragment = fragments[selectionNode.name.value];
70069
- if (namedFragment && isFragmentApplicable$c(namedFragment, source.data.__typename)) {
70070
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
70071
- // Call into field handling with selections
70072
- Object.assign(sink, buildSelectionForNode$b(source, reader, parentNode, fragmentSelection, variables, fragments));
70073
- });
70074
- }
70075
- }
70076
- if (selectionNode.kind === "Field") {
70077
- Object.assign(sink, buildSelectionForField$b(source, reader, selectionNode, variables));
70078
- }
70079
- return sink;
68041
+ function buildSelectionForNode$c(source, reader, parentNode, selectionNode, variables, fragments) {
68042
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$c, buildSelectionForField$c);
70080
68043
  }
70081
68044
  function select$k(field, variables, fragments) {
70082
68045
  return (source, reader) => {
70083
68046
  var _a;
70084
68047
  const sink = {};
70085
68048
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
70086
- const builtSelection = buildSelectionForNode$b(source, reader, field, sel, variables, fragments);
68049
+ const builtSelection = buildSelectionForNode$c(source, reader, field, sel, variables, fragments);
70087
68050
  if (builtSelection !== undefined) {
70088
68051
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
70089
68052
  Object.keys(builtSelection).forEach((key, value) => {
@@ -70261,79 +68224,18 @@
70261
68224
  }
70262
68225
  return sink;
70263
68226
  }
70264
- function buildSelectionForField$a(source, reader, sel, variables, fragments) {
70265
- const sink = {};
70266
- const fieldData = getFieldData$a(source, sel, variables);
70267
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
70268
- reader.enterPath(requestedFieldName);
70269
- if (fieldData === undefined) {
70270
- reader.markMissing();
70271
- reader.exitPath();
70272
- return;
70273
- }
70274
- if (fieldData === null) {
70275
- reader.assignScalar(requestedFieldName, sink, fieldData);
70276
- return sink;
70277
- }
70278
- const fieldType = getFieldType$u(sel);
70279
- if (fieldType === undefined) {
70280
- // This field's type is unknown to us. This breaks normalization.
70281
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
70282
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
70283
- }
70284
- else if (fieldType.isArray) {
70285
- const arraySink = [];
70286
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
70287
- reader.enterPath(i);
70288
- selectType$a(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
70289
- reader.exitPath();
70290
- }
70291
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
70292
- }
70293
- else {
70294
- selectType$a(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
70295
- }
70296
- reader.exitPath();
70297
- return sink;
68227
+ function buildSelectionForField$b(source, reader, sel, variables, fragments) {
68228
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$a, getFieldType$u, selectType$a);
70298
68229
  }
70299
- function buildSelectionForNode$a(source, reader, parentNode, selectionNode, variables, fragments) {
70300
- const sink = {};
70301
- if (selectionNode.directives) {
70302
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
70303
- if (selectionWithDirectives === undefined) {
70304
- return;
70305
- }
70306
- selectionNode = selectionWithDirectives;
70307
- }
70308
- if (selectionNode.kind === "InlineFragment") {
70309
- if (isFragmentApplicable$b(selectionNode, source.data.__typename)) {
70310
- // Get selections out of the inline fragment
70311
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
70312
- // Call into field handling with selections
70313
- Object.assign(sink, buildSelectionForNode$a(source, reader, parentNode, fragmentSelection, variables, fragments));
70314
- });
70315
- }
70316
- }
70317
- if (selectionNode.kind === "FragmentSpread") {
70318
- const namedFragment = fragments[selectionNode.name.value];
70319
- if (namedFragment && isFragmentApplicable$b(namedFragment, source.data.__typename)) {
70320
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
70321
- // Call into field handling with selections
70322
- Object.assign(sink, buildSelectionForNode$a(source, reader, parentNode, fragmentSelection, variables, fragments));
70323
- });
70324
- }
70325
- }
70326
- if (selectionNode.kind === "Field") {
70327
- Object.assign(sink, buildSelectionForField$a(source, reader, selectionNode, variables, fragments));
70328
- }
70329
- return sink;
68230
+ function buildSelectionForNode$b(source, reader, parentNode, selectionNode, variables, fragments) {
68231
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$b, buildSelectionForField$b);
70330
68232
  }
70331
68233
  function select$j(field, variables, fragments) {
70332
68234
  return (source, reader) => {
70333
68235
  var _a;
70334
68236
  const sink = {};
70335
68237
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
70336
- const builtSelection = buildSelectionForNode$a(source, reader, field, sel, variables, fragments);
68238
+ const builtSelection = buildSelectionForNode$b(source, reader, field, sel, variables, fragments);
70337
68239
  if (builtSelection !== undefined) {
70338
68240
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
70339
68241
  Object.keys(builtSelection).forEach((key, value) => {
@@ -70586,79 +68488,18 @@
70586
68488
  }
70587
68489
  return sink;
70588
68490
  }
70589
- function buildSelectionForField$9(source, reader, sel, variables, fragments) {
70590
- const sink = {};
70591
- const fieldData = getFieldData$9(source, sel, variables);
70592
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
70593
- reader.enterPath(requestedFieldName);
70594
- if (fieldData === undefined) {
70595
- reader.markMissing();
70596
- reader.exitPath();
70597
- return;
70598
- }
70599
- if (fieldData === null) {
70600
- reader.assignScalar(requestedFieldName, sink, fieldData);
70601
- return sink;
70602
- }
70603
- const fieldType = getFieldType$t(sel);
70604
- if (fieldType === undefined) {
70605
- // This field's type is unknown to us. This breaks normalization.
70606
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
70607
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
70608
- }
70609
- else if (fieldType.isArray) {
70610
- const arraySink = [];
70611
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
70612
- reader.enterPath(i);
70613
- selectType$9(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
70614
- reader.exitPath();
70615
- }
70616
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
70617
- }
70618
- else {
70619
- selectType$9(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
70620
- }
70621
- reader.exitPath();
70622
- return sink;
68491
+ function buildSelectionForField$a(source, reader, sel, variables, fragments) {
68492
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$9, getFieldType$t, selectType$9);
70623
68493
  }
70624
- function buildSelectionForNode$9(source, reader, parentNode, selectionNode, variables, fragments) {
70625
- const sink = {};
70626
- if (selectionNode.directives) {
70627
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
70628
- if (selectionWithDirectives === undefined) {
70629
- return;
70630
- }
70631
- selectionNode = selectionWithDirectives;
70632
- }
70633
- if (selectionNode.kind === "InlineFragment") {
70634
- if (isFragmentApplicable$a(selectionNode, source.data.__typename)) {
70635
- // Get selections out of the inline fragment
70636
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
70637
- // Call into field handling with selections
70638
- Object.assign(sink, buildSelectionForNode$9(source, reader, parentNode, fragmentSelection, variables, fragments));
70639
- });
70640
- }
70641
- }
70642
- if (selectionNode.kind === "FragmentSpread") {
70643
- const namedFragment = fragments[selectionNode.name.value];
70644
- if (namedFragment && isFragmentApplicable$a(namedFragment, source.data.__typename)) {
70645
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
70646
- // Call into field handling with selections
70647
- Object.assign(sink, buildSelectionForNode$9(source, reader, parentNode, fragmentSelection, variables, fragments));
70648
- });
70649
- }
70650
- }
70651
- if (selectionNode.kind === "Field") {
70652
- Object.assign(sink, buildSelectionForField$9(source, reader, selectionNode, variables, fragments));
70653
- }
70654
- return sink;
68494
+ function buildSelectionForNode$a(source, reader, parentNode, selectionNode, variables, fragments) {
68495
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$a, buildSelectionForField$a);
70655
68496
  }
70656
68497
  function select$i(field, variables, fragments) {
70657
68498
  return (source, reader) => {
70658
68499
  var _a;
70659
68500
  const sink = {};
70660
68501
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
70661
- const builtSelection = buildSelectionForNode$9(source, reader, field, sel, variables, fragments);
68502
+ const builtSelection = buildSelectionForNode$a(source, reader, field, sel, variables, fragments);
70662
68503
  if (builtSelection !== undefined) {
70663
68504
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
70664
68505
  Object.keys(builtSelection).forEach((key, value) => {
@@ -71061,79 +68902,18 @@
71061
68902
  }
71062
68903
  return sink;
71063
68904
  }
71064
- function buildSelectionForField$8(source, reader, sel, variables, fragments) {
71065
- const sink = {};
71066
- const fieldData = getFieldData$8(source, sel, variables);
71067
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
71068
- reader.enterPath(requestedFieldName);
71069
- if (fieldData === undefined) {
71070
- reader.markMissing();
71071
- reader.exitPath();
71072
- return;
71073
- }
71074
- if (fieldData === null) {
71075
- reader.assignScalar(requestedFieldName, sink, fieldData);
71076
- return sink;
71077
- }
71078
- const fieldType = getFieldType$s(sel);
71079
- if (fieldType === undefined) {
71080
- // This field's type is unknown to us. This breaks normalization.
71081
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
71082
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
71083
- }
71084
- else if (fieldType.isArray) {
71085
- const arraySink = [];
71086
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
71087
- reader.enterPath(i);
71088
- selectType$8(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
71089
- reader.exitPath();
71090
- }
71091
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
71092
- }
71093
- else {
71094
- selectType$8(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
71095
- }
71096
- reader.exitPath();
71097
- return sink;
68905
+ function buildSelectionForField$9(source, reader, sel, variables, fragments) {
68906
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$8, getFieldType$s, selectType$8);
71098
68907
  }
71099
- function buildSelectionForNode$8(source, reader, parentNode, selectionNode, variables, fragments) {
71100
- const sink = {};
71101
- if (selectionNode.directives) {
71102
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
71103
- if (selectionWithDirectives === undefined) {
71104
- return;
71105
- }
71106
- selectionNode = selectionWithDirectives;
71107
- }
71108
- if (selectionNode.kind === "InlineFragment") {
71109
- if (isFragmentApplicable$9(selectionNode, source.data.__typename)) {
71110
- // Get selections out of the inline fragment
71111
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
71112
- // Call into field handling with selections
71113
- Object.assign(sink, buildSelectionForNode$8(source, reader, parentNode, fragmentSelection, variables, fragments));
71114
- });
71115
- }
71116
- }
71117
- if (selectionNode.kind === "FragmentSpread") {
71118
- const namedFragment = fragments[selectionNode.name.value];
71119
- if (namedFragment && isFragmentApplicable$9(namedFragment, source.data.__typename)) {
71120
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
71121
- // Call into field handling with selections
71122
- Object.assign(sink, buildSelectionForNode$8(source, reader, parentNode, fragmentSelection, variables, fragments));
71123
- });
71124
- }
71125
- }
71126
- if (selectionNode.kind === "Field") {
71127
- Object.assign(sink, buildSelectionForField$8(source, reader, selectionNode, variables));
71128
- }
71129
- return sink;
68908
+ function buildSelectionForNode$9(source, reader, parentNode, selectionNode, variables, fragments) {
68909
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$9, buildSelectionForField$9);
71130
68910
  }
71131
68911
  function select$h(field, variables, fragments) {
71132
68912
  return (source, reader) => {
71133
68913
  var _a;
71134
68914
  const sink = {};
71135
68915
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
71136
- const builtSelection = buildSelectionForNode$8(source, reader, field, sel, variables, fragments);
68916
+ const builtSelection = buildSelectionForNode$9(source, reader, field, sel, variables, fragments);
71137
68917
  if (builtSelection !== undefined) {
71138
68918
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
71139
68919
  Object.keys(builtSelection).forEach((key, value) => {
@@ -71305,79 +69085,18 @@
71305
69085
  }
71306
69086
  return sink;
71307
69087
  }
71308
- function buildSelectionForField$7(source, reader, sel, variables, fragments) {
71309
- const sink = {};
71310
- const fieldData = getFieldData$7(source, sel, variables);
71311
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
71312
- reader.enterPath(requestedFieldName);
71313
- if (fieldData === undefined) {
71314
- reader.markMissing();
71315
- reader.exitPath();
71316
- return;
71317
- }
71318
- if (fieldData === null) {
71319
- reader.assignScalar(requestedFieldName, sink, fieldData);
71320
- return sink;
71321
- }
71322
- const fieldType = getFieldType$r(sel);
71323
- if (fieldType === undefined) {
71324
- // This field's type is unknown to us. This breaks normalization.
71325
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
71326
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
71327
- }
71328
- else if (fieldType.isArray) {
71329
- const arraySink = [];
71330
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
71331
- reader.enterPath(i);
71332
- selectType$7(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
71333
- reader.exitPath();
71334
- }
71335
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
71336
- }
71337
- else {
71338
- selectType$7(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
71339
- }
71340
- reader.exitPath();
71341
- return sink;
69088
+ function buildSelectionForField$8(source, reader, sel, variables, fragments) {
69089
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$7, getFieldType$r, selectType$7);
71342
69090
  }
71343
- function buildSelectionForNode$7(source, reader, parentNode, selectionNode, variables, fragments) {
71344
- const sink = {};
71345
- if (selectionNode.directives) {
71346
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
71347
- if (selectionWithDirectives === undefined) {
71348
- return;
71349
- }
71350
- selectionNode = selectionWithDirectives;
71351
- }
71352
- if (selectionNode.kind === "InlineFragment") {
71353
- if (isFragmentApplicable$8(selectionNode, source.data.__typename)) {
71354
- // Get selections out of the inline fragment
71355
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
71356
- // Call into field handling with selections
71357
- Object.assign(sink, buildSelectionForNode$7(source, reader, parentNode, fragmentSelection, variables, fragments));
71358
- });
71359
- }
71360
- }
71361
- if (selectionNode.kind === "FragmentSpread") {
71362
- const namedFragment = fragments[selectionNode.name.value];
71363
- if (namedFragment && isFragmentApplicable$8(namedFragment, source.data.__typename)) {
71364
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
71365
- // Call into field handling with selections
71366
- Object.assign(sink, buildSelectionForNode$7(source, reader, parentNode, fragmentSelection, variables, fragments));
71367
- });
71368
- }
71369
- }
71370
- if (selectionNode.kind === "Field") {
71371
- Object.assign(sink, buildSelectionForField$7(source, reader, selectionNode, variables));
71372
- }
71373
- return sink;
69091
+ function buildSelectionForNode$8(source, reader, parentNode, selectionNode, variables, fragments) {
69092
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$8, buildSelectionForField$8);
71374
69093
  }
71375
69094
  function select$g(field, variables, fragments) {
71376
69095
  return (source, reader) => {
71377
69096
  var _a;
71378
69097
  const sink = {};
71379
69098
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
71380
- const builtSelection = buildSelectionForNode$7(source, reader, field, sel, variables, fragments);
69099
+ const builtSelection = buildSelectionForNode$8(source, reader, field, sel, variables, fragments);
71381
69100
  if (builtSelection !== undefined) {
71382
69101
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
71383
69102
  Object.keys(builtSelection).forEach((key, value) => {
@@ -71642,79 +69361,18 @@
71642
69361
  }
71643
69362
  return sink;
71644
69363
  }
71645
- function buildSelectionForField$6(source, reader, sel, variables, fragments) {
71646
- const sink = {};
71647
- const fieldData = getFieldData$6(source, sel, variables);
71648
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
71649
- reader.enterPath(requestedFieldName);
71650
- if (fieldData === undefined) {
71651
- reader.markMissing();
71652
- reader.exitPath();
71653
- return;
71654
- }
71655
- if (fieldData === null) {
71656
- reader.assignScalar(requestedFieldName, sink, fieldData);
71657
- return sink;
71658
- }
71659
- const fieldType = getFieldType$q(sel);
71660
- if (fieldType === undefined) {
71661
- // This field's type is unknown to us. This breaks normalization.
71662
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
71663
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
71664
- }
71665
- else if (fieldType.isArray) {
71666
- const arraySink = [];
71667
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
71668
- reader.enterPath(i);
71669
- selectType$6(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
71670
- reader.exitPath();
71671
- }
71672
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
71673
- }
71674
- else {
71675
- selectType$6(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
71676
- }
71677
- reader.exitPath();
71678
- return sink;
69364
+ function buildSelectionForField$7(source, reader, sel, variables, fragments) {
69365
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$6, getFieldType$q, selectType$6);
71679
69366
  }
71680
- function buildSelectionForNode$6(source, reader, parentNode, selectionNode, variables, fragments) {
71681
- const sink = {};
71682
- if (selectionNode.directives) {
71683
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
71684
- if (selectionWithDirectives === undefined) {
71685
- return;
71686
- }
71687
- selectionNode = selectionWithDirectives;
71688
- }
71689
- if (selectionNode.kind === "InlineFragment") {
71690
- if (isFragmentApplicable$7(selectionNode, source.data.__typename)) {
71691
- // Get selections out of the inline fragment
71692
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
71693
- // Call into field handling with selections
71694
- Object.assign(sink, buildSelectionForNode$6(source, reader, parentNode, fragmentSelection, variables, fragments));
71695
- });
71696
- }
71697
- }
71698
- if (selectionNode.kind === "FragmentSpread") {
71699
- const namedFragment = fragments[selectionNode.name.value];
71700
- if (namedFragment && isFragmentApplicable$7(namedFragment, source.data.__typename)) {
71701
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
71702
- // Call into field handling with selections
71703
- Object.assign(sink, buildSelectionForNode$6(source, reader, parentNode, fragmentSelection, variables, fragments));
71704
- });
71705
- }
71706
- }
71707
- if (selectionNode.kind === "Field") {
71708
- Object.assign(sink, buildSelectionForField$6(source, reader, selectionNode, variables, fragments));
71709
- }
71710
- return sink;
69367
+ function buildSelectionForNode$7(source, reader, parentNode, selectionNode, variables, fragments) {
69368
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$7, buildSelectionForField$7);
71711
69369
  }
71712
69370
  function select$f(field, variables, fragments) {
71713
69371
  return (source, reader) => {
71714
69372
  var _a;
71715
69373
  const sink = {};
71716
69374
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
71717
- const builtSelection = buildSelectionForNode$6(source, reader, field, sel, variables, fragments);
69375
+ const builtSelection = buildSelectionForNode$7(source, reader, field, sel, variables, fragments);
71718
69376
  if (builtSelection !== undefined) {
71719
69377
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
71720
69378
  Object.keys(builtSelection).forEach((key, value) => {
@@ -72141,79 +69799,18 @@
72141
69799
  }
72142
69800
  return sink;
72143
69801
  }
72144
- function buildSelectionForField$5(source, reader, sel, variables, fragments) {
72145
- const sink = {};
72146
- const fieldData = getFieldData$5(source, sel, variables);
72147
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
72148
- reader.enterPath(requestedFieldName);
72149
- if (fieldData === undefined) {
72150
- reader.markMissing();
72151
- reader.exitPath();
72152
- return;
72153
- }
72154
- if (fieldData === null) {
72155
- reader.assignScalar(requestedFieldName, sink, fieldData);
72156
- return sink;
72157
- }
72158
- const fieldType = getFieldType$p(sel);
72159
- if (fieldType === undefined) {
72160
- // This field's type is unknown to us. This breaks normalization.
72161
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
72162
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
72163
- }
72164
- else if (fieldType.isArray) {
72165
- const arraySink = [];
72166
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
72167
- reader.enterPath(i);
72168
- selectType$5(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
72169
- reader.exitPath();
72170
- }
72171
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
72172
- }
72173
- else {
72174
- selectType$5(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
72175
- }
72176
- reader.exitPath();
72177
- return sink;
69802
+ function buildSelectionForField$6(source, reader, sel, variables, fragments) {
69803
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$5, getFieldType$p, selectType$5);
72178
69804
  }
72179
- function buildSelectionForNode$5(source, reader, parentNode, selectionNode, variables, fragments) {
72180
- const sink = {};
72181
- if (selectionNode.directives) {
72182
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
72183
- if (selectionWithDirectives === undefined) {
72184
- return;
72185
- }
72186
- selectionNode = selectionWithDirectives;
72187
- }
72188
- if (selectionNode.kind === "InlineFragment") {
72189
- if (isFragmentApplicable$6(selectionNode, source.data.__typename)) {
72190
- // Get selections out of the inline fragment
72191
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
72192
- // Call into field handling with selections
72193
- Object.assign(sink, buildSelectionForNode$5(source, reader, parentNode, fragmentSelection, variables, fragments));
72194
- });
72195
- }
72196
- }
72197
- if (selectionNode.kind === "FragmentSpread") {
72198
- const namedFragment = fragments[selectionNode.name.value];
72199
- if (namedFragment && isFragmentApplicable$6(namedFragment, source.data.__typename)) {
72200
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
72201
- // Call into field handling with selections
72202
- Object.assign(sink, buildSelectionForNode$5(source, reader, parentNode, fragmentSelection, variables, fragments));
72203
- });
72204
- }
72205
- }
72206
- if (selectionNode.kind === "Field") {
72207
- Object.assign(sink, buildSelectionForField$5(source, reader, selectionNode, variables));
72208
- }
72209
- return sink;
69805
+ function buildSelectionForNode$6(source, reader, parentNode, selectionNode, variables, fragments) {
69806
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$6, buildSelectionForField$6);
72210
69807
  }
72211
69808
  function select$e(field, variables, fragments) {
72212
69809
  return (source, reader) => {
72213
69810
  var _a;
72214
69811
  const sink = {};
72215
69812
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
72216
- const builtSelection = buildSelectionForNode$5(source, reader, field, sel, variables, fragments);
69813
+ const builtSelection = buildSelectionForNode$6(source, reader, field, sel, variables, fragments);
72217
69814
  if (builtSelection !== undefined) {
72218
69815
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
72219
69816
  Object.keys(builtSelection).forEach((key, value) => {
@@ -72379,79 +69976,18 @@
72379
69976
  }
72380
69977
  return sink;
72381
69978
  }
72382
- function buildSelectionForField$4(source, reader, sel, variables, fragments) {
72383
- const sink = {};
72384
- const fieldData = getFieldData$4(source, sel, variables);
72385
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
72386
- reader.enterPath(requestedFieldName);
72387
- if (fieldData === undefined) {
72388
- reader.markMissing();
72389
- reader.exitPath();
72390
- return;
72391
- }
72392
- if (fieldData === null) {
72393
- reader.assignScalar(requestedFieldName, sink, fieldData);
72394
- return sink;
72395
- }
72396
- const fieldType = getFieldType$o(sel);
72397
- if (fieldType === undefined) {
72398
- // This field's type is unknown to us. This breaks normalization.
72399
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
72400
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
72401
- }
72402
- else if (fieldType.isArray) {
72403
- const arraySink = [];
72404
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
72405
- reader.enterPath(i);
72406
- selectType$4(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
72407
- reader.exitPath();
72408
- }
72409
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
72410
- }
72411
- else {
72412
- selectType$4(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
72413
- }
72414
- reader.exitPath();
72415
- return sink;
69979
+ function buildSelectionForField$5(source, reader, sel, variables, fragments) {
69980
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$4, getFieldType$o, selectType$4);
72416
69981
  }
72417
- function buildSelectionForNode$4(source, reader, parentNode, selectionNode, variables, fragments) {
72418
- const sink = {};
72419
- if (selectionNode.directives) {
72420
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
72421
- if (selectionWithDirectives === undefined) {
72422
- return;
72423
- }
72424
- selectionNode = selectionWithDirectives;
72425
- }
72426
- if (selectionNode.kind === "InlineFragment") {
72427
- if (isFragmentApplicable$5(selectionNode, source.data.__typename)) {
72428
- // Get selections out of the inline fragment
72429
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
72430
- // Call into field handling with selections
72431
- Object.assign(sink, buildSelectionForNode$4(source, reader, parentNode, fragmentSelection, variables, fragments));
72432
- });
72433
- }
72434
- }
72435
- if (selectionNode.kind === "FragmentSpread") {
72436
- const namedFragment = fragments[selectionNode.name.value];
72437
- if (namedFragment && isFragmentApplicable$5(namedFragment, source.data.__typename)) {
72438
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
72439
- // Call into field handling with selections
72440
- Object.assign(sink, buildSelectionForNode$4(source, reader, parentNode, fragmentSelection, variables, fragments));
72441
- });
72442
- }
72443
- }
72444
- if (selectionNode.kind === "Field") {
72445
- Object.assign(sink, buildSelectionForField$4(source, reader, selectionNode, variables));
72446
- }
72447
- return sink;
69982
+ function buildSelectionForNode$5(source, reader, parentNode, selectionNode, variables, fragments) {
69983
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$5, buildSelectionForField$5);
72448
69984
  }
72449
69985
  function select$d(field, variables, fragments) {
72450
69986
  return (source, reader) => {
72451
69987
  var _a;
72452
69988
  const sink = {};
72453
69989
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
72454
- const builtSelection = buildSelectionForNode$4(source, reader, field, sel, variables, fragments);
69990
+ const builtSelection = buildSelectionForNode$5(source, reader, field, sel, variables, fragments);
72455
69991
  if (builtSelection !== undefined) {
72456
69992
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
72457
69993
  Object.keys(builtSelection).forEach((key, value) => {
@@ -72646,79 +70182,18 @@
72646
70182
  }
72647
70183
  return sink;
72648
70184
  }
72649
- function buildSelectionForField$3(source, reader, sel, variables, fragments) {
72650
- const sink = {};
72651
- const fieldData = getFieldData$3(source, sel, variables);
72652
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
72653
- reader.enterPath(requestedFieldName);
72654
- if (fieldData === undefined) {
72655
- reader.markMissing();
72656
- reader.exitPath();
72657
- return;
72658
- }
72659
- if (fieldData === null) {
72660
- reader.assignScalar(requestedFieldName, sink, fieldData);
72661
- return sink;
72662
- }
72663
- const fieldType = getFieldType$n(sel);
72664
- if (fieldType === undefined) {
72665
- // This field's type is unknown to us. This breaks normalization.
72666
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
72667
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
72668
- }
72669
- else if (fieldType.isArray) {
72670
- const arraySink = [];
72671
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
72672
- reader.enterPath(i);
72673
- selectType$3(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
72674
- reader.exitPath();
72675
- }
72676
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
72677
- }
72678
- else {
72679
- selectType$3(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
72680
- }
72681
- reader.exitPath();
72682
- return sink;
70185
+ function buildSelectionForField$4(source, reader, sel, variables, fragments) {
70186
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$3, getFieldType$n, selectType$3);
72683
70187
  }
72684
- function buildSelectionForNode$3(source, reader, parentNode, selectionNode, variables, fragments) {
72685
- const sink = {};
72686
- if (selectionNode.directives) {
72687
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
72688
- if (selectionWithDirectives === undefined) {
72689
- return;
72690
- }
72691
- selectionNode = selectionWithDirectives;
72692
- }
72693
- if (selectionNode.kind === "InlineFragment") {
72694
- if (isFragmentApplicable$4(selectionNode, source.data.__typename)) {
72695
- // Get selections out of the inline fragment
72696
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
72697
- // Call into field handling with selections
72698
- Object.assign(sink, buildSelectionForNode$3(source, reader, parentNode, fragmentSelection, variables, fragments));
72699
- });
72700
- }
72701
- }
72702
- if (selectionNode.kind === "FragmentSpread") {
72703
- const namedFragment = fragments[selectionNode.name.value];
72704
- if (namedFragment && isFragmentApplicable$4(namedFragment, source.data.__typename)) {
72705
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
72706
- // Call into field handling with selections
72707
- Object.assign(sink, buildSelectionForNode$3(source, reader, parentNode, fragmentSelection, variables, fragments));
72708
- });
72709
- }
72710
- }
72711
- if (selectionNode.kind === "Field") {
72712
- Object.assign(sink, buildSelectionForField$3(source, reader, selectionNode, variables, fragments));
72713
- }
72714
- return sink;
70188
+ function buildSelectionForNode$4(source, reader, parentNode, selectionNode, variables, fragments) {
70189
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$4, buildSelectionForField$4);
72715
70190
  }
72716
70191
  function select$c(field, variables, fragments) {
72717
70192
  return (source, reader) => {
72718
70193
  var _a;
72719
70194
  const sink = {};
72720
70195
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
72721
- const builtSelection = buildSelectionForNode$3(source, reader, field, sel, variables, fragments);
70196
+ const builtSelection = buildSelectionForNode$4(source, reader, field, sel, variables, fragments);
72722
70197
  if (builtSelection !== undefined) {
72723
70198
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
72724
70199
  Object.keys(builtSelection).forEach((key, value) => {
@@ -73035,79 +70510,18 @@
73035
70510
  }
73036
70511
  return sink;
73037
70512
  }
73038
- function buildSelectionForField$2(source, reader, sel, variables, fragments) {
73039
- const sink = {};
73040
- const fieldData = getFieldData$2(source, sel, variables);
73041
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
73042
- reader.enterPath(requestedFieldName);
73043
- if (fieldData === undefined) {
73044
- reader.markMissing();
73045
- reader.exitPath();
73046
- return;
73047
- }
73048
- if (fieldData === null) {
73049
- reader.assignScalar(requestedFieldName, sink, fieldData);
73050
- return sink;
73051
- }
73052
- const fieldType = getFieldType$m(sel);
73053
- if (fieldType === undefined) {
73054
- // This field's type is unknown to us. This breaks normalization.
73055
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
73056
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
73057
- }
73058
- else if (fieldType.isArray) {
73059
- const arraySink = [];
73060
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
73061
- reader.enterPath(i);
73062
- selectType$2(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
73063
- reader.exitPath();
73064
- }
73065
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
73066
- }
73067
- else {
73068
- selectType$2(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
73069
- }
73070
- reader.exitPath();
73071
- return sink;
70513
+ function buildSelectionForField$3(source, reader, sel, variables, fragments) {
70514
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$2, getFieldType$m, selectType$2);
73072
70515
  }
73073
- function buildSelectionForNode$2(source, reader, parentNode, selectionNode, variables, fragments) {
73074
- const sink = {};
73075
- if (selectionNode.directives) {
73076
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
73077
- if (selectionWithDirectives === undefined) {
73078
- return;
73079
- }
73080
- selectionNode = selectionWithDirectives;
73081
- }
73082
- if (selectionNode.kind === "InlineFragment") {
73083
- if (isFragmentApplicable$3(selectionNode, source.data.__typename)) {
73084
- // Get selections out of the inline fragment
73085
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
73086
- // Call into field handling with selections
73087
- Object.assign(sink, buildSelectionForNode$2(source, reader, parentNode, fragmentSelection, variables, fragments));
73088
- });
73089
- }
73090
- }
73091
- if (selectionNode.kind === "FragmentSpread") {
73092
- const namedFragment = fragments[selectionNode.name.value];
73093
- if (namedFragment && isFragmentApplicable$3(namedFragment, source.data.__typename)) {
73094
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
73095
- // Call into field handling with selections
73096
- Object.assign(sink, buildSelectionForNode$2(source, reader, parentNode, fragmentSelection, variables, fragments));
73097
- });
73098
- }
73099
- }
73100
- if (selectionNode.kind === "Field") {
73101
- Object.assign(sink, buildSelectionForField$2(source, reader, selectionNode, variables, fragments));
73102
- }
73103
- return sink;
70516
+ function buildSelectionForNode$3(source, reader, parentNode, selectionNode, variables, fragments) {
70517
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$3, buildSelectionForField$3);
73104
70518
  }
73105
70519
  function select$b(field, variables, fragments) {
73106
70520
  return (source, reader) => {
73107
70521
  var _a;
73108
70522
  const sink = {};
73109
70523
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
73110
- const builtSelection = buildSelectionForNode$2(source, reader, field, sel, variables, fragments);
70524
+ const builtSelection = buildSelectionForNode$3(source, reader, field, sel, variables, fragments);
73111
70525
  if (builtSelection !== undefined) {
73112
70526
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
73113
70527
  Object.keys(builtSelection).forEach((key, value) => {
@@ -73364,79 +70778,18 @@
73364
70778
  }
73365
70779
  return sink;
73366
70780
  }
73367
- function buildSelectionForField$1(source, reader, sel, variables, fragments) {
73368
- const sink = {};
73369
- const fieldData = getFieldData$1(source, sel, variables);
73370
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
73371
- reader.enterPath(requestedFieldName);
73372
- if (fieldData === undefined) {
73373
- reader.markMissing();
73374
- reader.exitPath();
73375
- return;
73376
- }
73377
- if (fieldData === null) {
73378
- reader.assignScalar(requestedFieldName, sink, fieldData);
73379
- return sink;
73380
- }
73381
- const fieldType = getFieldType$l(sel);
73382
- if (fieldType === undefined) {
73383
- // This field's type is unknown to us. This breaks normalization.
73384
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
73385
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
73386
- }
73387
- else if (fieldType.isArray) {
73388
- const arraySink = [];
73389
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
73390
- reader.enterPath(i);
73391
- selectType$1(fieldType.typename, sel, fieldData[i], reader, i, arraySink);
73392
- reader.exitPath();
73393
- }
73394
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
73395
- }
73396
- else {
73397
- selectType$1(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink);
73398
- }
73399
- reader.exitPath();
73400
- return sink;
70781
+ function buildSelectionForField$2(source, reader, sel, variables, fragments) {
70782
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData$1, getFieldType$l, selectType$1);
73401
70783
  }
73402
- function buildSelectionForNode$1(source, reader, parentNode, selectionNode, variables, fragments) {
73403
- const sink = {};
73404
- if (selectionNode.directives) {
73405
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
73406
- if (selectionWithDirectives === undefined) {
73407
- return;
73408
- }
73409
- selectionNode = selectionWithDirectives;
73410
- }
73411
- if (selectionNode.kind === "InlineFragment") {
73412
- if (isFragmentApplicable$2(selectionNode, source.data.__typename)) {
73413
- // Get selections out of the inline fragment
73414
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
73415
- // Call into field handling with selections
73416
- Object.assign(sink, buildSelectionForNode$1(source, reader, parentNode, fragmentSelection, variables, fragments));
73417
- });
73418
- }
73419
- }
73420
- if (selectionNode.kind === "FragmentSpread") {
73421
- const namedFragment = fragments[selectionNode.name.value];
73422
- if (namedFragment && isFragmentApplicable$2(namedFragment, source.data.__typename)) {
73423
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
73424
- // Call into field handling with selections
73425
- Object.assign(sink, buildSelectionForNode$1(source, reader, parentNode, fragmentSelection, variables, fragments));
73426
- });
73427
- }
73428
- }
73429
- if (selectionNode.kind === "Field") {
73430
- Object.assign(sink, buildSelectionForField$1(source, reader, selectionNode, variables));
73431
- }
73432
- return sink;
70784
+ function buildSelectionForNode$2(source, reader, parentNode, selectionNode, variables, fragments) {
70785
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$2, buildSelectionForField$2);
73433
70786
  }
73434
70787
  function select$a(field, variables, fragments) {
73435
70788
  return (source, reader) => {
73436
70789
  var _a;
73437
70790
  const sink = {};
73438
70791
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
73439
- const builtSelection = buildSelectionForNode$1(source, reader, field, sel, variables, fragments);
70792
+ const builtSelection = buildSelectionForNode$2(source, reader, field, sel, variables, fragments);
73440
70793
  if (builtSelection !== undefined) {
73441
70794
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
73442
70795
  Object.keys(builtSelection).forEach((key, value) => {
@@ -73646,79 +70999,18 @@
73646
70999
  }
73647
71000
  return sink;
73648
71001
  }
73649
- function buildSelectionForField(source, reader, sel, variables, fragments) {
73650
- const sink = {};
73651
- const fieldData = getFieldData(source, sel, variables);
73652
- const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
73653
- reader.enterPath(requestedFieldName);
73654
- if (fieldData === undefined) {
73655
- reader.markMissing();
73656
- reader.exitPath();
73657
- return;
73658
- }
73659
- if (fieldData === null) {
73660
- reader.assignScalar(requestedFieldName, sink, fieldData);
73661
- return sink;
73662
- }
73663
- const fieldType = getFieldType$k(sel);
73664
- if (fieldType === undefined) {
73665
- // This field's type is unknown to us. This breaks normalization.
73666
- console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
73667
- reader.assignNonScalar(sink, requestedFieldName, fieldData);
73668
- }
73669
- else if (fieldType.isArray) {
73670
- const arraySink = [];
73671
- for (let i = 0, len = fieldData.length; i < len; i += 1) {
73672
- reader.enterPath(i);
73673
- selectType(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
73674
- reader.exitPath();
73675
- }
73676
- reader.assignNonScalar(sink, requestedFieldName, arraySink);
73677
- }
73678
- else {
73679
- selectType(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
73680
- }
73681
- reader.exitPath();
73682
- return sink;
71002
+ function buildSelectionForField$1(source, reader, sel, variables, fragments) {
71003
+ return buildSelectionForField(source, reader, sel, variables, fragments, false, getFieldData, getFieldType$k, selectType);
73683
71004
  }
73684
- function buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments) {
73685
- const sink = {};
73686
- if (selectionNode.directives) {
73687
- const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
73688
- if (selectionWithDirectives === undefined) {
73689
- return;
73690
- }
73691
- selectionNode = selectionWithDirectives;
73692
- }
73693
- if (selectionNode.kind === "InlineFragment") {
73694
- if (isFragmentApplicable$1(selectionNode, source.data.__typename)) {
73695
- // Get selections out of the inline fragment
73696
- selectionNode.selectionSet.selections.forEach(fragmentSelection => {
73697
- // Call into field handling with selections
73698
- Object.assign(sink, buildSelectionForNode(source, reader, parentNode, fragmentSelection, variables, fragments));
73699
- });
73700
- }
73701
- }
73702
- if (selectionNode.kind === "FragmentSpread") {
73703
- const namedFragment = fragments[selectionNode.name.value];
73704
- if (namedFragment && isFragmentApplicable$1(namedFragment, source.data.__typename)) {
73705
- namedFragment.selectionSet.selections.forEach(fragmentSelection => {
73706
- // Call into field handling with selections
73707
- Object.assign(sink, buildSelectionForNode(source, reader, parentNode, fragmentSelection, variables, fragments));
73708
- });
73709
- }
73710
- }
73711
- if (selectionNode.kind === "Field") {
73712
- Object.assign(sink, buildSelectionForField(source, reader, selectionNode, variables, fragments));
73713
- }
73714
- return sink;
71005
+ function buildSelectionForNode$1(source, reader, parentNode, selectionNode, variables, fragments) {
71006
+ return buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable$1, buildSelectionForField$1);
73715
71007
  }
73716
71008
  function select$9(field, variables, fragments) {
73717
71009
  return (source, reader) => {
73718
71010
  var _a;
73719
71011
  const sink = {};
73720
71012
  (_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
73721
- const builtSelection = buildSelectionForNode(source, reader, field, sel, variables, fragments);
71013
+ const builtSelection = buildSelectionForNode$1(source, reader, field, sel, variables, fragments);
73722
71014
  if (builtSelection !== undefined) {
73723
71015
  if (sel.kind === "InlineFragment" || sel.kind === "FragmentSpread") {
73724
71016
  Object.keys(builtSelection).forEach((key, value) => {
@@ -75491,6 +72783,93 @@
75491
72783
  return sharedGetFragmentType(fragment, fragmentMap);
75492
72784
  }
75493
72785
 
72786
+ function applyToSelection$6(selection, directive, variables) {
72787
+ return selection;
72788
+ }
72789
+
72790
+ function applyToSelection$5(selection, directive, variables) {
72791
+ return selection;
72792
+ }
72793
+
72794
+ function applyToSelection$4(selection, directive, variables) {
72795
+ return selection;
72796
+ }
72797
+
72798
+ function applyToSelection$3(selection, directive, variables) {
72799
+ var _a;
72800
+ const ifArg = (_a = directive.arguments) === null || _a === void 0 ? void 0 : _a.find(argument => argument.name.value === "if");
72801
+ if (ifArg && ifArg.value) {
72802
+ if (ifArg.value.kind === "BooleanValue") {
72803
+ return ifArg.value.value ? selection : undefined;
72804
+ }
72805
+ if (ifArg.value.kind === "Variable") {
72806
+ return variables[ifArg.value.name.value] ? selection : undefined;
72807
+ }
72808
+ }
72809
+ return selection;
72810
+ }
72811
+
72812
+ function applyToSelection$2(selection, directive, variables) {
72813
+ var _a;
72814
+ const ifArg = (_a = directive.arguments) === null || _a === void 0 ? void 0 : _a.find(argument => argument.name.value === "if");
72815
+ if (ifArg && ifArg.value) {
72816
+ if (ifArg.value.kind === "BooleanValue") {
72817
+ return ifArg.value.value ? undefined : selection;
72818
+ }
72819
+ if (ifArg.value.kind === "Variable") {
72820
+ return variables[ifArg.value.name.value] ? undefined : selection;
72821
+ }
72822
+ }
72823
+ return selection;
72824
+ }
72825
+
72826
+ function applyToSelection$1(selection, directive, variables) {
72827
+ return selection;
72828
+ }
72829
+
72830
+ function applyToSelection(selection, directive, variables) {
72831
+ return selection;
72832
+ }
72833
+
72834
+ function applyDirectivesForSelection(selection, variables) {
72835
+ let result = selection;
72836
+ if (selection && selection.directives) {
72837
+ // iterate through directives in order. Directives _can_ be stacked.
72838
+ for (var i = 0; i < selection.directives.length; i++) {
72839
+ const directive = selection.directives[i];
72840
+ switch (directive.name.value) {
72841
+ // Generate Case for each directive in the schema that supports SelectionNodes
72842
+ case ("generic"):
72843
+ result = applyToSelection$6(selection);
72844
+ break;
72845
+ case ("fieldCategory"):
72846
+ result = applyToSelection$5(selection);
72847
+ break;
72848
+ case ("category"):
72849
+ result = applyToSelection$4(selection);
72850
+ break;
72851
+ case ("include"):
72852
+ result = applyToSelection$3(selection, directive, variables);
72853
+ break;
72854
+ case ("skip"):
72855
+ result = applyToSelection$2(selection, directive, variables);
72856
+ break;
72857
+ case ("deprecated"):
72858
+ result = applyToSelection$1(selection);
72859
+ break;
72860
+ case ("specifiedBy"):
72861
+ result = applyToSelection(selection);
72862
+ break;
72863
+ }
72864
+ if (result === undefined) {
72865
+ // Selection was removed.
72866
+ break;
72867
+ }
72868
+ }
72869
+ }
72870
+ return result;
72871
+ }
72872
+
75494
72873
  function createLink(ref) {
75495
72874
  return {
75496
72875
  __ref: serializeStructuredKey(ref),
@@ -76251,6 +73630,76 @@
76251
73630
  const doesImplementInterface = !isUntypedInlineFragment && implementedInterfaces.includes(fragmentNode.typeCondition.name.value);
76252
73631
  const typenameMatchesCondition = typename !== undefined && !isUntypedInlineFragment && typename === fragmentNode.typeCondition.name.value;
76253
73632
  return isUntypedInlineFragment || matchesTypeCondition || doesImplementInterface || typenameMatchesCondition;
73633
+ }
73634
+ function buildSelectionForNode(source, reader, parentNode, selectionNode, variables, fragments, isFragmentApplicable, buildSelectionForField) {
73635
+ const sink = {};
73636
+ if (selectionNode.directives) {
73637
+ const selectionWithDirectives = applyDirectivesForSelection(selectionNode, variables);
73638
+ if (selectionWithDirectives === undefined) {
73639
+ return;
73640
+ }
73641
+ selectionNode = selectionWithDirectives;
73642
+ }
73643
+ if (selectionNode.kind === "InlineFragment") {
73644
+ if (isFragmentApplicable(selectionNode, source.data.__typename)) {
73645
+ // Get selections out of the inline fragment
73646
+ selectionNode.selectionSet.selections.forEach(fragmentSelection => {
73647
+ // Call into field handling with selections
73648
+ Object.assign(sink, buildSelectionForNode(source, reader, parentNode, fragmentSelection, variables, fragments, isFragmentApplicable, buildSelectionForField));
73649
+ });
73650
+ }
73651
+ }
73652
+ if (selectionNode.kind === "FragmentSpread") {
73653
+ const namedFragment = fragments[selectionNode.name.value];
73654
+ if (namedFragment && isFragmentApplicable(namedFragment, source.data.__typename)) {
73655
+ namedFragment.selectionSet.selections.forEach(fragmentSelection => {
73656
+ // Call into field handling with selections
73657
+ Object.assign(sink, buildSelectionForNode(source, reader, parentNode, fragmentSelection, variables, fragments, isFragmentApplicable, buildSelectionForField));
73658
+ });
73659
+ }
73660
+ }
73661
+ if (selectionNode.kind === "Field") {
73662
+ Object.assign(sink, buildSelectionForField(source, reader, selectionNode, variables, fragments));
73663
+ }
73664
+ return sink;
73665
+ }
73666
+ function buildSelectionForField(source, reader, sel, variables, fragments, isCursorConnectionType, getFieldData, getFieldType, selectType) {
73667
+ const sink = {};
73668
+ const fieldData = getFieldData(source, sel, variables);
73669
+ const requestedFieldName = sel.alias ? sel.alias.value : sel.name.value;
73670
+ if (isCursorConnectionType && requestedFieldName === 'pageInfo') {
73671
+ return;
73672
+ }
73673
+ reader.enterPath(requestedFieldName);
73674
+ if (fieldData === undefined) {
73675
+ reader.markMissing();
73676
+ reader.exitPath();
73677
+ return;
73678
+ }
73679
+ if (fieldData === null) {
73680
+ reader.assignScalar(requestedFieldName, sink, fieldData);
73681
+ return sink;
73682
+ }
73683
+ const fieldType = getFieldType(sel);
73684
+ if (fieldType === undefined) {
73685
+ // This field's type is unknown to us. This breaks normalization.
73686
+ console.warn(`Unknown Field: ${requestedFieldName}. This field or nested fields cannot participate in normalization`);
73687
+ reader.assignNonScalar(sink, requestedFieldName, fieldData);
73688
+ }
73689
+ else if (fieldType.isArray) {
73690
+ const arraySink = [];
73691
+ for (let i = 0, len = fieldData.length; i < len; i += 1) {
73692
+ reader.enterPath(i);
73693
+ selectType(fieldType.typename, sel, fieldData[i], reader, i, arraySink, variables, fragments);
73694
+ reader.exitPath();
73695
+ }
73696
+ reader.assignNonScalar(sink, requestedFieldName, arraySink);
73697
+ }
73698
+ else {
73699
+ selectType(fieldType.typename, sel, fieldData, reader, requestedFieldName, sink, variables, fragments);
73700
+ }
73701
+ reader.exitPath();
73702
+ return sink;
76254
73703
  }
76255
73704
 
76256
73705
  const TTL = 900000;
@@ -77571,7 +75020,7 @@
77571
75020
  configuration: { ...configurationForGraphQLAdapters },
77572
75021
  instrument,
77573
75022
  });
77574
- // version: 1.114.4-efecf667d
75023
+ // version: 1.114.6-f2429e60e
77575
75024
 
77576
75025
  // On core the unstable adapters are re-exported with different names,
77577
75026
 
@@ -79700,7 +77149,7 @@
79700
77149
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
79701
77150
  graphQLImperative = ldsAdapter;
79702
77151
  });
79703
- // version: 1.114.4-efecf667d
77152
+ // version: 1.114.6-f2429e60e
79704
77153
 
79705
77154
  var gqlApi = /*#__PURE__*/Object.freeze({
79706
77155
  __proto__: null,
@@ -80115,7 +77564,9 @@
80115
77564
  return item.id;
80116
77565
  });
80117
77566
  invokeDmlAdapter(adapter, parse$1(config), (responseValue) => {
80118
- if (responseValue.error === undefined && responseValue.data === undefined) {
77567
+ if (responseValue.error === undefined &&
77568
+ responseValue.errors === undefined &&
77569
+ responseValue.data === undefined) {
80119
77570
  draftManager.getQueue().then((newState) => {
80120
77571
  const draftIdsToFilter = priorDraftIds ? priorDraftIds : [];
80121
77572
  const newDrafts = newState.items;
@@ -80125,9 +77576,9 @@
80125
77576
  return isNew && targetIdMatches;
80126
77577
  });
80127
77578
  if (addedDrafts.length !== 1) {
80128
- let response = responseValue;
80129
- response.error =
80130
- createNativeFetchErrorResponse(NO_DRAFT_CREATED_MESSAGE);
77579
+ let response = {
77580
+ error: createNativeFetchErrorResponse(NO_DRAFT_CREATED_MESSAGE),
77581
+ };
80131
77582
  onResponse(response);
80132
77583
  }
80133
77584
  else {
@@ -80159,7 +77610,9 @@
80159
77610
  return item.id;
80160
77611
  });
80161
77612
  invokeDmlAdapter(adapter, parse$1(config), (responseValue) => {
80162
- if (responseValue.error === undefined && responseValue.data === undefined) {
77613
+ if (responseValue.error === undefined &&
77614
+ responseValue.errors === undefined &&
77615
+ responseValue.data === undefined) {
80163
77616
  draftManager.getQueue().then((newState) => {
80164
77617
  const draftIdsToFilter = priorDraftIds ? priorDraftIds : [];
80165
77618
  const newDrafts = newState.items;
@@ -80169,9 +77622,9 @@
80169
77622
  return isNew && targetIdMatches;
80170
77623
  });
80171
77624
  if (addedDrafts.length !== 1) {
80172
- let response = responseValue;
80173
- response.error =
80174
- createNativeFetchErrorResponse(NO_DRAFT_CREATED_MESSAGE);
77625
+ let response = {
77626
+ error: createNativeFetchErrorResponse(NO_DRAFT_CREATED_MESSAGE),
77627
+ };
80175
77628
  onResponse(response);
80176
77629
  }
80177
77630
  else {
@@ -80395,4 +77848,4 @@
80395
77848
  Object.defineProperty(exports, '__esModule', { value: true });
80396
77849
 
80397
77850
  }));
80398
- // version: 1.114.4-844684b4c
77851
+ // version: 1.114.6-435b32f3e