Alternative to Apollo Server 4?
This is not really a Prisma question. But I gather many of you also use Prisma for your GraphQL needs, so I would like to know if someone could give me a tip on alternatives to using Apollo Server? It seems to have performance problems (or I am doing something wrong) so I would like to try if some other system might give better performance.
8 Replies
You chose to debug with a human. They'll tinker with your query soon. If you get curious meanwhile, hop into
#ask-ai
for a quick spin!Hi @Josef Henryson
If you are using Postgres as the database, you might want to take a look at PostGraphile https://www.graphile.org/postgraphile/
Graphile | Powerful, Extensible and Performant GraphQL APIs Rapidly
Utilities to build powerful, performant and extensible GraphQL APIs rapidly
Thank you. Unfortunately I use MySQL 😦
I found some info on fastify + mercurius. Does that sound like an option?
You could give it a shot but i'm curious to know what issues you are experiencing with Apollo server 4
I am not sure it is Apollo. But I have timed my Prisma responses. And for example I get a response from Prisma in about 2s. But in the we browser it takes 6s to return. And the only thing I can see between is express and apollo server. Some info I found googling said that Apollo makes a lot of type checking etc that may take a long time.
Also http createServer
APollo does a lot of typechecking and validation, which could add to the overhead you're seeing.
Any ideas on how to optimize that?
But postgraphile does not use Prisma? I reckon that Prisma should hide which DB I run, right?
You can look at this section on performance on Apollo server docs for different methods to optimize it.
But postgraphile does not use Prisma?Yes it doesn't.
I reckon that Prisma should hide which DB I run, right?Yes, you're right. Prisma aims to hide the specific database you're using.