[][src]Trait juniper_eager_loading::EagerLoadAllChildren

pub trait EagerLoadAllChildren where
    Self: GraphqlNodeForModel
{ fn eager_load_all_children_for_each(
        nodes: &mut [Self],
        models: &[Self::Model],
        db: &Self::Connection,
        trail: &QueryTrail<Self, Walked>
    ) -> Result<(), Self::Error>; fn eager_load_all_children(
        node: Self,
        models: &[Self::Model],
        db: &Self::Connection,
        trail: &QueryTrail<Self, Walked>
    ) -> Result<Self, Self::Error> { ... } }

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

fn eager_load_all_children_for_each(
    nodes: &mut [Self],
    models: &[Self::Model],
    db: &Self::Connection,
    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.

Loading content...

Provided methods

fn eager_load_all_children(
    node: Self,
    models: &[Self::Model],
    db: &Self::Connection,
    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.

Loading content...

Implementors

Loading content...