I have a problem with dataloader-sequelize
Example: I have two Model User and File, Model File BelongTo User (User 1-n File)
When I use Graphql to findAll Model File and get field user then Sequelize executes n times findOne User to map with File, but I want to use dataloader to findAll once and map data for each file to up performance.
Below is my code, please help me.
import { resolver } from "graphql-sequelize";
File = {
user = resolver(File.associations.user)
}
I found a solution at here, actually, I have seen it before, but due to the wrong integration, it led to the above problem, sorry for opening the topic, Please allow me to close the topic here, thank you helped
I have a problem with
dataloader-sequelize
Example: I have two Model User and File, Model File BelongTo User (User 1-n File) When I use Graphql to findAll Model File and get field user then Sequelize executesn
times findOne User to map with File, but I want to usedataloader
to findAll once and map data for each file to up performance. Below is my code, please help me.