https://github.com/piyushchauhan2011/type-graphql-practice
Practice TypeGraphQL with Apollo, Express, Postgres, Redis, Typeorm and Typescript
https://github.com/piyushchauhan2011/type-graphql-practice
apollo redis typegraphql typeorm typescript
Last synced: about 2 months ago
JSON representation
Practice TypeGraphQL with Apollo, Express, Postgres, Redis, Typeorm and Typescript
- Host: GitHub
- URL: https://github.com/piyushchauhan2011/type-graphql-practice
- Owner: piyushchauhan2011
- License: mit
- Archived: true
- Created: 2020-06-07T15:39:13.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-21T16:15:30.000Z (7 months ago)
- Last Synced: 2025-02-13T03:43:12.246Z (3 months ago)
- Topics: apollo, redis, typegraphql, typeorm, typescript
- Language: TypeScript
- Homepage:
- Size: 596 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# type-graphql-practice
TypeGraphQL with Apollo, Express, Postgres, Redis, Typeorm and Typescript```sh
cp .env.example .env # modify variables
cp ormconfig.example.json ormconfig.json # modify variables
docker-compose up
# connect to docker database container
create database ; # ormconfig.jsonyarn start
```
Visit `http://localhost:4000/graphql`
### Caveats
1. Make sure in graphql-playground settings, following is set: `"request.credentials": "include"`
### Available Query and Mutations
*check schema docs*
```graphql
mutation {
register(data:{
firstName:"",
...
}) {
id
firstName
...
}
}
``````graphql
mutation {
login(email:"", password:"") {
id
firstName
...
}
}
``````graphql
query {
me {
id
firstName
lastName
name
}
}
```### Reference
Ben Awad TypeGraphQL series [playlist](https://www.youtube.com/playlist?list=PLN3n1USn4xlma1bBu3Tloe4NyYn9Ko8Gs)
### Testing Setup
```sh
# locate test-utils
cp ormconfig.test.example.json ormconfig.test.json # copy and modify variables
yarn test
yarn test:watch # watch mode - lacks resetting database
```