Jeremiah
08/05/2019, 6:58 PMYou are trying to set the relation 'BlueTeam' from 'Match' to 'Team' and are only providing a relation directive with a name on 'Match'. Please also provide the same named relation directive on the relation field on 'Team' pointing towards 'Match'.
Here's my model:
type Match {
id: ID! @id
players: [Player!]! @scalarList(strategy: RELATION)
red: Team! @relation(name: "RedTeam")
blue: Team! @relation(name: "BlueTeam")
winner: String!
createdAt: DateTime! @createdAt
updatedAt: DateTime! @updatedAt
}
type Team {
id: ID! @id
top: Player! @relation(name: "Top")
jungle: Player! @relation(name: "Jungle")
mid: Player! @relation(name: "Mid")
carry: Player! @relation(name: "Carry")
support: Player! @relation(name: "Support")
matches: [Match]! @scalarList(strategy: RELATION)
}
type Player {
id: ID! @id
role: String!
matches: [Match]! @scalarList(strategy: RELATION)
createdAt: DateTime! @createdAt
updatedAt: DateTime! @updatedAt
}
What is a fix for this or is there a better way to represent the teams?Harshit
08/05/2019, 7:50 PMtype Match {
id: ID! @id
players: [Player!]! @scalarList(strategy: RELATION)
red: Team! @relation(name: "RedTeam")
blue: Team! @relation(name: "BlueTeam")
teams: [Team!]! @relation(name: "MatchtoUser")
winner: String!
createdAt: DateTime! @createdAt
updatedAt: DateTime! @updatedAt
}
type Team {
id: ID! @id
top: Player! @relation(name: "Top")
jungle: Player! @relation(name: "Jungle")
mid: Player! @relation(name: "Mid")
carry: Player! @relation(name: "Carry")
support: Player! @relation(name: "Support")
redTeamMatches: [Match]! @relation(name: "RedTeam")
blueTeamMatches: [Match]! @relation(name: "BlueTeam")
matches: [Match]! @relation(name: "MatchtoUser")
}
type Player {
id: ID! @id
role: String!
matches: [Match]!
createdAt: DateTime! @createdAt
updatedAt: DateTime! @updatedAt
}
Harshit
08/05/2019, 7:50 PMJeremiah
08/05/2019, 7:59 PMJeremiah
08/05/2019, 8:31 PMHarshit
08/05/2019, 8:47 PMMatchEvent
that can keep track of this.Jeremiah
08/05/2019, 8:50 PMred
and blue
. I need to keep track of the `Team`s independently in Match
but I don't need to keep track of the `Match`es independently in Team
. What would MatchEvent
look like?