Add Pothos-generated User GraphQL schema and resolver

This commit adds the Pothos-generated User GraphQL schema and resolver. The schema is defined in the `src/graphql/graphql.schema.ts` file, and the resolver is defined in the `src/graphql/graphql.resolver.ts` file. The schema includes the `User` object type with fields for `id`, `name`, and `email`. The resolver includes a query field `users` that resolves to fetch all users from the Prisma database.
This commit is contained in:
2024-09-24 16:52:09 +07:00
parent 118e33884c
commit 4747fca4a4
12 changed files with 458 additions and 400 deletions

View File

@@ -13,6 +13,7 @@
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"prisma:generate": "npx prisma generate --schema=./epess-database/prisma/schema.prisma",
"prisma:migrate": "npx prisma migrate dev --schema=./epess-database/prisma/schema.prisma",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
@@ -27,11 +28,15 @@
"@nestjs/core": "^10.0.0",
"@nestjs/graphql": "^12.2.0",
"@nestjs/platform-express": "^10.0.0",
"@pothos/core": "^4.2.0",
"@pothos/plugin-add-graphql": "^4.1.0",
"@pothos/plugin-prisma": "^4.2.1",
"@prisma/client": "^5.19.1",
"apollo-server-express": "^3.13.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"graphql": "^16.9.0",
"prisma": "^5.19.1",
"reflect-metadata": "^0.2.0",
"rxjs": "^7.8.1"
},
@@ -45,7 +50,7 @@
"@types/supertest": "^6.0.0",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"eslint": "^8.42.0",
"eslint": "9.11.1",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.5.0",