Skip to content

Instantly share code, notes, and snippets.

@acomito
Created August 11, 2019 12:43
Show Gist options
  • Save acomito/f7adb0a96e5b9c3b68eedae53f3dfb76 to your computer and use it in GitHub Desktop.
Save acomito/f7adb0a96e5b9c3b68eedae53f3dfb76 to your computer and use it in GitHub Desktop.
// // TOP LEVEL IMPORTS
import { merge } from 'lodash';
import { gql } from 'apollo-server';
// // User
import { QueryResolvers, QuerySchema } from './types/Query';
import { MutationSchema, MutationResolvers } from './types/Mutation';
import { UserProfileSchema, UserProfileResolvers } from './types/UserProfile';
// using interefaces with each vendor's schema (caterer, venue, etc) will throw an error if one of the types is missing something form our Vendor interface... not exactly like classes/inheritance, but at least it will keep the sub-types in like with the Vendor type.... albeit not DRY
export const typeDefs = gql`
${QuerySchema}
${MutationSchema}
${UserProfileSchema}
`;
export const CustomResolvers = merge(
QueryResolvers,
MutationResolvers,
UserProfileResolvers
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment