Apollo server 4 with or without express : standaloneServer vs expressMiddleware

Apollo server 4 with or without express : standaloneServer vs expressMiddleware


0

I am new to graphql and I would like to build my first API, using mongoose and MongoDB.
So far, I’ve built some API’s using Express, mongoose and MongoDB (in MERN apps).

I’d like to use Apollo/server , and I realise there are two options to build a server, using startStandaloneServer , therefore not using express (i mean, not installing it as dependency), and using expressMiddleware , building what it seems like a more traditional express app (as I understand it).

I’ve managed to build two severs, one with each, connect them to my DB, and do some basic queries (no mutations for now), so far so good.

But before continuing and start building more complex queries, mutations, authorization strategies with JWT tokens, etc.. , I’d like to ask what are the differences between the two "ways" of using ApolloServer , pros and cons or things I should take into consideration.


Load 6 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *