code: def get_dataloader_resolver(
      cls: t.Type[T],
      collection: str,
      key: str,
      filters: t.List[dict],
      projections: t.Optional[t.Dict] = None,
  ) -> t.Callable[
      [str, Info],
      t.Coroutine[t.Any, t.Any, t.Optional[T]],
  ]:
      dataloaders[cls] = DataLoaderConfig(
          collection=collection,
          key=key,
          filters=filters,
          projections=projections,
      )
  
      async def resolver(
          name: str, info: Info
      ) -> t.Awaitable[t.Optional[T]]:
          return await info.context.dataloaders[cls].load(name)
  
      resolver.__annotations__[key] = resolver.__annotations__.pop(
          "name"
      )
      return resolver
  
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 2 for calling a global function with example usage: get_dataloader_resolver(cls, collection, key, filters, projections) and returns: resolver, unknown