This is how I am building the mutation resolvers `...
# orm-help
a
This is how I am building the mutation resolvers
Copy code
const buildMutationResolvers = (methods) =>
  Object.entries(methods).reduce(
    (resolvers, [queryName, queryFunc]) => ({
      ...resolvers,
      [queryName]: async (parent, args, context, info) => {
        const label = getPublishLabel(queryName)
        // const data = await queryFunc(args, info)
        if(label) {
          pubsub.publish(label[0], { [label[1]]: args});
        }
        return queryFunc(args, info)
      },
    }),
    {}
  );