This folder consists of simple examples showing how to use different TypeGraphQL
features and how well it integrates with 3rd party libraries.
To run an example, simply go to the subdirectory (e.g. cd ./simple-usage
), and then start the server (npx ts-node ./index.ts
).
Each subdirectory contains a examples.graphql
file with predefined GraphQL queries/mutations/subscriptions that you can use in Apollo Studio (http://localhost:4000) and play with them by modifying their shape and data.
Note: Be aware that the examples on master branch are designed to work with latest codebase that might not be released yet. So if you are looking for examples that are compatible with the version you use, just browse the files by the git tag, e.g.
tree/v0.16.0
for0.16.0
release.
- Enums and unions
- Subscriptions (simple)
- Subscriptions (using Redis) **
- Interfaces
- Extensions (metadata)
- Dependency injection (IoC container)
- Authorization
- Validation
- Types inheritance
- Resolvers inheritance
- Generic types
- Mixin classes
- Middlewares and custom decorators
- Query complexity
- TypeORM (manual, synchronous) *
- TypeORM (automatic, lazy relations) *
- MikroORM *
- Typegoose *
- Apollo Federation
- Apollo Federation 2
- Apollo Cache Control
- GraphQL Scalars
- TSyringe
* Note that we need to provide the environment variable DATABASE_URL
with connection parameters to your local database
** Note that we need to provide the environment variable REDIS_URL
with connection parameters to your local Redis instance