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

Commit 6648d98

Browse files
committed
Remove unnecessary Promise wrap
1 parent 29269b9 commit 6648d98

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/index.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,9 @@ function graphqlHTTP(options: Options): Middleware {
153153
.then(graphQLParams => {
154154
params = graphQLParams;
155155
// Then, resolve the Options to get OptionsData.
156-
return new Promise(resolve =>
157-
resolve(
158-
typeof options === 'function'
159-
? options(request, response, params)
160-
: options,
161-
),
162-
);
156+
return typeof options === 'function'
157+
? options(request, response, params)
158+
: options;
163159
})
164160
.then(optionsData => {
165161
// Assert that optionsData is in fact an Object.

0 commit comments

Comments
 (0)