//! This code was AUTOGENERATED using the Codama library.
use {
    crate::types::graphql::DexGraphQL, carbon_core::graphql::primitives::U8, juniper::GraphQLObject,
};

#[derive(Debug, Clone, GraphQLObject)]
#[graphql(name = "Route")]
pub struct RouteGraphQL {
    pub dexes: Vec<DexGraphQL>,
    pub weights: Vec<U8>,
}

impl From<crate::types::Route> for RouteGraphQL {
    fn from(original: crate::types::Route) -> Self {
        Self {
            dexes: original.dexes.into_iter().map(|item| item.into()).collect(),
            weights: original
                .weights
                .into_iter()
                .map(carbon_core::graphql::primitives::U8)
                .collect(),
        }
    }
}
