Skip to content

Instantly share code, notes, and snippets.

@marshallmurphy
Created May 17, 2020 21:10
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 marshallmurphy/46187846834c787a14fc4c9208bd8e5a to your computer and use it in GitHub Desktop.
Save marshallmurphy/46187846834c787a14fc4c9208bd8e5a to your computer and use it in GitHub Desktop.
// src/index.js
const { GraphQLServer } = require('graphql-yoga')
const { prisma } = require('../prisma/generated/prisma-client')
const server = new GraphQLServer({
context: request => {
return {
...request,
prisma,
}
},
})
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