Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 193fc6d

Browse files
committed
npm run pretty
1 parent 9071b56 commit 193fc6d

File tree

4 files changed

+22
-15
lines changed

4 files changed

+22
-15
lines changed

src/__tests__/http-test.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ describe('test harness', () => {
267267
expect(JSON.parse(response.text)).to.deep.equal({
268268
errors: [
269269
{
270-
message: 'Must provide operation name if query contains multiple operations.',
270+
message:
271+
'Must provide operation name if query contains multiple operations.',
271272
},
272273
],
273274
});
@@ -288,7 +289,8 @@ describe('test harness', () => {
288289
expect(JSON.parse(response.text)).to.deep.equal({
289290
errors: [
290291
{
291-
message: 'Can only perform a mutation operation from a POST request.',
292+
message:
293+
'Can only perform a mutation operation from a POST request.',
292294
},
293295
],
294296
});
@@ -313,7 +315,8 @@ describe('test harness', () => {
313315
expect(JSON.parse(response.text)).to.deep.equal({
314316
errors: [
315317
{
316-
message: 'Can only perform a mutation operation from a POST request.',
318+
message:
319+
'Can only perform a mutation operation from a POST request.',
317320
},
318321
],
319322
});
@@ -1024,8 +1027,8 @@ describe('test harness', () => {
10241027
graphqlHTTP(req => {
10251028
return {
10261029
schema: TestSchema,
1027-
pretty: ((url.parse(req.url, true) || {}).query || {}).pretty ===
1028-
'1',
1030+
pretty:
1031+
((url.parse(req.url, true) || {}).query || {}).pretty === '1',
10291032
};
10301033
}),
10311034
);
@@ -1244,7 +1247,8 @@ describe('test harness', () => {
12441247
expect(JSON.parse(response.text)).to.deep.equal({
12451248
errors: [
12461249
{
1247-
message: 'Syntax Error GraphQL request (1:1) ' +
1250+
message:
1251+
'Syntax Error GraphQL request (1:1) ' +
12481252
'Unexpected Name "syntaxerror"\n\n1: syntaxerror\n ^\n',
12491253
locations: [{ line: 1, column: 1 }],
12501254
},

src/__tests__/usage-test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ describe('Useful errors when incorrectly used', () => {
3434
expect(JSON.parse(response.text)).to.deep.equal({
3535
errors: [
3636
{
37-
message: 'GraphQL middleware option function must return an options object or a promise which will be resolved to an options object.',
37+
message:
38+
'GraphQL middleware option function must return an options object or a promise which will be resolved to an options object.',
3839
},
3940
],
4041
});
@@ -51,7 +52,8 @@ describe('Useful errors when incorrectly used', () => {
5152
expect(JSON.parse(response.text)).to.deep.equal({
5253
errors: [
5354
{
54-
message: 'GraphQL middleware option function must return an options object or a promise which will be resolved to an options object.',
55+
message:
56+
'GraphQL middleware option function must return an options object or a promise which will be resolved to an options object.',
5557
},
5658
],
5759
});

src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ import type { $Request, $Response } from 'express';
3636
*/
3737
export type Options =
3838
| ((
39-
request: $Request,
40-
response: $Response,
41-
params?: GraphQLParams,
42-
) => OptionsResult)
39+
request: $Request,
40+
response: $Response,
41+
params?: GraphQLParams,
42+
) => OptionsResult)
4343
| OptionsResult;
4444
export type OptionsResult = OptionsData | Promise<OptionsData>;
4545
export type OptionsData = {

src/parseBody.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,10 @@ function read(req, typeInfo, parseFn, resolve, reject) {
105105

106106
// Get content-encoding (e.g. gzip)
107107
const contentEncoding = req.headers['content-encoding'];
108-
const encoding = typeof contentEncoding === 'string'
109-
? contentEncoding.toLowerCase()
110-
: 'identity';
108+
const encoding =
109+
typeof contentEncoding === 'string'
110+
? contentEncoding.toLowerCase()
111+
: 'identity';
111112
const length = encoding === 'identity' ? req.headers['content-length'] : null;
112113
const limit = 100 * 1024; // 100kb
113114
const stream = decompressed(req, encoding);

0 commit comments

Comments
 (0)