Skip to content

Instantly share code, notes, and snippets.

@lastmjs
Created March 12, 2018 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lastmjs/521b662cca42cb4ce125d558022b782b to your computer and use it in GitHub Desktop.
Save lastmjs/521b662cca42cb4ce125d558022b782b to your computer and use it in GitHub Desktop.
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