Trait async_graphql::context::DataContext
source · [−]pub trait DataContext<'a> {
fn data<D: Any + Send + Sync>(&self) -> Result<&'a D>;
fn data_unchecked<D: Any + Send + Sync>(&self) -> &'a D;
fn data_opt<D: Any + Send + Sync>(&self) -> Option<&'a D>;
}Expand description
Data related functions of the context.
Required Methods
Gets the global data defined in the Context or Schema.
If both Schema and Query have the same data type, the data in the
Query is obtained.
Errors
Returns a Error if the specified type data does not exist.
Gets the global data defined in the Context or Schema.
Panics
It will panic if the specified data type does not exist.