diff options
Diffstat (limited to 'frontend/queries/queries.graphql')
| -rw-r--r-- | frontend/queries/queries.graphql | 233 |
1 files changed, 0 insertions, 233 deletions
diff --git a/frontend/queries/queries.graphql b/frontend/queries/queries.graphql deleted file mode 100644 index ababde3..0000000 --- a/frontend/queries/queries.graphql +++ /dev/null @@ -1,233 +0,0 @@ -fragment itemDetails on Item { - __typename - id - title - price - description - image - largeImage -} - -mutation CREATE_ITEM_MUTATION($description: String!, $title: String!, $price: Int!, $image: String, $largeImage: String) { - createItem(description: $description, title: $title, price: $price, image: $image, largeImage: $largeImage) { - ...itemDetails - } -} - -mutation SIGNUP_MUTATION($email: String!, $name: String!, $password: String!) { - signup(email: $email, name: $name, password: $password) { - id - email - name - } -} - -mutation SIGNIN_MUTATION($email: String!, $password: String!) { - signin(email: $email, password: $password) { - id - email - name - } -} - -mutation SIGN_OUT_MUTATION { - signout { - message - } -} - -mutation REQUEST_RESET_MUTATION($email: String!) { - requestReset(email: $email) { - id - } -} - -mutation RESET_MUTATION($resetToken: String!, $password: String!, $confirmPassword: String!) { - resetPassword(resetToken: $resetToken, password: $password, confirmPassword: $confirmPassword) { - id - email - name - } -} - -mutation CREATE_ORDER_MUTATION($token: String!) { - createOrder(token: $token) { - id - charge - total - items { - id - title - } - } -} - -query ALL_ITEMS_QUERY($skip: Int = 0, $first: Int = 4) { - itemsConnection(orderBy: createdAt_DESC, first: $first, skip: $skip) { - aggregate { - count - } - } - items(orderBy: createdAt_DESC, first: $first, skip: $skip) { - ...itemDetails - } -} - -query SINGLE_ITEM_QUERY($id: ID!) { - items(where: { id: $id }) { - user { - id - email - name - } - ...itemDetails - } -} - -query SINGLE_ORDER_QUERY($id: ID!) { - order(id: $id) { - id - charge - total - createdAt - user { - id - } - items { - id - title - price - description - image - quantity - } - } -} - -query SEARCH_ITEMS_QUERY($searchTerm: String!) { - items( - where: { - OR: [ - { title_contains: $searchTerm } - { description_contains: $searchTerm } - ] - } - ) { - ...itemDetails - } -} - -mutation REMOVE_ITEM_MUTATION($id: ID!) { - deleteItem(id: $id) { - id - title - description - } -} - -mutation UPDATE_ITEM_MUTATION( - $id: ID! - $title: String - $description: String - $price: Int -) { - updateItem( - id: $id - description: $description - title: $title - price: $price - ) { - ...itemDetails - } -} - -mutation UPDATE_USER_MUTATION($name: String!) { - updateUser(name: $name) { - name - } -} - -query CURRENT_USER_QUERY { - me { - id - email - name - permissions - orders { - id - charge - total - } - cart { - id - quantity - item { - ...itemDetails - } - } - } -} - -query USER_ORDERS_QUERY { - orders(orderBy: createdAt_DESC) { - id - total - createdAt - updatedAt - items { - id - title - price - description - quantity - image - } - } -} - -mutation ADD_TO_CART_MUTATION($id: ID!) { - addToCart(id: $id) { - id - quantity - item { - id - price - description - image - title - } - } -} - -mutation REMOVE_FROM_CART_MUTATION($id: ID!) { - removeFromCart(id: $id) { - id - } -} - -query ALL_USERS_QUERY { - users { - id - name - email - permissions - } -} - -mutation UPDATE_PERMISSIONS_MUTATION($permissions: [Permission], $userId: ID!) { - updatePermissions(permissions: $permissions, userId: $userId) { - id - permissions - name - email - } -} - -query LOCAL_STATE_QUERY { - cartOpen @client -} - -mutation TOGGLE_CART_MUTATION { - toggleCart @client -} - |
