I am having difficulties figuring out how to make a relation mutation using graph cool.
My schema looks like this:
type Team @model {
id: ID! @isUnique
name: String
players: [Player!]! @relation(name: "TeamPlayers")
}
type Player @model {
id: ID! @isUnique
name: String
team: Team @relation(name: "TeamPlayers")
}
I am trying to then add a player to a team. I have written my mutation like the following but it isn't working.
mutation {
addToTeamPlayers(id: "cjc8up2mie32h015280wkqmdy") {
playersPlayer(name: "Jimmy") {
name
}
}
}
I am not finding the docs particularly helpful for this type of mutation. Can anyone advise how to do this? I am following this section of the docs.