From 691a5293cfdaeab5affc7cdbefa21274552bc897 Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Tue, 7 Dec 2021 21:09:48 +0200 Subject: [PATCH] Improve internal typings (#363) --- src/node/node.js | 6 +++--- src/node/plural.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/node/node.js b/src/node/node.js index b76eddf..d56cb4d 100644 --- a/src/node/node.js +++ b/src/node/node.js @@ -45,7 +45,7 @@ export function nodeDefinitions( resolveType: typeResolver, }); - const nodeField = { + const nodeField: GraphQLFieldConfig = { description: 'Fetches an object given its ID', type: nodeInterface, args: { @@ -57,7 +57,7 @@ export function nodeDefinitions( resolve: (_obj, { id }, context, info) => fetchById(id, context, info), }; - const nodesField = { + const nodesField: GraphQLFieldConfig = { description: 'Fetches objects given their IDs', type: new GraphQLNonNull(new GraphQLList(nodeInterface)), args: { @@ -69,7 +69,7 @@ export function nodeDefinitions( }, }, resolve: (_obj, { ids }, context, info) => - ids.map((id) => fetchById(id, context, info)), + ids.map((id: string) => fetchById(id, context, info)), }; return { nodeInterface, nodeField, nodesField }; diff --git a/src/node/plural.js b/src/node/plural.js index 6d0f2f1..5079ac6 100644 --- a/src/node/plural.js +++ b/src/node/plural.js @@ -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), ); },