Skip to content

Subgraph

A subgraph for the The Graph protocol has been developed. Therefore a Graphql endpoint is exposed to be queried by the client app.

Entities

Task

type Task @entity {
  id: ID!
  endDate: BigInt!
  status: TaskStatus!
  reallocationTime: BigInt!
  assignee: User
  rejecterUsers: [User]! @derivedFrom(field: "rejectedTasks")
}
  • endDate: timestamp in s (when working with it in js remember to multiply by 1000!) of the task deadline.
  • status: current status of the task.
  • reallocationTime: the period of time in s in which the task has to be reallocated. It changes with task priority. In the current version the user is not aware of this feature.
  • assignee: user to whom the task has been assaigned or that has accepted it.
  • rejecterUsers: list of users that have rejected the task so it isn't assigned to them again.

User

type User @entity {
  id: ID!
  benefits: BigInt!
  available: Boolean!
  rejectedTasks: [Task]!
}
  • benefits: in the future could taken into account by the algorithm, currently not used.
  • available: whether the user is available (no task accepted) or bussy (task accepted).
  • rejectedTasks: list of tasks that the user has rejected.

Enums

enum TaskStatus {
  NonExistent
  Available
  Assigned
  Accepted
  Rejected
  Completed
}

Last update: 2022-11-29