summaryrefslogtreecommitdiffstats
path: root/backend/src/schema.graphql
blob: 07533eb08497d1ee032062c0a3f133ab0e285bd6 (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
39
# The Below line looks like a comment, but it's not!
# import * from './generated/prisma.graphql'

type Query {
  me: User
  order(id: ID!): Order!
  orders(where: OrderWhereInput, orderBy: OrderOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Order]!
  items(where: ItemWhereInput, orderBy: ItemOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Item]!
  itemsConnection(where: ItemWhereInput, orderBy: ItemOrderByInput, first: Int, last: Int, skip: Int): ItemConnection!
}

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

type SuccessMessage {
  message: String
}

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