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 8cf1890 commit 09d56d6Copy full SHA for 09d56d6
benchmark/list-asyncIterable-benchmark.js
@@ -0,0 +1,26 @@
1
+'use strict';
2
+
3
+const { parse } = require('graphql/language/parser.js');
4
+const { execute } = require('graphql/execution/execute.js');
5
+const { buildSchema } = require('graphql/utilities/buildASTSchema.js');
6
7
+const schema = buildSchema('type Query { listField: [String] }');
8
+const document = parse('{ listField }');
9
10
+async function* listField() {
11
+ for (let index = 0; index < 100000; index++) {
12
+ yield index;
13
+ }
14
+}
15
16
+module.exports = {
17
+ name: 'Execute Async Iterable List Field',
18
+ count: 10,
19
+ async measure() {
20
+ await execute({
21
+ schema,
22
+ document,
23
+ rootValue: { listField },
24
+ });
25
+ },
26
+};
0 commit comments