Add ErrorExtensionValues::get method. #855

This commit is contained in:
Sunli 2022-03-14 09:48:27 +08:00
parent 665f464448
commit 2653dddc5b

View File

@ -24,6 +24,11 @@ impl ErrorExtensionValues {
pub fn unset(&mut self, name: impl AsRef<str>) {
self.0.remove(name.as_ref());
}
/// Get an extension value.
pub fn get(&self, name: impl AsRef<str>) -> Option<&Value> {
self.0.get(name.as_ref())
}
}
/// An error in a GraphQL server.