Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/typescript-cheatsheets/graphql
(seeking maintainers) Resources for End-to-End typing with GraphQL and TypeScript
https://github.com/typescript-cheatsheets/graphql
Last synced: about 1 month ago
JSON representation
(seeking maintainers) Resources for End-to-End typing with GraphQL and TypeScript
- Host: GitHub
- URL: https://github.com/typescript-cheatsheets/graphql
- Owner: typescript-cheatsheets
- License: mit
- Created: 2019-05-02T01:27:06.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-28T20:23:41.000Z (about 4 years ago)
- Last Synced: 2024-10-31T10:36:22.934Z (about 1 month ago)
- Homepage:
- Size: 7.81 KB
- Stars: 68
- Watchers: 6
- Forks: 9
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- stars - graphql - to-End typing with GraphQL and TypeScript | typescript-cheatsheets | 68 | (Others)
- stars - graphql - to-End typing with GraphQL and TypeScript | typescript-cheatsheets | 68 | (Others)
README
# graphql-typescript-cheatsheet
Resources for End-to-End typing with GraphQL and TypeScript
## Notes
There is something informally called the "keying-in" operator that is very handy for accessing generated TypeScript types from your GraphQL schema.
```ts
// generated typescript response from schema
type APIResponse = {
user: {
userId: string
friendList: {
count: number
}
}
}
you need to the type of APIResponse.user.friendList but don't know it upfront
type FriendList = APIResponse['user']['friendList']
```It looks kinda obvious but can be really handy.
## Libraries
- typegraphql: https://github.com/19majkel94/type-graphql/ Create GraphQL schema and resolvers with TypeScript, using classes and decorators! [now at 1.0](https://dev.to/michallytek/announcing-typegraphql-1-0-1d7h)
- `graphql-code-generator`: https://github.com/dotansimha/graphql-code-generator ([Usage example](https://formidable.com/blog/2019/strong-typing/))
- graphql nexus
- smalller libs
- https://github.com/capaj/decapi
- https://github.com/prismake/typegql## Podcasts
- Natalie Qabazard on the [Real Talk JS Podcast on GraphQL + Typescript](https://realtalkjavascript.simplecast.fm/42ba5d10) adoption at Zillow