use {carbon_core::graphql::primitives::Pubkey, juniper::GraphQLObject};
#[derive(Debug, Clone, GraphQLObject)]
#[graphql(name = "OpenOrdersMap")]
pub struct OpenOrdersMapGraphQL {
pub account_metadata: crate::accounts::graphql::AccountMetadataGraphQL,
pub user_key: Pubkey,
}
impl TryFrom<crate::accounts::postgres::OpenOrdersMapRow> for OpenOrdersMapGraphQL {
type Error = carbon_core::error::Error;
fn try_from(row: crate::accounts::postgres::OpenOrdersMapRow) -> Result<Self, Self::Error> {
Ok(Self {
account_metadata: row.account_metadata.into(),
user_key: carbon_core::graphql::primitives::Pubkey(row.user_key.0),
})
}
}