summaryrefslogtreecommitdiffstats
path: root/stepped-solutions/54/backend/src/schema.graphql
blob: d9ab917b5e48c2c3b49534449c43df42e487edc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# import * from './generated/prisma.graphql'

type SuccessMessage {
  message: String
}

type Mutation {
  createItem(title: String, description: String, price: Int, image: String, largeImage: String): Item!
  updateItem(id: ID!, title: String, description: String, price: Int): Item!
  deleteItem(id: ID!): Item
  signup(email: String!, password: String!, name: String!): User!
  signin(email: String!, password: String!): User!
  signout: SuccessMessage
  requestReset(email: String!): SuccessMessage
  resetPassword(resetToken: String!, password: String!, confirmPassword: String!): User!
  updatePermissions(permissions: [Permission], userId: ID!): User
  addToCart(id: ID!): CartItem
  removeFromCart(id: ID!): CartItem
  createOrder(token: String!): Order!
}

type Query {
  items(where: ItemWhereInput, orderBy: ItemOrderByInput, skip: Int, first: Int): [Item]!
  item(where: ItemWhereUniqueInput!): Item
  itemsConnection(where: ItemWhereInput): ItemConnection!
  me: User
  users: [User]!
  order(id: ID!): Order
  orders(orderBy: OrderOrderByInput): [Order]!
}

type User{
  id: ID!
  name: String!
  email: String!
  permissions: [Permission!]!
  cart: [CartItem!]!
}