Dataloader adonis example
Simple example of using dataloader with adonis.js + apollo graphql
Files/lines of interest:
Description | File |
---|---|
Declaring loaders | app/Data/Loaders.js |
Instantiating loaders per request | start/routes.js:25 |
Using loader in resolver | app/Data/GraphQL/resolvers.js:12 |
Setup
git clone
this repocd
into folderyarn
cp .env.example .env
and fill out the missing stuffadonis migration:run
adonis seed
adonis serve --dev
- visit http://localhost:3333 to try it out