Hi, trying to wrap my head around how to represent...
# orm-help
r
Hi, trying to wrap my head around how to represent a SQL join relationship within GQL context (if that even makes sense). Say I have the following 2 entities:
Form
and
FormItem
. Form can have many FormItem’s. But I want to create the relationship between the 2 using a “join”, which it self has some metadata on it. Meaning, I can create and reuse FormItem’s across different forms, but I may want to specify some meta data (ie, required, label, etc). How to best represent this in Prisma context?
Here is what I have so far, but I don’t think its quiet right:
Copy code
type MemberForm {
  id: ID! @unique
  name: String!
  description: String
  formItems: [MemberFormFormItem!]!
}

type MemberFormFormItem {
  id: ID! @unique
  formItem: FormItem!
  required: Boolean @default(value: "false")
  weight: Int
  hintOverride: String
  labelOverride: String
  placeholderOverride: String
}

type FormItem {
  id: ID! @unique
  name: String!
  kind: FormItemKind!
  label: String
  placeholder: String
  hint: String
  description: String
}