Created
March 12, 2018 22:15
-
-
Save lastmjs/521b662cca42cb4ce125d558022b782b 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
const ultimateSchemaString = mergeTypes([ | |
readFileSync('./schema/datamodel.graphql').toString(), | |
readFileSync('./schema/dataops.graphql').toString(), | |
readFileSync('./schema/directives.graphql').toString(), | |
readFileSync('./generated/prisma.graphql').toString() | |
], { | |
all: true | |
}); | |
const ultimateSchema = makeExecutableSchema({ | |
typeDefs: ultimateSchemaString, | |
resolvers, | |
directiveResolvers | |
}); | |
const server = new GraphQLServer({ | |
schema: ultimateSchema, | |
context: (req) => { | |
return { | |
...req, | |
db: PrismaDBConnection | |
}; | |
} | |
}); | |
server.start(() => console.log('Server is running on http://localhost:4000')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment