models.graphql 578 Bytes
type User {
  id: ID!
  avatarUrl: String
  name: String
  email: String!
  password: String
  emailSecret: String
  phoneNum: String
  phoneSecret: String
  bio: String
  rooms: [Room]
  createdAt: String
  messages: [Message]
  sender: Message
  receiver: [Message]
}

type Room {
  id: ID!
  participants: [User]
  categories: [Category]
}

type Category {
  id: ID!
  name: String
  rooms: [Room]
}

type Message {
  id: ID!
  text: String!
  from: User!
  to: User!
  room: Room!
  createdAt: String
  updatedAt: String
}

type AuthPayload {
  token: String
  user: User
}