graphql-platform
graphql-platform copied to clipboard
Document UseDataLoader()
Is your feature request related to a problem?
UseDataLoader
was added in https://github.com/ChilliCream/hotchocolate/issues/2505 but there doesn't seem to be any documentation around it.
The solution you'd like
Document it maybe here? https://chillicream.com/docs/hotchocolate/fetching-data/dataloader
Product
Hot Chocolate
Do you want to do a pull request?
Hi, I'm new to HotChocolate, that's why I'm asking about this documentation :slightly_smiling_face:
I am curious about the DataLoader middleware too. The graphql-workshop repository mentions (just above this) in session 6 that using a resolver alongside a dataloader causes paging to happen in memory:
There is one caveat in our implementation with the TrackType. Since, we are using a DataLoader within our resolver and first fetch the list of IDs we essentially will always fetch everything and chop in memory. In an actual project this can be split into two actions by moving the DataLoader part into a middleware and first page on the id queryable. Also one could implement a special IPagingHandler that uses the DataLoader and applies paging logic.
Would UseDataLoader()
middleware resolve this inefficiency?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I believe this is still relevant. I have been unable to find documentation on UseDataLoader
, which seems like a key component in stacking middlwares for custom resolvers.
@michaelstaib, can you shed some light on how this method should be used?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.