I have two sets of records with the following schema
type Player {
id: ID! @unique
name: String!
links: [NPC!]! @relation(name: 'linkedNpcs')
}
type NPC {
id: ID! @unique
name: String!
playerLinks: [Player!]! @relation(name: 'linkedNpcs')
}
I want to add an additional field to the linkedNpcs
called relationType
.
How would I write this in my types.graphql
file? Each player-npc
link should contain a unique record, and since it's a many-to-many relationship, it makes sense that this metaData should exist on the join table.