I have a relatively simple schema: Bands, Venues and Shows. Shows must each have a Venue; a Show can have multiple Bands. I want to have a mutation called addBandsToShow
and right now my schema looks something like this:
type Mutation {
addBandsToShow(input: [Band]!): Show
}
type Band {
id: Int!
slug: String!
name: String!
shows: [Show]
}
type Show {
id: Int!
description: String!
datetime: String!
venue: Venue
bands: [Band]
}
My goal is to create a mutation which takes potentially multiple bands as an argument and associates them with the show.
The above schema yields an Error, Error: The type of Mutation.addBandsToShow(input:) must be Input Type but got: [Band]!
but I don't want to create a new Band here; I want to add a Band which already exists in the graph to the list of bands associated with a Show. (ultimately this is managed in a relational DB) I'm a little lost on how to accomplish this, short of just supplying a list of band ids. But maybe that's the only way to do this?