# How to Use State in DataLoader for Context-Aware Fetching

> Make your DataLoaders stateful to pass tenant IDs or authorization context and fetch data in the right scope without losing performance.

Canonical source: https://chillicream.com/videos/2025-05-01-stateful-dataloader

Episode 08

![](https://chillicream.com/_optimized/images/remote/2bb0dd6e1b9347a1d3732300ea752f39f1ac4f1f76587433ca3a407245b31786.jpg)

[Michael Staib](https://chillicream.com/authors/michael-staib)May 1, 2025

[Example source](https://github.com/ChilliCream/platform-examples/tree/main/examples/HotChocolate/StatefulDataLoader) [Watch on YouTube](https://www.youtube.com/watch?v=4Mw2A548OGM)

Hi everyone!

In this episode, we’re going to explore how to make your DataLoaders stateful, so you can pass in things like tenant IDs or authorization context to fetch data in the correct scope without compromising performance.

So buckle up, and let’s jump in! 🚀

Hot Chocolate version used in this video: [15.1.4](https://www.nuget.org/packages/HotChocolate/15.1.4)

- DataLoader
- Entity Framework
- Hot Chocolate
