pub trait DbResolver: Send + Sync {
// Required method
fn resolve_query(
&self,
ctx: &ResolverContext,
) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send>>;
// Provided method
fn resolve_mutation(
&self,
ctx: &ResolverContext,
) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send>> { ... }
}Expand description
Required Methods§
Provided Methods§
Sourcefn resolve_mutation(
&self,
ctx: &ResolverContext,
) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send>>
fn resolve_mutation( &self, ctx: &ResolverContext, ) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send>>
解析 Mutation root field
默认实现返回错误,调用方按需覆盖。
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".