code: def get_dataloader(
      cls: t.Type[T],
      config: DataLoaderConfig,
      db: mtr.AsyncIOMotorDatabase,
  ) -> DataLoader[str, t.Optional[T]]:
      async def load_items(
          keys: t.List[str],
      ) -> t.List[t.Optional[T]]:
          results = {}
          if config.key == "id":
              config.key = "_id"
          find_params = [
              {"$and": [{config.key: {"$in": keys}}] + config.filters}
          ]
          if config.projections:
              find_params.append(config.projections)
  
          async for doc in db[config.collection].find(*find_params):
              results[doc[config.key]] = doc
  
          def build(doc: dict = None) -> t.Optional[T]:
              if not doc:
                  return None
  
              doc = cls.modifier(doc)
              return from_dict(cls, doc)
  
          return [build(results.get(k, None)) for k in keys]
  
      return DataLoader(load_fn=load_items)
  
file_path: fiftyone/fiftyone/server/dataloader.py
imports: from dataclasses import dataclass
  import typing
  import motor.motor_asyncio
  from strawberry.dataloader import DataLoader
  from fiftyone.server.data import Info, T
  from fiftyone.server.utils import from_dict
label_desc: Use image node_id 1 for calling a global function with example usage: get_dataloader(cls, config, db) and returns: DataLoader, unknown, from_dict, None