Struct async_graphql::extensions::ExtensionContext
source · pub struct ExtensionContext<'a> { /* private fields */ }
Expand description
Context for extension
Implementations§
source§impl<'a> ExtensionContext<'a>
impl<'a> ExtensionContext<'a>
sourcepub fn stringify_execute_doc(
&self,
doc: &ExecutableDocument,
variables: &Variables
) -> String
pub fn stringify_execute_doc(
&self,
doc: &ExecutableDocument,
variables: &Variables
) -> String
Convert the specified ExecutableDocument into a query string.
Usually used for log extension, it can hide secret arguments.
sourcepub fn data<D: Any + Send + Sync>(&self) -> Result<&'a D>
pub fn data<D: Any + Send + Sync>(&self) -> Result<&'a D>
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.