sdy

update server.js

import { GraphQLServer } from "graphql-yoga";
import dotenv from "dotenv";
dotenv.config();
import { GraphQLServer } from "graphql-yoga";
import morgan from "morgan";
import schema from "./schema";
const PORT = process.env.PORT || 4000;
const typeDefs = `
type Query {
hello(name: String): String
}
`;
const PORT = process.env.PORT;
const resolvers = {
Query: {
hello: () => "hello",
},
};
const server = new GraphQLServer({ schema });
const server = new GraphQLServer({ typeDefs, resolvers });
server.express.use(morgan("dev"));
server.start(() => console.log(`server is running : http://localhost:${PORT}`));
......