Trait EagerLoadAllChildren

Source
pub trait EagerLoadAllChildren
where Self: GraphqlNodeForModel,
{ // Required method fn eager_load_all_children_for_each( nodes: &mut [Self], models: &[Self::Model], ctx: &Self::Context, trail: &QueryTrail<'_, Self, Walked>, ) -> Result<(), Self::Error>; // Provided method fn eager_load_all_children( node: Self, models: &[Self::Model], ctx: &Self::Context, trail: &QueryTrail<'_, Self, Walked>, ) -> Result<Self, Self::Error> { ... } }
Expand description

The main entry point trait for doing eager loading.

You shouldn’t need to implement this trait yourself even when customizing eager loading.

Required Methods§

Source

fn eager_load_all_children_for_each( nodes: &mut [Self], models: &[Self::Model], ctx: &Self::Context, trail: &QueryTrail<'_, Self, Walked>, ) -> Result<(), Self::Error>

For each field in your GraphQL type that implements EagerLoadChildrenOfType call eager_load_children to do eager loading of that field.

This is the function you should call for eager loading values for a GraphQL field that returns a list.

Provided Methods§

Source

fn eager_load_all_children( node: Self, models: &[Self::Model], ctx: &Self::Context, trail: &QueryTrail<'_, Self, Walked>, ) -> Result<Self, Self::Error>

Perform eager loading for a single GraphQL value.

This is the function you should call for eager loading associations of a single value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§