Skip to content

Commit

Permalink
match .d.ts definition
Browse files Browse the repository at this point in the history
  • Loading branch information
saihaj authored and IvanGoncharov committed May 24, 2021
1 parent 4810585 commit 4716127
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/execution/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,25 @@ export type ExecutionContext = {
* - `data` is the result of a successful execution of the query.
* - `extensions` is reserved for adding non-standard properties.
*/
export type ExecutionResult = {
export interface ExecutionResult<
TData = { [key: string]: any },
TExtensions = { [key: string]: any },
> {
errors?: ReadonlyArray<GraphQLError>;
data?: ObjMap<unknown> | null;
extensions?: ObjMap<unknown>;
};
// TS_SPECIFIC: TData. Motivation: https://github.com/graphql/graphql-js/pull/2490#issuecomment-639154229
data?: TData | null;
extensions?: TExtensions;
}

export type FormattedExecutionResult = {
export interface FormattedExecutionResult<
TData = { [key: string]: any },
TExtensions = { [key: string]: any },
> {
errors?: ReadonlyArray<GraphQLFormattedError>;
data?: ObjMap<unknown> | null;
extensions?: ObjMap<unknown>;
};
// TS_SPECIFIC: TData. Motivation: https://github.com/graphql/graphql-js/pull/2490#issuecomment-639154229
data?: TData | null;
extensions?: TExtensions;
}

export type ExecutionArgs = {
schema: GraphQLSchema;
Expand Down

0 comments on commit 4716127

Please sign in to comment.