title: NodeJS Pass model name to DataLoader
body: <p>I have the following functions to get the data by DataLoader</p>
  <pre><code>const Users = require('../models/users');
  
  const getUsers = async (userIds) =&gt; {
    return await getModelItems(userIds, Users);
  };
  
  const getModelItems = async (itemIds, model) =&gt; {
    try {
      return await model.find({ _id: { $in: itemIds } });
    } catch (e) {
      throw new Error(e.message);
    }
  };
  </code></pre>
  <p>and the DataLoader</p>
  <pre><code>
  const getModelsLoader = new DataLoader((itemIds, model)=&gt;getModelItems(itemIds, model) );
  </code></pre>
  <p>I am passing the Users parameter extra to get the model, but DataLoader did not accept any extra parameter to be passed.</p>
  <p>Please let me know how can I have a generic getModelItems and use DataLoader with it.</p>