Skip to main content

GraphqlResolver

Trait GraphqlResolver 

Source
pub trait GraphqlResolver:
    Send
    + Sync
    + 'static {
    // Required method
    fn resolve(&self, args: &GraphqlFieldArgs) -> Result<Value, String>;
}
Expand description

Resolver trait for a single top-level GraphQL query or mutation root field.

Required Methods§

Source

fn resolve(&self, args: &GraphqlFieldArgs) -> Result<Value, String>

Resolves a GraphQL root field given its parsed selection arguments and variables.

§Arguments
  • &GraphqlFieldArgs - Parsed field arguments and variable bindings.
§Returns
  • Result<Value, String> - Resolved JSON value or GraphQL execution error message.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§