@graphitation/supermassive 3.3.0 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/.eslintcache +1 -1
  2. package/CHANGELOG.md +18 -2
  3. package/lib/collectFields.d.ts +8 -21
  4. package/lib/collectFields.d.ts.map +1 -1
  5. package/lib/collectFields.js +95 -97
  6. package/lib/collectFields.js.map +2 -2
  7. package/lib/collectFields.mjs +95 -97
  8. package/lib/collectFields.mjs.map +2 -2
  9. package/lib/executeWithoutSchema.d.ts +50 -6
  10. package/lib/executeWithoutSchema.d.ts.map +1 -1
  11. package/lib/executeWithoutSchema.js +517 -622
  12. package/lib/executeWithoutSchema.js.map +3 -3
  13. package/lib/executeWithoutSchema.mjs +518 -633
  14. package/lib/executeWithoutSchema.mjs.map +3 -3
  15. package/lib/index.d.ts +1 -1
  16. package/lib/index.d.ts.map +1 -1
  17. package/lib/index.js.map +1 -1
  18. package/lib/index.mjs.map +1 -1
  19. package/lib/types.d.ts +27 -63
  20. package/lib/types.d.ts.map +1 -1
  21. package/lib/types.js.map +1 -1
  22. package/lib/utilities/decodeASTSchema.js +3 -0
  23. package/lib/utilities/decodeASTSchema.js.map +2 -2
  24. package/lib/utilities/decodeASTSchema.mjs +3 -0
  25. package/lib/utilities/decodeASTSchema.mjs.map +2 -2
  26. package/lib/values.d.ts +4 -5
  27. package/lib/values.d.ts.map +1 -1
  28. package/lib/values.js +8 -13
  29. package/lib/values.js.map +2 -2
  30. package/lib/values.mjs +8 -13
  31. package/lib/values.mjs.map +2 -2
  32. package/package.json +1 -1
  33. package/lib/IncrementalPublisher.d.ts +0 -131
  34. package/lib/IncrementalPublisher.d.ts.map +0 -1
  35. package/lib/IncrementalPublisher.js +0 -519
  36. package/lib/IncrementalPublisher.js.map +0 -7
  37. package/lib/IncrementalPublisher.mjs +0 -503
  38. package/lib/IncrementalPublisher.mjs.map +0 -7
  39. package/lib/buildFieldPlan.d.ts +0 -18
  40. package/lib/buildFieldPlan.d.ts.map +0 -1
  41. package/lib/buildFieldPlan.js +0 -120
  42. package/lib/buildFieldPlan.js.map +0 -7
  43. package/lib/buildFieldPlan.mjs +0 -101
  44. package/lib/buildFieldPlan.mjs.map +0 -7
  45. package/lib/jsutils/getBySet.d.ts +0 -2
  46. package/lib/jsutils/getBySet.d.ts.map +0 -1
  47. package/lib/jsutils/getBySet.js +0 -32
  48. package/lib/jsutils/getBySet.js.map +0 -7
  49. package/lib/jsutils/getBySet.mjs +0 -13
  50. package/lib/jsutils/getBySet.mjs.map +0 -7
  51. package/lib/jsutils/isSameSet.d.ts +0 -2
  52. package/lib/jsutils/isSameSet.d.ts.map +0 -1
  53. package/lib/jsutils/isSameSet.js +0 -34
  54. package/lib/jsutils/isSameSet.js.map +0 -7
  55. package/lib/jsutils/isSameSet.mjs +0 -15
  56. package/lib/jsutils/isSameSet.mjs.map +0 -7
  57. package/lib/jsutils/promiseWithResolvers.d.ts +0 -11
  58. package/lib/jsutils/promiseWithResolvers.d.ts.map +0 -1
  59. package/lib/jsutils/promiseWithResolvers.js +0 -32
  60. package/lib/jsutils/promiseWithResolvers.js.map +0 -7
  61. package/lib/jsutils/promiseWithResolvers.mjs +0 -13
  62. package/lib/jsutils/promiseWithResolvers.mjs.map +0 -7
package/CHANGELOG.md CHANGED
@@ -1,12 +1,28 @@
1
1
  # Change Log - @graphitation/supermassive
2
2
 
3
- This log was last generated on Tue, 09 Jan 2024 09:29:37 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 15 Jan 2024 17:31:14 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 3.4.1
8
+
9
+ Mon, 15 Jan 2024 17:31:14 GMT
10
+
11
+ ### Patches
12
+
13
+ - Properly decode boolean in schema (mark@thedutchies.com)
14
+
15
+ ## 3.4.0
16
+
17
+ Wed, 10 Jan 2024 12:26:58 GMT
18
+
19
+ ### Minor changes
20
+
21
+ - Revert new executor and fix errors again (mnovikov@microsoft.com)
22
+
7
23
  ## 3.3.0
8
24
 
9
- Tue, 09 Jan 2024 09:29:37 GMT
25
+ Tue, 09 Jan 2024 09:30:02 GMT
10
26
 
11
27
  ### Minor changes
12
28
 
@@ -1,26 +1,15 @@
1
- import { FieldNode, FragmentDefinitionNode, OperationDefinitionNode } from "graphql";
1
+ import { FieldNode } from "graphql";
2
2
  import { ExecutionContext } from "./executeWithoutSchema";
3
- import { SchemaFragment } from "./types";
4
- import { ObjMap } from "./jsutils/ObjMap";
5
- import { FieldGroup } from "./buildFieldPlan";
6
- export interface DeferUsage {
7
- label: string | undefined;
8
- parentDeferUsage: DeferUsage | undefined;
9
- }
10
- export interface StreamUsage {
11
- label: string | undefined;
12
- initialCount: number;
13
- fieldGroup: FieldGroup;
14
- }
15
- export interface FieldDetails {
16
- node: FieldNode;
17
- deferUsage: DeferUsage | undefined;
18
- }
3
+ export type FieldGroup = ReadonlyArray<FieldNode>;
19
4
  export type GroupedFieldSet = Map<string, FieldGroup>;
20
5
  export interface PatchFields {
21
6
  label: string | undefined;
22
7
  groupedFieldSet: GroupedFieldSet;
23
8
  }
9
+ export interface FieldsAndPatches {
10
+ groupedFieldSet: GroupedFieldSet;
11
+ patches: Array<PatchFields>;
12
+ }
24
13
  /**
25
14
  * Given a selectionSet, collects all of the fields and returns them.
26
15
  *
@@ -30,7 +19,7 @@ export interface PatchFields {
30
19
  *
31
20
  * @internal
32
21
  */
33
- export declare function collectFields(exeContext: ExecutionContext, runtimeTypeName: string): Map<string, ReadonlyArray<FieldDetails>>;
22
+ export declare function collectFields(exeContext: ExecutionContext, runtimeTypeName: string): FieldsAndPatches;
34
23
  /**
35
24
  * Given an array of field nodes, collects all of the subfields of the passed
36
25
  * in fields, and returns them at the end.
@@ -41,7 +30,5 @@ export declare function collectFields(exeContext: ExecutionContext, runtimeTypeN
41
30
  *
42
31
  * @internal
43
32
  */
44
- export declare function collectSubfields(schemaFragment: SchemaFragment, fragments: ObjMap<FragmentDefinitionNode>, variableValues: {
45
- [variable: string]: unknown;
46
- }, operation: OperationDefinitionNode, returnTypeName: string, fieldDetails: ReadonlyArray<FieldDetails>): Map<string, ReadonlyArray<FieldDetails>>;
33
+ export declare function collectSubfields(exeContext: ExecutionContext, returnTypeName: string, fieldGroup: FieldGroup): FieldsAndPatches;
47
34
  //# sourceMappingURL=collectFields.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"collectFields.d.ts","sourceRoot":"","sources":["../src/collectFields.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,sBAAsB,EAKtB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAUjB,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,gBAAgB,EAAE,UAAU,GAAG,SAAS,CAAC;CAC1C;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,UAAU,GAAG,SAAS,CAAC;CACpC;AAED,MAAM,MAAM,eAAe,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAEtD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,eAAe,EAAE,eAAe,CAAC;CAClC;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,gBAAgB,EAC5B,eAAe,EAAE,MAAM,GAC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ap = require("./jsutils/AccumulatorMap");
39
39
  var import_invariant = __toESM(require("invariant"));
40
40
  var import_definition = require("./schema/definition");
41
41
  function collectFields(exeContext, runtimeTypeName) {
42
+ const { operation } = exeContext;
42
43
  const groupedFieldSet = new import_AccumulatorMap.AccumulatorMap();
43
- const context = {
44
- schemaFragment: exeContext.schemaFragment,
45
- fragments: exeContext.fragments,
46
- variableValues: exeContext.variableValues,
47
- runtimeTypeName,
48
- operation: exeContext.operation,
49
- visitedFragmentNames: /* @__PURE__ */ new Set()
50
- };
44
+ const patches = [];
51
45
  collectFieldsImpl(
52
- context,
53
- exeContext.operation.selectionSet,
54
- groupedFieldSet
46
+ exeContext,
47
+ runtimeTypeName,
48
+ operation.selectionSet,
49
+ groupedFieldSet,
50
+ patches,
51
+ /* @__PURE__ */ new Set()
55
52
  );
56
- return groupedFieldSet;
53
+ return { groupedFieldSet, patches };
57
54
  }
58
- function collectSubfields(schemaFragment, fragments, variableValues, operation, returnTypeName, fieldDetails) {
59
- const context = {
60
- schemaFragment,
61
- fragments,
62
- variableValues,
63
- runtimeTypeName: returnTypeName,
64
- operation,
65
- visitedFragmentNames: /* @__PURE__ */ new Set()
66
- };
55
+ function collectSubfields(exeContext, returnTypeName, fieldGroup) {
67
56
  const subGroupedFieldSet = new import_AccumulatorMap.AccumulatorMap();
68
- for (const fieldDetail of fieldDetails) {
69
- const node = fieldDetail.node;
57
+ const visitedFragmentNames = /* @__PURE__ */ new Set();
58
+ const subPatches = [];
59
+ const subFieldsAndPatches = {
60
+ groupedFieldSet: subGroupedFieldSet,
61
+ patches: subPatches
62
+ };
63
+ for (const node of fieldGroup) {
70
64
  if (node.selectionSet) {
71
65
  collectFieldsImpl(
72
- context,
66
+ exeContext,
67
+ returnTypeName,
73
68
  node.selectionSet,
74
69
  subGroupedFieldSet,
75
- fieldDetail.deferUsage
70
+ subPatches,
71
+ visitedFragmentNames
76
72
  );
77
73
  }
78
74
  }
79
- return subGroupedFieldSet;
75
+ return subFieldsAndPatches;
80
76
  }
81
- function collectFieldsImpl(context, selectionSet, groupedFieldSet, parentDeferUsage, deferUsage) {
82
- const {
83
- schemaFragment,
84
- fragments,
85
- variableValues,
86
- runtimeTypeName,
87
- operation,
88
- visitedFragmentNames
89
- } = context;
77
+ function collectFieldsImpl(exeContext, runtimeTypeName, selectionSet, groupedFieldSet, patches, visitedFragmentNames) {
90
78
  for (const selection of selectionSet.selections) {
91
79
  switch (selection.kind) {
92
80
  case import_graphql.Kind.FIELD: {
93
- if (!shouldIncludeNode(schemaFragment, variableValues, selection)) {
81
+ if (!shouldIncludeNode(exeContext, selection)) {
94
82
  continue;
95
83
  }
96
- groupedFieldSet.add(getFieldEntryKey(selection), {
97
- node: selection,
98
- deferUsage: deferUsage != null ? deferUsage : parentDeferUsage
99
- });
84
+ groupedFieldSet.add(getFieldEntryKey(selection), selection);
100
85
  break;
101
86
  }
102
87
  case import_graphql.Kind.INLINE_FRAGMENT: {
103
- if (!shouldIncludeNode(schemaFragment, variableValues, selection) || !doesFragmentConditionMatch(
88
+ if (!shouldIncludeNode(exeContext, selection) || !doesFragmentConditionMatch(
104
89
  selection,
105
90
  runtimeTypeName,
106
- schemaFragment
91
+ exeContext.schemaFragment
107
92
  )) {
108
93
  continue;
109
94
  }
110
- const newDeferUsage = getDeferUsage(
111
- schemaFragment,
112
- operation,
113
- variableValues,
114
- selection,
115
- parentDeferUsage
116
- );
117
- collectFieldsImpl(
118
- context,
119
- selection.selectionSet,
120
- groupedFieldSet,
121
- parentDeferUsage,
122
- newDeferUsage != null ? newDeferUsage : deferUsage
123
- );
95
+ const defer = getDeferValues(exeContext, selection);
96
+ if (defer) {
97
+ const patchFields = new import_AccumulatorMap.AccumulatorMap();
98
+ collectFieldsImpl(
99
+ exeContext,
100
+ runtimeTypeName,
101
+ selection.selectionSet,
102
+ patchFields,
103
+ patches,
104
+ visitedFragmentNames
105
+ );
106
+ patches.push({
107
+ label: defer.label,
108
+ groupedFieldSet: patchFields
109
+ });
110
+ } else {
111
+ collectFieldsImpl(
112
+ exeContext,
113
+ runtimeTypeName,
114
+ selection.selectionSet,
115
+ groupedFieldSet,
116
+ patches,
117
+ visitedFragmentNames
118
+ );
119
+ }
124
120
  break;
125
121
  }
126
122
  case import_graphql.Kind.FRAGMENT_SPREAD: {
127
123
  const fragName = selection.name.value;
128
- const newDeferUsage = getDeferUsage(
129
- schemaFragment,
130
- operation,
131
- variableValues,
132
- selection,
133
- parentDeferUsage
134
- );
135
- if (!newDeferUsage && (visitedFragmentNames.has(fragName) || !shouldIncludeNode(schemaFragment, variableValues, selection))) {
124
+ if (!shouldIncludeNode(exeContext, selection)) {
136
125
  continue;
137
126
  }
138
- const fragment = fragments[fragName];
139
- if (fragment == null || !doesFragmentConditionMatch(fragment, runtimeTypeName, schemaFragment)) {
127
+ const defer = getDeferValues(exeContext, selection);
128
+ if (visitedFragmentNames.has(fragName) && !defer) {
140
129
  continue;
141
130
  }
142
- if (!newDeferUsage) {
131
+ const fragment = exeContext.fragments[fragName];
132
+ if (fragment == null || !doesFragmentConditionMatch(
133
+ fragment,
134
+ runtimeTypeName,
135
+ exeContext.schemaFragment
136
+ )) {
137
+ continue;
138
+ }
139
+ if (!defer) {
143
140
  visitedFragmentNames.add(fragName);
144
141
  }
145
- collectFieldsImpl(
146
- context,
147
- fragment.selectionSet,
148
- groupedFieldSet,
149
- parentDeferUsage,
150
- newDeferUsage != null ? newDeferUsage : deferUsage
151
- );
142
+ if (defer) {
143
+ const patchFields = new import_AccumulatorMap.AccumulatorMap();
144
+ collectFieldsImpl(
145
+ exeContext,
146
+ runtimeTypeName,
147
+ fragment.selectionSet,
148
+ patchFields,
149
+ patches,
150
+ visitedFragmentNames
151
+ );
152
+ patches.push({
153
+ label: defer.label,
154
+ groupedFieldSet: patchFields
155
+ });
156
+ } else {
157
+ collectFieldsImpl(
158
+ exeContext,
159
+ runtimeTypeName,
160
+ fragment.selectionSet,
161
+ groupedFieldSet,
162
+ patches,
163
+ visitedFragmentNames
164
+ );
165
+ }
152
166
  break;
153
167
  }
154
168
  }
155
169
  }
156
170
  }
157
- function shouldIncludeNode(schemaFragment, variableValues, node) {
171
+ function shouldIncludeNode(exeContext, node) {
158
172
  var _a;
159
173
  if (!((_a = node.directives) == null ? void 0 : _a.length)) {
160
174
  return true;
161
175
  }
162
- const skip = (0, import_values.getDirectiveValues)(
163
- schemaFragment,
164
- import_directives.GraphQLSkipDirective,
165
- node,
166
- variableValues
167
- );
176
+ const skip = (0, import_values.getDirectiveValues)(exeContext, import_directives.GraphQLSkipDirective, node);
168
177
  if ((skip == null ? void 0 : skip.if) === true) {
169
178
  return false;
170
179
  }
171
- const include = (0, import_values.getDirectiveValues)(
172
- schemaFragment,
173
- import_directives.GraphQLIncludeDirective,
174
- node,
175
- variableValues
176
- );
180
+ const include = (0, import_values.getDirectiveValues)(exeContext, import_directives.GraphQLIncludeDirective, node);
177
181
  if ((include == null ? void 0 : include.if) === false) {
178
182
  return false;
179
183
  }
@@ -196,13 +200,8 @@ function doesFragmentConditionMatch(fragment, typeName, { definitions }) {
196
200
  function getFieldEntryKey(node) {
197
201
  return node.alias ? node.alias.value : node.name.value;
198
202
  }
199
- function getDeferUsage(schemaFragment, operation, variableValues, node, parentDeferUsage) {
200
- const defer = (0, import_values.getDirectiveValues)(
201
- schemaFragment,
202
- import_directives.GraphQLDeferDirective,
203
- node,
204
- variableValues
205
- );
203
+ function getDeferValues(exeContext, node) {
204
+ const defer = (0, import_values.getDirectiveValues)(exeContext, import_directives.GraphQLDeferDirective, node);
206
205
  if (!defer) {
207
206
  return;
208
207
  }
@@ -210,11 +209,10 @@ function getDeferUsage(schemaFragment, operation, variableValues, node, parentDe
210
209
  return;
211
210
  }
212
211
  (0, import_invariant.default)(
213
- operation.operation !== "subscription",
212
+ exeContext.operation.operation !== "subscription",
214
213
  "`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`."
215
214
  );
216
215
  return {
217
- label: typeof defer.label === "string" ? defer.label : void 0,
218
- parentDeferUsage
216
+ label: typeof defer.label === "string" ? defer.label : void 0
219
217
  };
220
218
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/collectFields.ts"],
4
- "sourcesContent": ["import {\n Kind,\n FieldNode,\n FragmentDefinitionNode,\n FragmentSpreadNode,\n InlineFragmentNode,\n SelectionNode,\n SelectionSetNode,\n OperationDefinitionNode,\n} from \"graphql\";\nimport { getDirectiveValues } from \"./values\";\nimport {\n GraphQLSkipDirective,\n GraphQLIncludeDirective,\n GraphQLDeferDirective,\n} from \"./schema/directives\";\n\nimport { AccumulatorMap } from \"./jsutils/AccumulatorMap\";\nimport invariant from \"invariant\";\nimport { ExecutionContext } from \"./executeWithoutSchema\";\nimport { isAbstractType, isSubType } from \"./schema/definition\";\nimport { SchemaFragment } from \"./types\";\nimport { ObjMap } from \"./jsutils/ObjMap\";\nimport { Maybe } from \"./jsutils/Maybe\";\nimport { FieldGroup } from \"./buildFieldPlan\";\n\nexport interface DeferUsage {\n label: string | undefined;\n parentDeferUsage: DeferUsage | undefined;\n}\n\nexport interface StreamUsage {\n label: string | undefined;\n initialCount: number;\n fieldGroup: FieldGroup;\n}\n\nexport interface FieldDetails {\n node: FieldNode;\n deferUsage: DeferUsage | undefined;\n}\n\nexport type GroupedFieldSet = Map<string, FieldGroup>;\n\nexport interface PatchFields {\n label: string | undefined;\n groupedFieldSet: GroupedFieldSet;\n}\n\n/**\n * Given a selectionSet, collects all of the fields and returns them.\n *\n * CollectFields requires the \"runtime type\" of an object. For a field that\n * returns an Interface or Union type, the \"runtime type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\nexport function collectFields(\n exeContext: ExecutionContext,\n runtimeTypeName: string,\n): Map<string, ReadonlyArray<FieldDetails>> {\n const groupedFieldSet = new AccumulatorMap<string, FieldDetails>();\n const context: CollectFieldsContext = {\n schemaFragment: exeContext.schemaFragment,\n fragments: exeContext.fragments,\n variableValues: exeContext.variableValues,\n runtimeTypeName,\n operation: exeContext.operation,\n visitedFragmentNames: new Set(),\n };\n collectFieldsImpl(\n context,\n exeContext.operation.selectionSet,\n groupedFieldSet,\n );\n return groupedFieldSet;\n}\n\ninterface CollectFieldsContext {\n schemaFragment: SchemaFragment;\n fragments: ObjMap<FragmentDefinitionNode>;\n variableValues: { [variable: string]: unknown };\n operation: OperationDefinitionNode;\n runtimeTypeName: string;\n visitedFragmentNames: Set<string>;\n}\n\n/**\n * Given an array of field nodes, collects all of the subfields of the passed\n * in fields, and returns them at the end.\n *\n * CollectSubFields requires the \"return type\" of an object. For a field that\n * returns an Interface or Union type, the \"return type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n// eslint-disable-next-line max-params\nexport function collectSubfields(\n schemaFragment: SchemaFragment,\n fragments: ObjMap<FragmentDefinitionNode>,\n variableValues: { [variable: string]: unknown },\n operation: OperationDefinitionNode,\n returnTypeName: string,\n fieldDetails: ReadonlyArray<FieldDetails>,\n): Map<string, ReadonlyArray<FieldDetails>> {\n const context: CollectFieldsContext = {\n schemaFragment,\n fragments,\n variableValues,\n runtimeTypeName: returnTypeName,\n operation,\n visitedFragmentNames: new Set(),\n };\n const subGroupedFieldSet = new AccumulatorMap<string, FieldDetails>();\n\n for (const fieldDetail of fieldDetails) {\n const node = fieldDetail.node;\n if (node.selectionSet) {\n collectFieldsImpl(\n context,\n node.selectionSet,\n subGroupedFieldSet,\n fieldDetail.deferUsage,\n );\n }\n }\n\n return subGroupedFieldSet;\n}\n\n// eslint-disable-next-line max-params\nfunction collectFieldsImpl(\n context: CollectFieldsContext,\n selectionSet: SelectionSetNode,\n groupedFieldSet: AccumulatorMap<string, FieldDetails>,\n parentDeferUsage?: DeferUsage,\n deferUsage?: DeferUsage,\n): void {\n const {\n schemaFragment,\n fragments,\n variableValues,\n runtimeTypeName,\n operation,\n visitedFragmentNames,\n } = context;\n\n for (const selection of selectionSet.selections) {\n switch (selection.kind) {\n case Kind.FIELD: {\n if (!shouldIncludeNode(schemaFragment, variableValues, selection)) {\n continue;\n }\n groupedFieldSet.add(getFieldEntryKey(selection), {\n node: selection,\n deferUsage: deferUsage ?? parentDeferUsage,\n });\n break;\n }\n case Kind.INLINE_FRAGMENT: {\n if (\n !shouldIncludeNode(schemaFragment, variableValues, selection) ||\n !doesFragmentConditionMatch(\n selection,\n runtimeTypeName,\n schemaFragment,\n )\n ) {\n continue;\n }\n\n const newDeferUsage = getDeferUsage(\n schemaFragment,\n operation,\n variableValues,\n selection,\n parentDeferUsage,\n );\n\n collectFieldsImpl(\n context,\n selection.selectionSet,\n groupedFieldSet,\n parentDeferUsage,\n newDeferUsage ?? deferUsage,\n );\n\n break;\n }\n case Kind.FRAGMENT_SPREAD: {\n const fragName = selection.name.value;\n\n const newDeferUsage = getDeferUsage(\n schemaFragment,\n operation,\n variableValues,\n selection,\n parentDeferUsage,\n );\n\n if (\n !newDeferUsage &&\n (visitedFragmentNames.has(fragName) ||\n !shouldIncludeNode(schemaFragment, variableValues, selection))\n ) {\n continue;\n }\n\n const fragment = fragments[fragName];\n if (\n fragment == null ||\n !doesFragmentConditionMatch(fragment, runtimeTypeName, schemaFragment)\n ) {\n continue;\n }\n if (!newDeferUsage) {\n visitedFragmentNames.add(fragName);\n }\n\n collectFieldsImpl(\n context,\n fragment.selectionSet,\n groupedFieldSet,\n parentDeferUsage,\n newDeferUsage ?? deferUsage,\n );\n break;\n }\n }\n }\n}\n\n/**\n * Determines if a field should be included based on the @include and @skip\n * directives, where @skip has higher precedence than @include.\n */\nfunction shouldIncludeNode(\n schemaFragment: SchemaFragment,\n variableValues: Maybe<ObjMap<unknown>>,\n node: SelectionNode,\n): boolean {\n if (!node.directives?.length) {\n return true;\n }\n\n const skip = getDirectiveValues(\n schemaFragment,\n GraphQLSkipDirective,\n node,\n variableValues,\n );\n if (skip?.if === true) {\n return false;\n }\n\n const include = getDirectiveValues(\n schemaFragment,\n GraphQLIncludeDirective,\n node,\n variableValues,\n );\n if (include?.if === false) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Determines if a fragment is applicable to the given type.\n */\nfunction doesFragmentConditionMatch(\n fragment: FragmentDefinitionNode | InlineFragmentNode,\n typeName: string,\n { definitions }: SchemaFragment,\n): boolean {\n const typeConditionNode = fragment.typeCondition;\n if (!typeConditionNode) {\n return true;\n }\n\n const conditionalTypeName = typeConditionNode.name.value;\n\n if (conditionalTypeName === typeName) {\n return true;\n }\n if (isAbstractType(definitions, conditionalTypeName)) {\n return isSubType(definitions, conditionalTypeName, typeName);\n }\n return false;\n}\n\n/**\n * Implements the logic to compute the key of a given field's entry\n */\nfunction getFieldEntryKey(node: FieldNode): string {\n return node.alias ? node.alias.value : node.name.value;\n}\n\n/**\n * Returns an object containing the `@defer` arguments if a field should be\n * deferred based on the experimental flag, defer directive present and\n * not disabled by the \"if\" argument.\n */\nfunction getDeferUsage(\n schemaFragment: SchemaFragment,\n operation: OperationDefinitionNode,\n variableValues: { [variable: string]: unknown },\n node: FragmentSpreadNode | InlineFragmentNode,\n parentDeferUsage: DeferUsage | undefined,\n): DeferUsage | undefined {\n const defer = getDirectiveValues(\n schemaFragment,\n GraphQLDeferDirective,\n node,\n variableValues,\n );\n\n if (!defer) {\n return;\n }\n\n if (defer.if === false) {\n return;\n }\n\n invariant(\n operation.operation !== \"subscription\",\n \"`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.\",\n );\n\n return {\n label: typeof defer.label === \"string\" ? defer.label : undefined,\n parentDeferUsage,\n };\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBASO;AACP,oBAAmC;AACnC,wBAIO;AAEP,4BAA+B;AAC/B,uBAAsB;AAEtB,wBAA0C;AAsCnC,SAAS,cACd,YACA,iBAC0C;AAC1C,QAAM,kBAAkB,IAAI,qCAAqC;AACjE,QAAM,UAAgC;AAAA,IACpC,gBAAgB,WAAW;AAAA,IAC3B,WAAW,WAAW;AAAA,IACtB,gBAAg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WAAO;AAAA,EACT;AACA,UAAI,kCAAe,aAAa,mBAAmB,GAAG;AACpD,eAAO,6BAAU,aAAa,qBAAqB,QAAQ;AAAA,EAC7D;AACA,SAAO;AACT;AAKA,SAAS,iBAAiB,MAAyB;AACjD,SAAO,KAAK,QAAQ,KAAK,MAAM,QAAQ,KAAK,KAAK;AACnD;AAOA,SAAS,cACP,gBACA,WACA,gBACA,MACA,kBACwB;AACxB,QAAM,YAAQ;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,MAAI,CAAC,OAAO;AACV;AAAA,EACF;AAEA,MAAI,MAAM,OAAO,OAAO;AACtB;AAAA,EACF;AAEA,uBAAAA;AAAA,IACE,UAAU,cAAc;AAAA,IACxB;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO,OAAO,MAAM,UAAU,WAAW,MAAM,QAAQ;AAAA,IACvD;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import {\n Kind,\n FieldNode,\n FragmentDefinitionNode,\n FragmentSpreadNode,\n InlineFragmentNode,\n SelectionNode,\n SelectionSetNode,\n} from \"graphql\";\nimport { getDirectiveValues } from \"./values\";\nimport {\n GraphQLSkipDirective,\n GraphQLIncludeDirective,\n GraphQLDeferDirective,\n} from \"./schema/directives\";\n\nimport { AccumulatorMap } from \"./jsutils/AccumulatorMap\";\nimport invariant from \"invariant\";\nimport { ExecutionContext } from \"./executeWithoutSchema\";\nimport { isAbstractType, isSubType } from \"./schema/definition\";\nimport { SchemaFragment } from \"./types\";\n\nexport type FieldGroup = ReadonlyArray<FieldNode>;\n\nexport type GroupedFieldSet = Map<string, FieldGroup>;\n\nexport interface PatchFields {\n label: string | undefined;\n groupedFieldSet: GroupedFieldSet;\n}\n\nexport interface FieldsAndPatches {\n groupedFieldSet: GroupedFieldSet;\n patches: Array<PatchFields>;\n}\n\n/**\n * Given a selectionSet, collects all of the fields and returns them.\n *\n * CollectFields requires the \"runtime type\" of an object. For a field that\n * returns an Interface or Union type, the \"runtime type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\nexport function collectFields(\n exeContext: ExecutionContext,\n runtimeTypeName: string,\n): FieldsAndPatches {\n const { operation } = exeContext;\n const groupedFieldSet = new AccumulatorMap<string, FieldNode>();\n const patches: Array<PatchFields> = [];\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n operation.selectionSet,\n groupedFieldSet,\n patches,\n new Set(),\n );\n return { groupedFieldSet, patches };\n}\n\n/**\n * Given an array of field nodes, collects all of the subfields of the passed\n * in fields, and returns them at the end.\n *\n * CollectSubFields requires the \"return type\" of an object. For a field that\n * returns an Interface or Union type, the \"return type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n// eslint-disable-next-line max-params\nexport function collectSubfields(\n exeContext: ExecutionContext,\n returnTypeName: string,\n fieldGroup: FieldGroup,\n): FieldsAndPatches {\n const subGroupedFieldSet = new AccumulatorMap<string, FieldNode>();\n const visitedFragmentNames = new Set<string>();\n\n const subPatches: Array<PatchFields> = [];\n const subFieldsAndPatches = {\n groupedFieldSet: subGroupedFieldSet,\n patches: subPatches,\n };\n\n for (const node of fieldGroup) {\n if (node.selectionSet) {\n collectFieldsImpl(\n exeContext,\n returnTypeName,\n node.selectionSet,\n subGroupedFieldSet,\n subPatches,\n visitedFragmentNames,\n );\n }\n }\n return subFieldsAndPatches;\n}\n\n// eslint-disable-next-line max-params\nfunction collectFieldsImpl(\n exeContext: ExecutionContext,\n runtimeTypeName: string,\n selectionSet: SelectionSetNode,\n groupedFieldSet: AccumulatorMap<string, FieldNode>,\n patches: Array<PatchFields>,\n visitedFragmentNames: Set<string>,\n): void {\n for (const selection of selectionSet.selections) {\n switch (selection.kind) {\n case Kind.FIELD: {\n if (!shouldIncludeNode(exeContext, selection)) {\n continue;\n }\n groupedFieldSet.add(getFieldEntryKey(selection), selection);\n break;\n }\n case Kind.INLINE_FRAGMENT: {\n if (\n !shouldIncludeNode(exeContext, selection) ||\n !doesFragmentConditionMatch(\n selection,\n runtimeTypeName,\n exeContext.schemaFragment,\n )\n ) {\n continue;\n }\n\n const defer = getDeferValues(exeContext, selection);\n\n if (defer) {\n const patchFields = new AccumulatorMap<string, FieldNode>();\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n selection.selectionSet,\n patchFields,\n patches,\n visitedFragmentNames,\n );\n patches.push({\n label: defer.label,\n groupedFieldSet: patchFields,\n });\n } else {\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n selection.selectionSet,\n groupedFieldSet,\n patches,\n visitedFragmentNames,\n );\n }\n break;\n }\n case Kind.FRAGMENT_SPREAD: {\n const fragName = selection.name.value;\n\n if (!shouldIncludeNode(exeContext, selection)) {\n continue;\n }\n\n const defer = getDeferValues(exeContext, selection);\n if (visitedFragmentNames.has(fragName) && !defer) {\n continue;\n }\n\n const fragment = exeContext.fragments[fragName];\n if (\n fragment == null ||\n !doesFragmentConditionMatch(\n fragment,\n runtimeTypeName,\n exeContext.schemaFragment,\n )\n ) {\n continue;\n }\n\n if (!defer) {\n visitedFragmentNames.add(fragName);\n }\n\n if (defer) {\n const patchFields = new AccumulatorMap<string, FieldNode>();\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n fragment.selectionSet,\n patchFields,\n patches,\n visitedFragmentNames,\n );\n patches.push({\n label: defer.label,\n groupedFieldSet: patchFields,\n });\n } else {\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n fragment.selectionSet,\n groupedFieldSet,\n patches,\n visitedFragmentNames,\n );\n }\n break;\n }\n }\n }\n}\n\n/**\n * Determines if a field should be included based on the @include and @skip\n * directives, where @skip has higher precedence than @include.\n */\nfunction shouldIncludeNode(\n exeContext: ExecutionContext,\n node: SelectionNode,\n): boolean {\n if (!node.directives?.length) {\n return true;\n }\n\n const skip = getDirectiveValues(exeContext, GraphQLSkipDirective, node);\n if (skip?.if === true) {\n return false;\n }\n\n const include = getDirectiveValues(exeContext, GraphQLIncludeDirective, node);\n if (include?.if === false) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Determines if a fragment is applicable to the given type.\n */\nfunction doesFragmentConditionMatch(\n fragment: FragmentDefinitionNode | InlineFragmentNode,\n typeName: string,\n { definitions }: SchemaFragment,\n): boolean {\n const typeConditionNode = fragment.typeCondition;\n if (!typeConditionNode) {\n return true;\n }\n\n const conditionalTypeName = typeConditionNode.name.value;\n\n if (conditionalTypeName === typeName) {\n return true;\n }\n if (isAbstractType(definitions, conditionalTypeName)) {\n return isSubType(definitions, conditionalTypeName, typeName);\n }\n return false;\n}\n\n/**\n * Implements the logic to compute the key of a given field's entry\n */\nfunction getFieldEntryKey(node: FieldNode): string {\n return node.alias ? node.alias.value : node.name.value;\n}\n\n/**\n * Returns an object containing the `@defer` arguments if a field should be\n * deferred based on the experimental flag, defer directive present and\n * not disabled by the \"if\" argument.\n */\nfunction getDeferValues(\n exeContext: ExecutionContext,\n node: FragmentSpreadNode | InlineFragmentNode,\n): undefined | { label: string | undefined } {\n const defer = getDirectiveValues(exeContext, GraphQLDeferDirective, node);\n\n if (!defer) {\n return;\n }\n\n if (defer.if === false) {\n return;\n }\n\n invariant(\n exeContext.operation.operation !== \"subscription\",\n \"`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.\",\n );\n\n return {\n label: typeof defer.label === \"string\" ? defer.label : undefined,\n };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAQO;AACP,oBAAmC;AACnC,wBAIO;AAEP,4BAA+B;AAC/B,uBAAsB;AAEtB,wBAA0C;AA0BnC,SAAS,cACd,YACA,iBACkB;AAClB,QAAM,EAAE,UAAU,IAAI;AACtB,QAAM,kBAAkB,IAAI,qCAAkC;AAC9D,QAAM,UAA8B,CAAC;AACrC;AAAA,IACE;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,oBAAI,IAAI;AAAA,EACV;AACA,SAAO,EA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