Skip to content

Commit

Permalink
Improve internal typings (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Dec 7, 2021
1 parent f66395c commit 691a529
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/node/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function nodeDefinitions<TContext>(
resolveType: typeResolver,
});

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

const nodesField = {
const nodesField: GraphQLFieldConfig<mixed, TContext> = {
description: 'Fetches objects given their IDs',
type: new GraphQLNonNull(new GraphQLList(nodeInterface)),
args: {
Expand All @@ -69,7 +69,7 @@ export function nodeDefinitions<TContext>(
},
},
resolve: (_obj, { ids }, context, info) =>
ids.map((id) => fetchById(id, context, info)),
ids.map((id: string) => fetchById(id, context, info)),
};

return { nodeInterface, nodeField, nodesField };
Expand Down
2 changes: 1 addition & 1 deletion src/node/plural.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function pluralIdentifyingRootField(
},
resolve(_obj, args, context, info) {
const inputs = args[config.argName];
return inputs.map((input) =>
return inputs.map((input: mixed) =>
config.resolveSingleInput(input, context, info),
);
},
Expand Down

0 comments on commit 691a529

Please sign in to comment.