CRUD using NestJS, GraphQL and PostegreSQL
An application to study the Nestjs framework using Typescript.
GraphQL and PostgreSQL using TypeORM
@class-validator for validation
@nest/config for configuration using .env
# clone
$ git clone https://github.com/edmilson-torres/nestjs-graphql-postgres.git
# install dependencies
$ npm install
# use your credentials
$ mv .env.example .env
# development
$ npm run start
# watch mode
$ npm run start:dev
# start application and database
$ docker-compose up -d
http://localhost:3000/graphql
type UserEntity {
id: ID!
name: String!
email: String!
}
type Query {
users: [UserEntity!]!
user(id: String!): UserEntity!
}
type Mutation {
createUser(createUserInput: CreateUserInput!): UserEntity!
updateUser(updateUserInput: UpdateUserInput!): UserEntity!
removeUser(id: String!): String!
}
input CreateUserInput {
name: String!
email: String!
}
input UpdateUserInput {
name: String
email: String
id: String!
}