Could anyone tell me the proper way to have an acc...
# orm-help
d
Could anyone tell me the proper way to have an account with an owner on the account type and also users like so?
Copy code
type Account {
  id: ID! @unique
  createdAt: DateTime!
  updatedAt: DateTime!
  archivedAt: DateTime
  owner: User!
  vessels: [Vessel!]!
  name: String!
  users: [User!]!
}

type User {
  id: ID! @unique
  createdAt: DateTime!
  updatedAt: DateTime!
  archivedAt: DateTime
  email: String! @unique
  password: String!
  name: String!
  posts: [Post!]!
  role: Role! @default(value: "CUSTOMER")
  customerType: CustomerType! @default(value: "FREE")
  account: Account
}
Do I really need to use relations on both the account and user type?
n
Yes, you have to, because two fields from
Account
point towards
User
.
d
Thanks Nilan