powerhouse-inc / switchboard

Open-source API over the document model made to be developer- and analyst-friendly
https://switchboard-boilerplate.vercel.app
GNU Affero General Public License v3.0
3 stars 3 forks source link

Create graphql setup #8

Closed BracketJohn closed 1 year ago

BracketJohn commented 1 year ago

Goal

Setup prisma ORM + a graphql API provider.

Context

Out of #3 and #2 we want to setup prisma and a graphql api provider (such as apollo, as used here: https://github.com/makerdao-ses/ecosystem-api/blob/main/src/index.ts) to get the project started.

Tasks

valiafetisov commented 1 year ago

TypeGraphQL also supports prisma), so would be great to see it in the research comparison

KirillDogadin-std commented 1 year ago
  1. Nexus
    • uses:
    • downsides:
      • no previous xp of the team
    • upsides:
      • some similarity with how zod defines schemas link
      • derives graphql return structure from prisma types.
  2. NestJs
    • uses:
    • downsides:
      • nit: looks like too much space is taken up by boilerplate e.g.
      • nit: decorators is an experimental feature as here
      • no previous xp of the team
      • within this example: the setup does not derive graphql return structure from prisma code
    • upsides:
      • can infer routes from file location and name
      • single dependency
  3. Hapi
    • modification of (1) with hapi
  4. fastify
    • schema: as in (1), hence pros and cons are derived from there
  5. type graphql
    • as of documentation is compatible with nest-js
    • upsides:
      • automatically generated graphql types
    • downsides:
      • docs only feature nestjs api in combination with the package.

Conclusion:

Since there's a discussion to take a place about switching to TypeORM, i will leave the current state of investigation.

If we remain with Prisma, the next step would be to play around with the api setups:

How does ... work?: