diff options
| author | Wes Bos <wesbos@gmail.com> | 2018-02-13 17:04:00 -0500 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2018-02-13 17:04:00 -0500 |
| commit | a09b01abf7c03e6b7e43f2175e5a34501808821b (patch) | |
| tree | 21ae6feb1d9ac1a07f045dffc24db406e2a4183b /frontend/queries | |
| parent | fa3ec3299b3fa33e5a699683beb96cfa4e6dd51d (diff) | |
omg it works
Diffstat (limited to 'frontend/queries')
| -rw-r--r-- | frontend/queries/index.js | 65 |
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 + } + } +`; |
