fn apply_order<'a>(
        mut query: BoxedQuery<'a, Self, DB, Ctx>,
        select: &LookAheadSelection<'_, WundergraphScalarValue>,
    ) -> Result<BoxedQuery<'a, Self, DB, Ctx>>
    where
        Self::Table: 'static,
    {
        use juniper::LookAheadMethods;
        match select.argument("order").map(LookAheadArgument::value) {
            Some(LookAheadValue::List(order)) => {
                let order_stmts = <Self::Columns as BuildOrder<Self::Table, DB>>::build_order(
                    order,
                    |local_index| {
                        Self::FieldList::map_table_field(local_index, |global| {
                            Self::FIELD_NAMES[global]
                        })
                        .expect("Field is there")
                    },
                )?;
                for s in order_stmts {
                    query = query.then_order_by(s);
                }
                Ok(query)
            }
            Some(_) => Err(WundergraphError::CouldNotBuildFilterArgument),
            None => Ok(query),
        }
    }
/// Construct a order clause from a given graphql request
Construct a order clause from a given graphql request
Construct a order clause from a given graphql request
fn apply_order<'a>(
        mut query: BoxedQuery<'a, Self, DB, Ctx>,
        select: &LookAheadSelection<'_, WundergraphScalarValue>,
    ) -> Result<BoxedQuery<'a, Self, DB, Ctx>>
    where
        Self::Table: 'static,
    {
        use juniper::LookAheadMethods;
        match select.argument("order").map(LookAheadArgument::value) {
            Some(LookAheadValue::List(order)) => {
                let order_stmts = <Self::Columns as BuildOrder<Self::Table, DB>>::build_order(
                    order,
                    |local_index| {
                        Self::FieldList::map_table_field(local_index, |global| {
                            Self::FIELD_NAMES[global]
                        })
                        .expect("Field is there")
                    },
                )?;
                for s in order_stmts {
                    query = query.then_order_by(s);
                }
                Ok(query)
            }
            Some(_) => Err(WundergraphError::CouldNotBuildFilterArgument),
            None => Ok(query),
        }
    }
fn apply_order < ' a > ( mut query : BoxedQuery < ' a , Self , DB , Ctx > , select : & LookAheadSelection < ' _ , WundergraphScalarValue > , ) -> Result < BoxedQuery < ' a , Self , DB , Ctx > > where Self :: Table : ' static , { use juniper :: LookAheadMethods ; match select . argument ( " " ) . map ( LookAheadArgument :: value ) { Some ( LookAheadValue :: List ( order ) ) => { let order_stmts = < Self :: Columns as BuildOrder < Self :: Table , DB > > :: build_order ( order , | local_index | { Self :: FieldList :: map_table_field ( local_index , | global | { Self :: FIELD_NAMES [ global ] } ) . expect ( " " ) } , ) ? ; for s in order_stmts { query = query . then_order_by ( s ) ; } Ok ( query ) } Some ( _ ) => Err ( WundergraphError :: CouldNotBuildFilterArgument ) , None => Ok ( query ) , } }
Construct a order clause from a given graphql request
Construct a order clause from a given graphql request
query
BoxedQuery<'a, Self, DB, Ctx>
select
&LookAheadSelection<'_, WundergraphScalarValue>