Add `DataLoader::loader` method. #441
This commit is contained in:
parent
4f47703118
commit
d37297bb06
|
@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
- Add `DataLoader::loader` method. [#441](https://github.com/async-graphql/async-graphql/issues/441)
|
||||
|
||||
## [2.5.13] - 2021-03-09
|
||||
|
||||
- Support generics in Subscription types. [#438](https://github.com/async-graphql/async-graphql/pull/438)
|
||||
|
|
|
@ -158,6 +158,12 @@ impl<T> DataLoader<T> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Get the loader.
|
||||
#[inline]
|
||||
pub fn loader(&self) -> &T {
|
||||
&self.loader
|
||||
}
|
||||
|
||||
/// Use this `DataLoader` load a data.
|
||||
pub async fn load_one<K>(&self, key: K) -> Result<Option<T::Value>, T::Error>
|
||||
where
|
||||
|
|
Loading…
Reference in New Issue