API Type Generators
We have a good experience with following solutions for generating types for APIs (requests, responses, entities, errors, etc.)
| API Type | Suggested library |
|---|---|
| GraphQL | @graphql-codegen/cli |
| REST | @openapi-codegen/cli or orval |
Never generate hooks for Tanstack Query. That will be against the point mentioned above why Apollo client is discouraged. When we generate hooks, we lose the ability of defining our own query keys structure and we basically lose the ownership of the cache. We always want to keep control over our cache and queries/mutations definition.