Skip to content

Commit 73552d8

Browse files
saihajIvanGoncharov
authored andcommitted
match .d.ts definition
1 parent a48dbb0 commit 73552d8

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

src/execution/execute.ts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,25 @@ export type ExecutionContext = {
112112
* - `data` is the result of a successful execution of the query.
113113
* - `extensions` is reserved for adding non-standard properties.
114114
*/
115-
export type ExecutionResult = {
115+
export interface ExecutionResult<
116+
TData = { [key: string]: any },
117+
TExtensions = { [key: string]: any },
118+
> {
116119
errors?: ReadonlyArray<GraphQLError>;
117-
data?: ObjMap<unknown> | null;
118-
extensions?: ObjMap<unknown>;
119-
};
120+
// TS_SPECIFIC: TData. Motivation: https://github.com/graphql/graphql-js/pull/2490#issuecomment-639154229
121+
data?: TData | null;
122+
extensions?: TExtensions;
123+
}
120124

121-
export type FormattedExecutionResult = {
125+
export interface FormattedExecutionResult<
126+
TData = { [key: string]: any },
127+
TExtensions = { [key: string]: any },
128+
> {
122129
errors?: ReadonlyArray<GraphQLFormattedError>;
123-
data?: ObjMap<unknown> | null;
124-
extensions?: ObjMap<unknown>;
125-
};
130+
// TS_SPECIFIC: TData. Motivation: https://github.com/graphql/graphql-js/pull/2490#issuecomment-639154229
131+
data?: TData | null;
132+
extensions?: TExtensions;
133+
}
126134

127135
export type ExecutionArgs = {
128136
schema: GraphQLSchema;

0 commit comments

Comments
 (0)