Skip to content

Commit 691a529

Browse files
Improve internal typings (#363)
1 parent f66395c commit 691a529

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/node/node.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function nodeDefinitions<TContext>(
4545
resolveType: typeResolver,
4646
});
4747

48-
const nodeField = {
48+
const nodeField: GraphQLFieldConfig<mixed, TContext> = {
4949
description: 'Fetches an object given its ID',
5050
type: nodeInterface,
5151
args: {
@@ -57,7 +57,7 @@ export function nodeDefinitions<TContext>(
5757
resolve: (_obj, { id }, context, info) => fetchById(id, context, info),
5858
};
5959

60-
const nodesField = {
60+
const nodesField: GraphQLFieldConfig<mixed, TContext> = {
6161
description: 'Fetches objects given their IDs',
6262
type: new GraphQLNonNull(new GraphQLList(nodeInterface)),
6363
args: {
@@ -69,7 +69,7 @@ export function nodeDefinitions<TContext>(
6969
},
7070
},
7171
resolve: (_obj, { ids }, context, info) =>
72-
ids.map((id) => fetchById(id, context, info)),
72+
ids.map((id: string) => fetchById(id, context, info)),
7373
};
7474

7575
return { nodeInterface, nodeField, nodesField };

src/node/plural.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function pluralIdentifyingRootField(
3636
},
3737
resolve(_obj, args, context, info) {
3838
const inputs = args[config.argName];
39-
return inputs.map((input) =>
39+
return inputs.map((input: mixed) =>
4040
config.resolveSingleInput(input, context, info),
4141
);
4242
},

0 commit comments

Comments
 (0)