Add async function definition for extensions

This commit is contained in:
Ehsan Ziya
2018-02-04 16:56:03 +00:00
parent f91d88c126
commit 20266dcf97
2 changed files with 3 additions and 2 deletions
@@ -24,7 +24,8 @@ const graphqlOptionRequestAsync = async (request: express.Request): Promise<grap
return {
graphiql: true,
schema: await Promise.resolve(schema),
context: request.session
context: request.session,
extensions: async (args) => { }
};
};
+1 -1
View File
@@ -54,7 +54,7 @@ declare namespace graphqlHTTP {
* An optional function for adding additional metadata to the GraphQL response as a key-value object.
* The result will be added to "extensions" field in the resulting JSON.
*/
extensions?: (args: ExtenstionsArgs) => any;
extensions?: ((args: ExtenstionsArgs) => any) | ((args: ExtenstionsArgs) => Promise<any>);
};