comedian.ts

import { getComedian } from '../helpers/comedian';
import { getComedians } from '../helpers/comedians';

export const comediansResolver = {
  Query: {
    comedian: async (parent, { comedianId }, context) => {
      const comedian = await getComedian(context, comedianId);
      return comedian;
    },
    comedians: async (parent, args, context) => {
      const comedians = await getComedians(context);
      return comedians;
    }
  }
};