This repository was archived by the owner on Mar 20, 2023. It is now read-only.
File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ import { renderGraphiQL } from './renderGraphiQL';
36
36
type Request = IncomingMessage & { url : string } ;
37
37
38
38
type Response = ServerResponse & { json ?: ( data : unknown ) => void } ;
39
- type MaybePromise < T > = Promise < T > | T ;
39
+
40
+ type PromiseOrValue < T > = Promise < T > | T ;
40
41
41
42
/**
42
43
* Used to configure the graphqlHTTP middleware by providing a schema
@@ -50,8 +51,8 @@ export type Options =
50
51
request : Request ,
51
52
response : Response ,
52
53
params ?: GraphQLParams ,
53
- ) => MaybePromise < OptionsData > )
54
- | MaybePromise < OptionsData > ;
54
+ ) => PromiseOrValue < OptionsData > )
55
+ | PromiseOrValue < OptionsData > ;
55
56
56
57
export interface OptionsData {
57
58
/**
@@ -94,7 +95,7 @@ export interface OptionsData {
94
95
* An optional function which will be used to execute instead of default `execute`
95
96
* from `graphql-js`.
96
97
*/
97
- customExecuteFn ?: ( args : ExecutionArgs ) => MaybePromise < ExecutionResult > ;
98
+ customExecuteFn ?: ( args : ExecutionArgs ) => PromiseOrValue < ExecutionResult > ;
98
99
99
100
/**
100
101
* An optional function which will be used to format any errors produced by
@@ -127,7 +128,7 @@ export interface OptionsData {
127
128
*/
128
129
extensions ?: (
129
130
info : RequestInfo ,
130
- ) => MaybePromise < undefined | { [ key : string ] : unknown } > ;
131
+ ) => PromiseOrValue < undefined | { [ key : string ] : unknown } > ;
131
132
132
133
/**
133
134
* A boolean to optionally enable GraphiQL mode.
You can’t perform that action at this time.
0 commit comments