Ask questions or answer it wrong.
The purpose of this project is to show some knowldge I have gained with GraphQL + Express + Prisma. There is also an HTTP REST API in the backend to address the Question domain, a simple CRUD, from which I have built the GraphQL service.
- Node.js 13+
- Yarn
- Docker
Download postgres image
docker pull postgres:latest
Setup postgres container with name wao-postgres
docker run --name wao-postgres -p 5432:5432 -e POSTGRES_PASSWORD=itswrong -d postgres
Enter the container
docker exec -it wao-postgres bash
Enter the database server
psql -U postgres
Add UUID extension
create extension if not exists "uuid-ossp";
Check installation
select uuid_generate_v1();
yarn install
Generate the migration script after modeling
yarn prisma migrate dev --name init --preview-feature
Build the Prisma client every time after change the scheme
yarn prisma generate
yarn start
yarn install
yarn start
- Postgres Docker Hub https://hub.docker.com/_/postgres/
- Intro to the TSConfig Reference https://www.typescriptlang.org/tsconfig
- ts-node https://github.com/TypeStrong/ts-node
- Prisma Quickstart https://www.prisma.io/docs/getting-started/quickstart-typescript
- Prisma schema API reference https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#model-field-scalar-types
- Prisma REST Express sample https://github.com/prisma/prisma-examples/tree/latest/typescript/rest-express
- How to Extend Express when using Typescript https://christiangiacomi.com/posts/extend-express-typescript-custom-types/
- GraphQL Rules https://graphql-rules.com/
- GraphQL Rules - 6. Mutation rules https://graphql-rules.com/rules/mutation
- how to write a mutation schema which returns null? ardatan/graphql-tools#277
- Solution with a custom scalar [how to write a mutation schema which returns null?] https://stackoverflow.com/a/61714123
- Can't import the named export 'Component' from non EcmaScript module (only default export is available) formatjs/formatjs#1395
- Can't import the named export 'diff' from non EcmaScript module (only default export is available) uber/nebula.gl#285
- Wonka — Iterable and observable library https://wonka.kitten.sh/