How could i do something like: ```type User { .....
# orm-help
j
How could i do something like:
Copy code
type User {
  ...
  matches: [Match!]!
}

type Match {
  ...
  host: User!
  client: User!
  disconnector: User
}
Can't figure out how to do relations in this many to many where the User could be 1+ of several fields I've tried using 1 relation for all of them, but got the expected error
n
Hey Joseph, it sounds like this is a similar question on Stackoverflow: https://stackoverflow.com/questions/61260181/prisma-schema-create-a-relation-field-from-multiple-possible-foreign-keys-or/61266548#61266548 Let me know if that doesn't solve your question, happy to follow up 🙂
j
Thanks Nikolas! And just wanna start by saying I love the work you guys are doing with prisma! So I'm still using Prisma 1, is the only way to implement this by adding all these arrays?
matchesAsHost
matchesAsClient
matchesAsDisconnector
Or is there a way I could just use
matches
and then do some extra work in the resolver?
Ohh, maybe I should just put
matches
in my graph and manually resolve it from
matchesAsHost
and
matchesAsClient
Or do something like
Copy code
type User {
  ...
  matches: [Match!]! @relation("MatchUsers")
}

type Match {
  ...
  users: [User!]! @relation("MatchUsers")
  disconnector: User
}
Not sure if that's valid