RESTDataSource with TypeGraphQL
Simple example of using Apollo Server's REST Data Source with TypeGraphQL.
Running
- Ensure Node.js 14 or later is installed.
npm install
in project root directorynpm start
to start the server- Access Playground with browser, at
http://localhost:4000/
by default - Experiment with RESTDataSource caching by running the following query repeatedly in Playground and checking the server log for execution times.
query Todos {
todos {
id
userId
title
completed
}
}
- Kill the server (e.g. with
CTRL-C
) and start it again withnpm start
to reset the cache
Contributing
If you've found a better way of handling this, please file an issue or open a PR.