// src/index.js
const { GraphQLServer } = require('graphql-yoga')
const { prisma } = require('../prisma/generated/prisma-client')
const server = new GraphQLServer({
typeDefs: './src/schema.graphql', // IMPORT our schema.graphql
context: request => {
return {
...request,
prisma,
}
},
})
server.start(() => console.log(`Server is running on http://localhost:4000`))
view raw index.js hosted with ❤ by GitHub