Best conventions for storage of common object-type data across types

If status for each type is known before hand, then use enums. (Like Reddit tags)

e.g. Using Enums:

type CandidateStatus {
  ActivelySearching
  NotLooking
  ActivelyApplying
  ...
}

type Candidate {
  status: CandidateStatus!
}

If the status for a type is not known before hand, then go for a separate type. (Like Twitter Hashtags)

e.g.

type Status {
  name: String @id // The name itself will become id, so you won't have to fetch UIDs
}

type Company {
  status: Status!
}

If you know status before hand and you want to store more properties along with Status, then combine both approaches.

If there can be more properties related to Status, or you want to search for all the people who have set a particular status, you should have a separate status type.

Else if it’s just a single value, then it belongs to the parent type. (Like online status)

1 Like