Skip to content
  • 0 Votes
    3 Posts
    625 Views
    S

    @julian thanks for your reply.

    The reason why I inject Apollo as a middleware is because of the server integrate document on Apollo website shows that we can use the apollo-server-express package to integrate GraphQL with existing Express server by adding following code:

    server.applyMiddleware({ app }); // app is from an existing express app

    Does router will be the express app to be passed to plugins? Because I solved this problem by passing router into .applyMiddleware() method as following changes:

    const router = params.router; apolloServer.applyMiddleware({ app: router, path: '/api/mygraphql', });

    Now, the GraphQL works fine on my NodeBB server ! Hope this can help someone who run into the same problem like me. Although it looks like GraphQL is not popular in NodeBB community 🤔.