-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basically whole app in one commit lol
- Loading branch information
djkato
committed
Jul 14, 2024
1 parent
9ef2313
commit 5fa0a3f
Showing
20 changed files
with
1,543 additions
and
640 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
#[cynic::schema("saleor")] | ||
mod schema {} | ||
/* | ||
query getProductsInitial($id: ID!, $channel: String!) { | ||
category(id: $id) { | ||
slug | ||
id | ||
updatedAt | ||
products(first: 50, channel: $channel) { | ||
pageInfo { | ||
hasNextPage | ||
endCursor | ||
} | ||
edges { | ||
node { | ||
id | ||
slug | ||
updatedAt | ||
category { | ||
id | ||
slug | ||
} | ||
} | ||
} | ||
totalCount | ||
} | ||
} | ||
} | ||
query getProductsNext($after: String!, $channel: String!) { | ||
products(first: 50, after: $after, channel: $channel) { | ||
pageInfo { | ||
hasNextPage | ||
endCursor | ||
} | ||
edges { | ||
node { | ||
id | ||
slug | ||
updatedAt | ||
category { | ||
id | ||
slug | ||
} | ||
} | ||
} | ||
} | ||
} | ||
*/ | ||
|
||
#[derive(cynic::QueryVariables, Debug)] | ||
pub struct GetProductsInitialVariables<'a> { | ||
pub channel: &'a str, | ||
} | ||
|
||
#[derive(cynic::QueryVariables, Debug)] | ||
pub struct GetProductsNextVariables<'a> { | ||
pub after: &'a str, | ||
pub channel: &'a str, | ||
} | ||
|
||
#[derive(cynic::QueryFragment, Debug)] | ||
#[cynic(graphql_type = "Query", variables = "GetProductsInitialVariables")] | ||
pub struct GetProductsInitial { | ||
#[arguments(first: 50, channel: $channel)] | ||
pub products: Option<ProductCountableConnection>, | ||
} | ||
|
||
#[derive(cynic::QueryFragment, Debug)] | ||
#[cynic(graphql_type = "Query", variables = "GetProductsNextVariables")] | ||
pub struct GetProductsNext { | ||
#[arguments(first: 50, after: $after, channel: $channel)] | ||
pub products: Option<ProductCountableConnection>, | ||
} | ||
|
||
#[derive(cynic::QueryFragment, Debug)] | ||
pub struct ProductCountableConnection { | ||
pub page_info: PageInfo, | ||
pub edges: Vec<ProductCountableEdge>, | ||
} | ||
|
||
#[derive(cynic::QueryFragment, Debug, Clone)] | ||
pub struct ProductCountableEdge { | ||
pub node: Product, | ||
} | ||
|
||
#[derive(cynic::QueryFragment, Debug, Clone)] | ||
pub struct Product { | ||
pub id: cynic::Id, | ||
pub slug: String, | ||
pub updated_at: DateTime, | ||
pub category: Option<Category>, | ||
} | ||
|
||
#[derive(cynic::QueryFragment, Debug)] | ||
pub struct PageInfo { | ||
pub has_next_page: bool, | ||
pub end_cursor: Option<String>, | ||
} | ||
|
||
#[derive(cynic::QueryFragment, Debug, Clone)] | ||
pub struct Category { | ||
pub id: cynic::Id, | ||
pub slug: String, | ||
} | ||
|
||
#[derive(cynic::Scalar, Debug, Clone)] | ||
pub struct DateTime(pub String); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod event_subjects_updated; | ||
pub mod get_all_categories_n_products; | ||
pub mod get_all_categories; | ||
pub mod get_all_collections; | ||
pub mod get_all_pages; | ||
pub mod get_all_products; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.