Created
December 1, 2018 03:41
-
-
Save meshboy/6c019b86bcf0c8297dc7cfcc728c6d57 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ApolloServer, gql } from 'apollo-server-express'; | |
import merge from 'lodash.merge' | |
import { userType, userResolvers } from './resources/user'; | |
import { recipeType, recipeResolvers } from './resources/recipe'; | |
import { fileType } from './resources/file'; | |
const typeDefs = gql`${userType}${recipeType}${fileType}`; | |
export const graphQLRouter = new ApolloServer( | |
{ | |
typeDefs, | |
resolvers: merge({}, userResolvers, recipeResolvers), | |
context: ({req, res})=> ({ user: req.user }) | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment