This repository was archived by the owner on Mar 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 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';
3636type Request = IncomingMessage & { url : string } ;
3737
3838type Response = ServerResponse & { json ?: ( data : unknown ) => void } ;
39- type MaybePromise < T > = Promise < T > | T ;
39+
40+ type PromiseOrValue < T > = Promise < T > | T ;
4041
4142/**
4243 * Used to configure the graphqlHTTP middleware by providing a schema
@@ -50,8 +51,8 @@ export type Options =
5051 request : Request ,
5152 response : Response ,
5253 params ?: GraphQLParams ,
53- ) => MaybePromise < OptionsData > )
54- | MaybePromise < OptionsData > ;
54+ ) => PromiseOrValue < OptionsData > )
55+ | PromiseOrValue < OptionsData > ;
5556
5657export interface OptionsData {
5758 /**
@@ -94,7 +95,7 @@ export interface OptionsData {
9495 * An optional function which will be used to execute instead of default `execute`
9596 * from `graphql-js`.
9697 */
97- customExecuteFn ?: ( args : ExecutionArgs ) => MaybePromise < ExecutionResult > ;
98+ customExecuteFn ?: ( args : ExecutionArgs ) => PromiseOrValue < ExecutionResult > ;
9899
99100 /**
100101 * An optional function which will be used to format any errors produced by
@@ -127,7 +128,7 @@ export interface OptionsData {
127128 */
128129 extensions ?: (
129130 info : RequestInfo ,
130- ) => MaybePromise < undefined | { [ key : string ] : unknown } > ;
131+ ) => PromiseOrValue < undefined | { [ key : string ] : unknown } > ;
131132
132133 /**
133134 * A boolean to optionally enable GraphiQL mode.
You can’t perform that action at this time.
0 commit comments