sdy

update GraphQL context

...@@ -3,18 +3,12 @@ dotenv.config(); ...@@ -3,18 +3,12 @@ dotenv.config();
3 import { GraphQLServer } from "graphql-yoga"; 3 import { GraphQLServer } from "graphql-yoga";
4 import morgan from "morgan"; 4 import morgan from "morgan";
5 import schema from "./schema"; 5 import schema from "./schema";
6 -import { prisma } from "./utils";
7 6
8 const PORT = process.env.PORT; 7 const PORT = process.env.PORT;
9 8
10 const server = new GraphQLServer({ 9 const server = new GraphQLServer({
11 schema, 10 schema,
12 - context: (request) => { 11 + context: ({ request }) => ({ request }),
13 - return {
14 - ...request,
15 - prisma,
16 - };
17 - },
18 }); 12 });
19 13
20 server.express.use(morgan("dev")); 14 server.express.use(morgan("dev"));
......