diff options
| author | Wes Bos <wesbos@gmail.com> | 2018-04-05 16:52:40 -0400 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2018-04-05 16:52:40 -0400 |
| commit | 41a86494f3caea96dd4ed32733310783e47b429d (patch) | |
| tree | 344d94c5cb2966f9ddd49b9f7ab2ad02ed88bce7 /frontend/queries/index.js | |
| parent | fdc7ae6a0a0cced82791bd03cf575f2fa68fca99 (diff) | |
refactor
Diffstat (limited to 'frontend/queries/index.js')
| -rw-r--r-- | frontend/queries/index.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/frontend/queries/index.js b/frontend/queries/index.js index 1080a2e..6b3dd2a 100644 --- a/frontend/queries/index.js +++ b/frontend/queries/index.js @@ -74,18 +74,28 @@ export const CREATE_ORDER_MUTATION = gql` export const ALL_ITEMS_QUERY = gql` # Import the Fragment ${itemDetails} - query AllItemsQuery($skip: Int = 0, $first: Int = 3) { - itemsConnection(orderBy: createdAt_DESC, first: $first, skip: $skip) @connection(key: "itemsConnection") { + query AllItemsQuery($skip: Int = 0, $first: Int = 2) { + itemsConnection { aggregate { count } } - items(orderBy: createdAt_DESC, first: $first, skip: $skip) @connection(key: "items") { + items(orderBy: createdAt_DESC, first: $first, skip: $skip) { ...itemDetails } } `; +export const ITEM_COUNT_QUERY = gql` + query itemCountQuery { + itemsConnection { + aggregate { + count + } + } + } +`; + export const SINGLE_ITEM_QUERY = gql` ${itemDetails} query FindItem($id: ID!) { |
