I am using Apollo Server Express and Prisma ORM on my backend. I have created just one prisma instance and put it on graphql context and i am using this prisma instance on my resolvers.
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
const server = new ApolloServer({
...
...
playground: true,
context: ({req, res}) => ({ req, res, prisma }),
});
Just creating a instance. But when frontend starts work, prisma connection count is incrementing and after a while, PostgreSQL giving too many connections error, I verified this error from PgAdmin.