saleor-apps-rs/sitemap-generator/src/queries/get_all_collections.rs

53 lines
1.4 KiB
Rust
Raw Normal View History

#[cynic::schema("saleor")]
mod schema {}
2024-07-03 14:07:04 +00:00
#[derive(cynic::QueryVariables, Debug, Clone)]
pub struct GetCollectionsNextVariables<'a> {
pub after: Option<&'a str>,
}
2024-07-03 14:07:04 +00:00
#[derive(cynic::QueryFragment, Debug, Clone)]
#[cynic(graphql_type = "Query", variables = "GetCollectionsNextVariables")]
pub struct GetCollectionsNext {
#[arguments(first: 50, after: $after)]
pub collections: Option<CollectionCountableConnection>,
}
2024-07-03 14:07:04 +00:00
#[derive(cynic::QueryFragment, Debug, Clone)]
#[cynic(graphql_type = "Query")]
pub struct GetCollectionsInitial {
#[arguments(first: 50)]
pub collections: Option<CollectionCountableConnection2>,
}
2024-07-03 14:07:04 +00:00
#[derive(cynic::QueryFragment, Debug, Clone)]
#[cynic(graphql_type = "CollectionCountableConnection")]
pub struct CollectionCountableConnection2 {
pub total_count: Option<i32>,
pub page_info: PageInfo,
pub edges: Vec<CollectionCountableEdge>,
}
2024-07-03 14:07:04 +00:00
#[derive(cynic::QueryFragment, Debug, Clone)]
pub struct CollectionCountableConnection {
pub page_info: PageInfo,
pub edges: Vec<CollectionCountableEdge>,
}
2024-07-03 14:07:04 +00:00
#[derive(cynic::QueryFragment, Debug, Clone)]
pub struct CollectionCountableEdge {
pub node: Collection,
}
2024-07-03 14:07:04 +00:00
#[derive(cynic::QueryFragment, Debug, Clone)]
pub struct PageInfo {
pub has_next_page: bool,
pub end_cursor: Option<String>,
}
#[derive(cynic::QueryFragment, Debug, Clone)]
pub struct Collection {
pub id: cynic::Id,
pub slug: String,
}