Skip to content

Api #16

Open
Open

Description

@7ean
No description provided.

Activity

  1. mathewTheGreat commented on Mar 28, 2022

    @mathewTheGreat

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

  2. Raikyo777 commented on Apr 6, 2022

    @Raikyo777

    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}
    )
    );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions