summaryrefslogtreecommitdiffstats
path: root/frontend/queries/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/queries/index.js')
-rw-r--r--frontend/queries/index.js65
1 files changed, 49 insertions, 16 deletions
diff --git a/frontend/queries/index.js b/frontend/queries/index.js
index 365c6f4..2464246 100644
--- a/frontend/queries/index.js
+++ b/frontend/queries/index.js
@@ -170,26 +170,39 @@ export const CURRENT_USER_QUERY = gql`
`;
export const USER_ORDERS_QUERY = gql`
- query {
- user {
- # grab the current user
+ query orders {
+ orders(orderBy: createdAt_DESC) {
id
- orders {
- # and a all their orders
+ total
+ createdAt
+ updatedAt
+ items {
id
- amount
- charge
- item {
- # populate the details about the item they bought with the image, description and title
- image {
- id
- secret
- }
- description
- title
- }
+ title
+ price
+ description
+ image
}
}
+ # user {
+ # # grab the current user
+ # id
+ # orders {
+ # # and a all their orders
+ # id
+ # amount
+ # charge
+ # item {
+ # # populate the details about the item they bought with the image, description and title
+ # image {
+ # id
+ # secret
+ # }
+ # description
+ # title
+ # }
+ # }
+ # }
}
`;
@@ -234,3 +247,23 @@ export const UPDATE_CART_STATE = gql`
}
}
`;
+
+export const UI_STATE = gql`
+ query {
+ isCartOpen @client
+ }
+`;
+
+export const UPDATE_NETWORK_STATUS = gql`
+ mutation updateNetworkStatus($isConnected: Boolean) {
+ updateNetworkStatus(isConnected: $isConnected) @client
+ }
+`;
+
+export const GET_UI_STATE = gql`
+ query cartState {
+ networkStatus @client {
+ isConnected
+ }
+ }
+`;