//! This code was AUTOGENERATED using the Codama library.
pub mod amm_config_schema;
pub mod observation_state_schema;
pub mod operation_state_schema;
pub mod permissionless_farm_switch_schema;
pub mod personal_position_state_schema;
pub mod pool_state_schema;
pub mod protocol_position_state_schema;
pub mod support_mint_associated_schema;
pub mod tick_array_bitmap_extension_schema;
pub mod tick_array_state_schema;

use juniper::GraphQLObject;
pub use {
    amm_config_schema::*, observation_state_schema::*, operation_state_schema::*,
    permissionless_farm_switch_schema::*, personal_position_state_schema::*, pool_state_schema::*,
    protocol_position_state_schema::*, support_mint_associated_schema::*,
    tick_array_bitmap_extension_schema::*, tick_array_state_schema::*,
};

#[derive(Debug, Clone, GraphQLObject)]
#[graphql(name = "AccountMetadata")]
pub struct AccountMetadataGraphQL {
    pub pubkey: carbon_core::graphql::primitives::Pubkey,
    pub slot: Option<carbon_core::graphql::primitives::U64>,
}

impl From<carbon_core::postgres::metadata::AccountRowMetadata> for AccountMetadataGraphQL {
    fn from(metadata: carbon_core::postgres::metadata::AccountRowMetadata) -> Self {
        Self {
            pubkey: carbon_core::graphql::primitives::Pubkey(*metadata.pubkey),
            slot: metadata
                .slot
                .map(|v| carbon_core::graphql::primitives::U64(*v)),
        }
    }
}
