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