Skip to content

Commit dd32678

Browse files
committed
TS: Enable integrations tests for extending GraphQL*Extensions types
1 parent 995ea3a commit dd32678

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

integrationTests/ts/index.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,21 @@ const example: SomeExtension = {
1313
string: 'Meaning of life',
1414
};
1515

16-
// FIXME: The following code block requires a version of TypeScript >= 3.2
17-
/*
18-
1916
declare module 'graphql' {
20-
interface GraphQLObjectTypeExtensions<TSource = any, TContext = any> {
17+
interface GraphQLObjectTypeExtensions<_TSource = any, _TContext = any> {
2118
someObjectExtension?: SomeExtension;
2219
}
2320
interface GraphQLFieldExtensions<
24-
TSource,
25-
TContext,
26-
TArgs = { [argName: string]: any }
21+
_TSource,
22+
_TContext,
23+
_TArgs = { [argName: string]: any }
2724
> {
2825
someFieldExtension?: SomeExtension;
2926
}
3027
interface GraphQLArgumentExtensions {
3128
someArgumentExtension?: SomeExtension;
3229
}
3330
}
34-
*/
3531

3632
const queryType: GraphQLObjectType = new GraphQLObjectType({
3733
name: 'Query',

src/type/definition.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,8 @@ export interface GraphQLScalarTypeConfig<TInternal, TExternal> {
360360
* We've provided these template arguments because this is an open type and
361361
* you may find them useful.
362362
*/
363-
export interface GraphQLObjectTypeExtensions<_TSource = any, _TContext = any> {
363+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
364+
export interface GraphQLObjectTypeExtensions<TSource = any, TContext = any> {
364365
[attributeName: string]: any;
365366
}
366367

0 commit comments

Comments
 (0)