models.graphql 629 Bytes
type User {
  id: ID!
  avatarUrl: String
  username: String!
  email: String!
  password: String!
  phoneNum: String!
  emailSecret: String
  phoneSecret: String
  bio: String
  groups: [Group]
  messages: [Message]
  directMessages: [DirectMessage]
  createdAt: String
}

type Group {
  id: ID!
  name: String!
  participants: [User]
  messages: [Message]
  files: String
  createdAt: String
}

type DirectMessage {
  id: ID!
  text: String!
  sender: User!
  createdAt: String
}

type Message {
  id: ID!
  text: String!
  sender: User!
  group: Group!
  createdAt: String
}

type AuthPayload {
  token: String
  user: User
}