Passing a list of custom types to a GraphQL mutation
The problem you are seeing is because while you've correctly changed your input type to be a GraphQLInputObjectType
, that changes the type of field UserType.forms
to an input type too - remember UserType
is an output type. Here you would need to make a FormType
and also a FormInputType
, and use each in the appropriate place.
Separately: why do you need a full input type for a form? Wouldn't it function equally well to just pass in the ID? Or, if the intention is to have FormType
represent form data, why does it need an ID? Also, perhaps it could be named better to FormData
?
Finally, while I believe this provides an answer, your question didn't provide completely cut+pasteable code for a minimal, complete and verifiable example so that I could easily check.