Template starter project to develop TypeScript
backend with GraphQL
strongly typed models
NodeJS
, MongoDB
, GraphQL
, Apollo
and Express
.
DATABASE_URL=mongodb://localhost:27017/typegoose PORT=2020 PASSWORD_SALT=xx
- clone the repo
- npm i
- npm run dev
- go to localhost:2020/graphql
# getUser
query{ getUser(id: "5ce1b0dc0b3d81401b0971a1") {
username
id
role
}}
# createUser
mutation {
createUser( name:"adyx", password:"123456") {
id
username
}
}
# login
mutation{ login(req: { username: "adyx", password: "123456"} ) {
jwt
}}
Inital fork of this project came from https://github.com/Veetaha/typegraphql-typegoose-express-react-template