We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e1c9c2 commit 58c72abCopy full SHA for 58c72ab
benchmark/list-asyncIterable-benchmark.js
@@ -0,0 +1,24 @@
1
+import { execute } from 'graphql/execution/execute.js';
2
+import { parse } from 'graphql/language/parser.js';
3
+import { buildSchema } from 'graphql/utilities/buildASTSchema.js';
4
+
5
+const schema = buildSchema('type Query { listField: [String] }');
6
+const document = parse('{ listField }');
7
8
+async function* listField() {
9
+ for (let index = 0; index < 1000; index++) {
10
+ yield index;
11
+ }
12
+}
13
14
+export const benchmark = {
15
+ name: 'Execute Async Iterable List Field',
16
+ count: 10,
17
+ async measure() {
18
+ await execute({
19
+ schema,
20
+ document,
21
+ rootValue: { listField },
22
+ });
23
+ },
24
+};
0 commit comments