https://github.com/danimal141/learning-graphql-ts
This project builds a sample GraphQL application to learn "Learning GraphQL".
https://github.com/danimal141/learning-graphql-ts
create-react-app graphql graphql-code-generator reactjs type-graphql typeorm typescript
Last synced: 6 months ago
JSON representation
This project builds a sample GraphQL application to learn "Learning GraphQL".
- Host: GitHub
- URL: https://github.com/danimal141/learning-graphql-ts
- Owner: danimal141
- Created: 2020-11-08T06:37:48.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-30T13:55:29.000Z (about 5 years ago)
- Last Synced: 2025-08-19T10:50:51.089Z (7 months ago)
- Topics: create-react-app, graphql, graphql-code-generator, reactjs, type-graphql, typeorm, typescript
- Language: TypeScript
- Homepage:
- Size: 1.35 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# learning-graphql-ts
This project builds a sample GraphQL application to learn [this book](https://www.oreilly.com/library/view/learning-graphql/9781492030706/).
Different from [the original](https://github.com/MoonHighway/learning-graphql), this project uses TypeScript, MySQL, typeorm and type-graphql.
## How to develop
```
// setup
$ yarn
$ docker-compose up
// run all
// Server: you can open `http://localhost:4000/playground` and `server/schema.gql` would be automatically generated / updated
// Client: you can open `http://localhost:3000` and `client/graphql/generated.tsx` would be automatically generated / updated
$ yarn dev
```
## How to get a GitHub Token
- Create an OAuth app [here](https://github.com/settings/developers).
- Access: http://github.com/login/authorize?client_id=xxx&scope=user
- Then you would redirect to `http://localhost:4000?code=xxx`
- You can use the code like:
```
mutation {
githubAuth(code: "xxx") {
token
user {
githubLogin
name
avatar
}
}
}
```
- Then you can use the token like `{ "Authorization": }` on the http headers.