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 @@ -33,7 +33,8 @@ import { renderGraphiQL } from './renderGraphiQL';
33
33
type Request = IncomingMessage & { url : string } ;
34
34
35
35
type Response = ServerResponse & { json ?: ( data : unknown ) => void } ;
36
- type MaybePromise < T > = Promise < T > | T ;
36
+
37
+ type PromiseOrValue < T > = Promise < T > | T ;
37
38
38
39
/**
39
40
* Used to configure the graphqlHTTP middleware by providing a schema
@@ -47,8 +48,8 @@ export type Options =
47
48
request : Request ,
48
49
response : Response ,
49
50
params ?: GraphQLParams ,
50
- ) => MaybePromise < OptionsData > )
51
- | MaybePromise < OptionsData > ;
51
+ ) => PromiseOrValue < OptionsData > )
52
+ | PromiseOrValue < OptionsData > ;
52
53
53
54
export interface OptionsData {
54
55
/**
@@ -91,7 +92,7 @@ export interface OptionsData {
91
92
* An optional function which will be used to execute instead of default `execute`
92
93
* from `graphql-js`.
93
94
*/
94
- customExecuteFn ?: ( args : ExecutionArgs ) => MaybePromise < ExecutionResult > ;
95
+ customExecuteFn ?: ( args : ExecutionArgs ) => PromiseOrValue < ExecutionResult > ;
95
96
96
97
/**
97
98
* An optional function which will be used to format any errors produced by
@@ -124,7 +125,7 @@ export interface OptionsData {
124
125
*/
125
126
extensions ?: (
126
127
info : RequestInfo ,
127
- ) => MaybePromise < undefined | { [ key : string ] : unknown } > ;
128
+ ) => PromiseOrValue < undefined | { [ key : string ] : unknown } > ;
128
129
129
130
/**
130
131
* A boolean to optionally enable GraphiQL mode.
You can’t perform that action at this time.
0 commit comments