Skip to content

Instantly share code, notes, and snippets.

@motephyr
Last active April 23, 2019 08:32
Show Gist options
  • Save motephyr/c5ca650e1d19dfe8fddb5eb4a871efe7 to your computer and use it in GitHub Desktop.
Save motephyr/c5ca650e1d19dfe8fddb5eb4a871efe7 to your computer and use it in GitHub Desktop.
const createLoader = require('../Helpers/loaders/createLoader')
/**
* Define your loaders here.
* Each key should be a valid
* instance of DataLoader.
*/
const loaders = () => ({
user_group: createLoader('App/Models/UserGroup'),
user_personal_data: createLoader('App/Models/PersonalData', 'user_id'),
user_posts: createLoader('App/Models/Post', 'user_id', 'many')
})
module.exports = loaders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment