summaryrefslogtreecommitdiffstats
path: root/backend/src/schema.graphql
blob: 788d490b48e30745ac06caf0dfbecb210a4bef14 (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
# import Post, Item, ItemCreateInput from './generated/prisma.graphql'

type Query {
  feed: [Post!]!
  drafts: [Post!]!
  post(id: ID!): Post!
  me: User
}

# import Mutation from './generated/prisma.graphql'

type Mutation {
  signup(email: String!, password: String!, name: String!): AuthPayload!
  login(email: String!, password: String!): AuthPayload!
  createDraft(title: String!, text: String!): Post!
  publish(id: ID!): Post!
  deletePost(id: ID!): Post!
  updatePost(id: ID!, title: String, text: String): Post!
  createItem(data: ItemCreateInput): Item!
  deleteItem(id: ID!): Item!
}

type AuthPayload {
  token: String!
  user: User!
}

# THe user definition overrides
type User {
  id: ID!
  email: String!
  website: String
  name: String!
  posts: [Post!]!
  age: Int
}