Skip to content

Use Prisma instead of mongoose (+ postgresql instead of mongodb) #13

@fabien-roy

Description

@fabien-roy

I'd like to try out switch mongoose for Prisma, as it seems more suitable for GraphQL and honestly kinda dope.

After testing a few different librairies, here are my thoughts:

Stack tested

I tried simply using express + apollo server and a prisma ORM. DB in postgresql is quite easy with prisma, you basically just change the db URL. See references for a docker config.

Now I need to either pick and implement a backend using prisma, try something else or stick with mongoose + MongoDB.

Apollo Server (SDL-first)

Pros

  • It will work

Cons

  • You get one bigass prisma.schema to define types, queries and mutations (didn't find a way not to)
  • Not code-first, which is more what I'm looking for

Nexus — Code-First

This one seems the most promising.

Pros

  • Only functions and types

Cons

  • Relies heavily on code generation

TypeGraphQL — Code-First

This will be plan B.

Pros

  • Looks stable and easy to use
  • As good guides with apollo typegraphql + prisma

Cons

  • Uses classes for its type definitions (I'd like to stick with FP, at least within my codebase)

References

Metadata

Metadata

Assignees

Labels

improvementUpgrade to the current codebase

Type

No type

Projects

Status

In Progress

Relationships

None yet

Development

No branches or pull requests

Issue actions