Commit d841932
committed
feat(execution): add field batch resolver mode
Introduce the experimental field batch resolver execution mode behind enableBatchResolvers: 'field'. The option is typed by BatchResolverLevel, and regular field execution remains the path for fields that do not define experimentalBatchResolve.
Example option:
execute({ schema, document, enableBatchResolvers: 'field' });
Example field resolver:
const name = {
type: GraphQLString,
experimentalBatchResolve: (sources) =>
sources.map((source) => source.name),
};1 parent b5c36e7 commit d841932
23 files changed
Lines changed: 3649 additions & 751 deletions
File tree
- benchmark
- batch-resolution-setups
- grafast
- graphql-breadth-js
- graphql-jit
- src/execution
- batchResolve
- __tests__
- incremental
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| |||
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
48 | | - | |
| 52 | + | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
53 | 57 | | |
| 58 | + | |
54 | 59 | | |
55 | 60 | | |
0 commit comments