Skip to content

Commit 45f2a59

Browse files
yaacovCRIvanGoncharov
authored andcommitted
introduce GroupedFieldSet type
1 parent 0fb9f1f commit 45f2a59

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/execution/collectFields.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@ import { getDirectiveValues } from './values.js';
2828

2929
export type FieldGroup = ReadonlyArray<FieldNode>;
3030

31+
export type GroupedFieldSet = Map<string, FieldGroup>;
32+
3133
export interface PatchFields {
3234
label: string | undefined;
33-
fields: Map<string, FieldGroup>;
35+
fields: GroupedFieldSet;
3436
}
3537

3638
export interface FieldsAndPatches {
37-
fields: Map<string, FieldGroup>;
39+
fields: GroupedFieldSet;
3840
patches: Array<PatchFields>;
3941
}
4042

src/execution/execute.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import { GraphQLStreamDirective } from '../type/directives.js';
4747
import type { GraphQLSchema } from '../type/schema.js';
4848
import { assertValidSchema } from '../type/validate.js';
4949

50-
import type { FieldGroup } from './collectFields.js';
50+
import type { FieldGroup, GroupedFieldSet } from './collectFields.js';
5151
import {
5252
collectFields,
5353
collectSubfields as _collectSubfields,
@@ -589,7 +589,7 @@ function executeFieldsSerially(
589589
parentType: GraphQLObjectType,
590590
sourceValue: unknown,
591591
path: Path | undefined,
592-
fields: Map<string, FieldGroup>,
592+
fields: GroupedFieldSet,
593593
): PromiseOrValue<ObjMap<unknown>> {
594594
return promiseReduce(
595595
fields,
@@ -627,7 +627,7 @@ function executeFields(
627627
parentType: GraphQLObjectType,
628628
sourceValue: unknown,
629629
path: Path | undefined,
630-
fields: Map<string, FieldGroup>,
630+
fields: GroupedFieldSet,
631631
asyncPayloadRecord?: AsyncPayloadRecord,
632632
): PromiseOrValue<ObjMap<unknown>> {
633633
const results = Object.create(null);
@@ -1770,7 +1770,7 @@ function executeDeferredFragment(
17701770
exeContext: ExecutionContext,
17711771
parentType: GraphQLObjectType,
17721772
sourceValue: unknown,
1773-
fields: Map<string, FieldGroup>,
1773+
fields: GroupedFieldSet,
17741774
label?: string,
17751775
path?: Path,
17761776
parentContext?: AsyncPayloadRecord,

0 commit comments

Comments
 (0)