Skip to content

Commit

Permalink
change subfiled resolvers to use object params
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskalmar committed Feb 10, 2021
1 parent b589458 commit a7a9ba1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/graphqlProtocol/io.ts
Expand Up @@ -390,7 +390,12 @@ const generateDataOutputField = (
};

if (param.resolve) {
field.resolve = param.resolve;
field.resolve = (
obj: { [key: string]: unknown },
args: { [key: string]: unknown },
context: Context,
info: GraphQLResolveInfo,
) => param.resolve({ obj, args, context, info });
}

return returnAsFieldNameMap ? wrapFieldInFieldName(paramName, field) : field;
Expand Down

0 comments on commit a7a9ba1

Please sign in to comment.