Skip to content

Commit e43ff47

Browse files
committed
chore: prettier
1 parent badafc1 commit e43ff47

12 files changed

+58
-42
lines changed

.github/workflows/codspeed.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CodSpeed Benchmarks
33
on:
44
push:
55
branches:
6-
- "main" # or "master"
6+
- 'main' # or "master"
77
pull_request:
88
# `workflow_dispatch` allows CodSpeed to trigger backtest
99
# performance analysis in order to generate initial data.
@@ -14,8 +14,8 @@ jobs:
1414
name: Run benchmarks
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: "actions/checkout@v4"
18-
- uses: "actions/setup-node@v3"
17+
- uses: 'actions/checkout@v4'
18+
- uses: 'actions/setup-node@v3'
1919
- name: Install dependencies
2020
run: npm install
2121
- name: Run benchmarks
@@ -24,4 +24,4 @@ jobs:
2424
CODSPEED_FORCE_OPTIMIZATION: true
2525
with:
2626
run: npm exec vitest bench
27-
token: ${{ secrets.CODSPEED_TOKEN }}
27+
token: ${{ secrets.CODSPEED_TOKEN }}

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[![GraphQLConf 2024 Banner: September 10-12, San Francisco. Hosted by the GraphQL Foundation](https://github.com/user-attachments/assets/2d048502-e5b2-4e9d-a02a-50b841824de6)](https://graphql.org/conf/2024/?utm_source=github&utm_medium=graphql_js&utm_campaign=readme)
22

33
# GraphQL.js
4-
trigger codspeed
54
The JavaScript reference implementation for GraphQL, a query language for APIs created by Facebook.
65

76
[![npm version](https://badge.fury.io/js/graphql.svg)](https://badge.fury.io/js/graphql)
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { bench, describe } from "vitest";
1+
import { bench, describe } from 'vitest';
22

33
import { GraphQLSchema } from '../type/schema.js';
44

@@ -8,9 +8,9 @@ import { bigSchemaIntrospectionResult } from './fixtures.js';
88

99
const bigSchema = buildClientSchema(bigSchemaIntrospectionResult.data);
1010

11-
describe("Recreate a GraphQLSchema", () => {
12-
bench("Recreate a GraphQLSchema", () => {
11+
describe('Recreate a GraphQLSchema', () => {
12+
bench('Recreate a GraphQLSchema', () => {
1313
// eslint-disable-next-line no-new
1414
new GraphQLSchema(bigSchema.toConfig());
1515
});
16-
});
16+
});
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { bench, describe } from "vitest";
1+
import { bench, describe } from 'vitest';
22

33
import { parse } from '../language/parser.js';
44

@@ -8,8 +8,8 @@ import { bigSchemaSDL } from './fixtures.js';
88

99
const schemaAST = parse(bigSchemaSDL);
1010

11-
describe("Build Schema from AST", () => {
12-
bench("build schema", () => {
11+
describe('Build Schema from AST', () => {
12+
bench('build schema', () => {
1313
buildASTSchema(schemaAST, { assumeValid: true });
1414
});
15-
});
15+
});
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { bench, describe } from "vitest";
1+
import { bench, describe } from 'vitest';
22

33
import { buildClientSchema } from '../utilities/buildClientSchema.js';
44

55
import { bigSchemaIntrospectionResult } from './fixtures.js';
66

7-
describe("Build Schema from Introspection", () => {
8-
bench("build schema", () => {
7+
describe('Build Schema from Introspection', () => {
8+
bench('build schema', () => {
99
buildClientSchema(bigSchemaIntrospectionResult.data, { assumeValid: true });
1010
});
11-
});
11+
});

src/__benchmarks__/introspectionFromSchema-benchmark.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { bench, describe } from "vitest";
1+
import { bench, describe } from 'vitest';
22

33
import { parse } from '../language/parser.js';
44

@@ -13,7 +13,11 @@ const schema = buildSchema(bigSchemaSDL, { assumeValid: true });
1313
const document = parse(getIntrospectionQuery());
1414

1515
describe('Execute Introspection Query', () => {
16-
bench('Introspection Query Execution', () => {
17-
executeSync({ schema, document });
18-
}, { iterations: 20 });
19-
});
16+
bench(
17+
'Introspection Query Execution',
18+
() => {
19+
executeSync({ schema, document });
20+
},
21+
{ iterations: 20 },
22+
);
23+
});

src/__benchmarks__/list.bench.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,26 @@ async function* asyncIterableListField() {
3535

3636
describe('execute listField benchmarks', () => {
3737
bench('Execute Synchronous List Field', async () => {
38-
await execute({ schema, document, rootValue: { listField: syncListField } });
38+
await execute({
39+
schema,
40+
document,
41+
rootValue: { listField: syncListField },
42+
});
3943
});
4044

4145
bench('Execute Asynchronous List Field', async () => {
42-
await execute({ schema, document, rootValue: { listField: asyncListField } });
46+
await execute({
47+
schema,
48+
document,
49+
rootValue: { listField: asyncListField },
50+
});
4351
});
4452

4553
bench('Execute Async Iterable List Field', async () => {
46-
await execute({ schema, document, rootValue: { listField: asyncIterableListField } });
54+
await execute({
55+
schema,
56+
document,
57+
rootValue: { listField: asyncIterableListField },
58+
});
4759
});
48-
});
60+
});

src/__benchmarks__/parse.bench.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ import { parse } from '../language/parser.js';
44

55
import { getIntrospectionQuery } from '../utilities/getIntrospectionQuery.js';
66

7-
87
describe('GraphQL Parsing and Validation Benchmarks', () => {
98
bench('Parse introspection query', () => {
109
parse(getIntrospectionQuery());
1110
});
12-
});
11+
});
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { bench, describe } from "vitest";
1+
import { bench, describe } from 'vitest';
22

3-
import { buildSchema } from "../utilities/buildASTSchema.js";
3+
import { buildSchema } from '../utilities/buildASTSchema.js';
44

5-
import { graphqlSync } from "../graphql.js";
5+
import { graphqlSync } from '../graphql.js';
66

77
const schema = buildSchema('type Query { hello: String! }');
88
const source = `{ ${'hello '.repeat(250)}}`;
99

10-
describe("GraphQL Execution Benchmarks", () => {
11-
bench("Many repeated fields", () => {
10+
describe('GraphQL Execution Benchmarks', () => {
11+
bench('Many repeated fields', () => {
1212
graphqlSync({ schema, source });
1313
});
14-
});
14+
});

src/__benchmarks__/validate.bench.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const queryAST = parse(getIntrospectionQuery());
1414

1515
const sdlAST = parse(bigSchemaSDL);
1616

17-
1817
const invalidQueryAST = parse(`
1918
{
2019
unknownField
@@ -41,4 +40,4 @@ describe('GraphQL Parsing and Validation Benchmarks', () => {
4140
bench('Validate Invalid Query', () => {
4241
validate(schema, invalidQueryAST);
4342
});
44-
});
43+
});

src/__benchmarks__/visitor.bench.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ import { bigSchemaSDL } from './fixtures.js';
77

88
const documentAST = parse(bigSchemaSDL);
99
const visitor = {
10-
enter() { /* do nothing */
11-
}, leave() { /* do nothing */
10+
enter() {
11+
/* do nothing */
12+
},
13+
leave() {
14+
/* do nothing */
1215
},
1316
};
1417
const visitors = new Array(50).fill(visitor);
@@ -21,4 +24,4 @@ describe('GraphQL AST Traversal Benchmarks', () => {
2124
bench('Visit all AST nodes in parallel', () => {
2225
visit(documentAST, visitInParallel(visitors));
2326
});
24-
});
27+
});

vitest.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { defineConfig } from "vitest/config";
2-
import codspeedPlugin from "@codspeed/vitest-plugin";
1+
import { defineConfig } from 'vitest/config';
2+
import codspeedPlugin from '@codspeed/vitest-plugin';
33

44
export default defineConfig({
55
plugins: [codspeedPlugin()],
66
// ...
7-
});
7+
});

0 commit comments

Comments
 (0)