api icon indicating copy to clipboard operation
api copied to clipboard

Api

Open 7ean opened this issue 4 years ago • 2 comments

7ean avatar Nov 26 '21 04:11 7ean

apollo server object is an asynchronous function, the preceding line proceeds to access the server object before it could be initialized.

mathewTheGreat avatar Mar 28 '22 13:03 mathewTheGreat

I think, It looks like this, to work as asynchronous function:

async function startServer() { server = new ApolloServer({ typeDefs, resolvers }); await server.start(); server.applyMiddleware({ app, path: '/api' }); } startServer();

app.listen({ port }, () => console.log( GraphQL Server running at htts://localhost: ${port} ${server.graphqlPath} ) );

Raikyo777 avatar Apr 06 '22 18:04 Raikyo777