merge.ts

import { gql } from 'apollo-server-express';
import { mainSchema } from './schema/main';
import { videoSchema } from './schema/video';
import { comedianSchema } from './schema/comedian';
import { recommendationsSchema } from './schema/recommendations';
import { activeDbResolver } from './resolver/active-db';
import { comediansResolver } from './resolver/comedian';
import { recommendationsResolver } from './resolver/recommendations';
import { videosResolver } from './resolver/videos';
import { activeDbSchema } from './schema/active-db';

export const mergedSchema = gql`
  ${mainSchema}

  ${activeDbSchema}

  ${videoSchema}

  ${comedianSchema}

  ${recommendationsSchema}
`;

export const mergedResolvers = {
  Query: {
    ...comediansResolver.Query,
    ...recommendationsResolver.Query,
    ...videosResolver.Query,
    ...activeDbResolver.Query
  },
  Mutation: {
    ...activeDbResolver.Mutation
  }
};