sdy

add PubSub

import dotenv from "dotenv";
dotenv.config();
import { GraphQLServer } from "graphql-yoga";
import { GraphQLServer, PubSub } from "graphql-yoga";
import morgan from "morgan";
import schema from "./schema";
import "./passport";
......@@ -8,9 +8,11 @@ import { authenticateJWT } from "./passport";
const PORT = process.env.PORT;
const pubsub = new PubSub();
const server = new GraphQLServer({
schema,
context: ({ request }) => ({ request }),
context: ({ request }) => ({ request, pubsub }),
});
server.express.use(morgan("dev"));
......