import express, { Application, Request, Response, NextFunction } from "express"; import connectToDB, { getMongoClient } from "./utils/db"; import dotenv from "dotenv"; import {ApolloServer} from 'apollo-server-express' import {typeDefs} from './schemas/todo' import UserData, {UserDocument} from './datasources/userdatasource' import {UserResolver} from './resolvers/userResolver' import { Collection } from "mongodb"; import {buildSchema} from 'type-graphql' import {customAuthChecker} from './auth/authChecker' import { validateAcessToken } from "./middleware/checkToken"; import http from 'http' dotenv.config(); const app: Application = express(); const path:string = "/graphql"; const httpServer = http.createServer(app); // let userCollection:Collection<UserDocument>; (async () => { try { await connectToDB(); console.log("Database connected Welcome") } catch (error) { console.log(error) } })(); async function startServer(){ try { const schema = await buildSchema({ resolvers:[UserResolver], dateScalarMode: "isoDate", authChecker:customAuthChecker, }) const server = new ApolloServer({schema, context: ({req, res}) => { return {req, res} } }) app.use(validateAcessToken) await server.start() server.applyMiddleware({app, path}) await new Promise<void>(resolve => httpServer.listen({ port: 4000 }, resolve)); console.log(`🚀 Server ready at http://localhost:4000${server.graphqlPath}`); } catch (error:any) { console.log(error.message) } } startServer()Estoy escribiendo el código anterior para que mi apollo-server-express se inicie. Incluso recibo el mensaje de que mi servidor se ha iniciado en la terminal, pero cuando navego a la URL, el servidor no tiene idea de por qué este podría ser el caso. Sería útil si alguien pudiera ayudarme