Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
export function prepareTopLevelResolvers(resolverObject: Query | Mutation) {
return Object.entries(resolverObject).reduce((result, entry) => {
const resolverName = entry[0];
const resolverFunction = entry[1];
return {
...result,
[resolverName]: async (parent, args, context, info) => {
return await resolverFunction(args, info);
}
};
}, {});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.