hey guys, I have a wee question I hope someone can...
# orm-help
j
hey guys, I have a wee question I hope someone can point me in the right direction. I am building a graphql backend for the first time. I am wondering how I might implement a 'depth' argument for a self-referential type? e.g. here where
subPlaces
is self-referential. I would like to query
places(depth: Int!)
so that I can build a tree structure.
Copy code
type Place {
  id: ID! @unique
  name: String!
  things: [Thing]! @relation(name: "ThingsInPlace", onDelete: CASCADE)
  subPlaces: [Place]
}
eh, nevermind, I can just add
depth: Int!
to the model and use that in my resolvers