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

Fix type for extensions option #629

Merged
merged 1 commit into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ export type OptionsData = {|
*
* This function may be async.
*/
extensions?: (info: RequestInfo) => { [key: string]: mixed, ... },
extensions?: (
info: RequestInfo,
) => { [key: string]: mixed, ... } | Promise<{ [key: string]: mixed, ... }>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielrearden Suggestion (to make my life easier): It would be great if you use references to code that motivated the change, in this case:

const extensionsObj = await extensionsFn({

Not essential but it will save me from figuring out where to find matching code.


/**
* A boolean to optionally enable GraphiQL mode.
Expand Down
4 changes: 3 additions & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ export interface OptionsData {
*
* This function may be async.
*/
extensions?: (info: RequestInfo) => { [key: string]: unknown };
extensions?: (
info: RequestInfo,
) => { [key: string]: unknown } | Promise<{ [key: string]: unknown }>;

/**
* A boolean to optionally enable GraphiQL mode.
Expand Down