hey! we're having an issue implementing a mutation...
# prisma-whats-new
v
hey! we're having an issue implementing a mutation on a one-to-many relationship:
Copy code
// mutation
createForm(name: String!, description: String!, fields: [Field!]!): Form!

// schema
type Form {
  id: ID! @unique
  author: User!
  name: String!
  description: String!
  createdAt: DateTime!
  updatedAt: DateTime!
  fields: [Field!]!
}

type Field {
  id: ID! @unique
  containingForm: Form!
  name: String!
  value: String!
}
giving an error:
The type of Mutation.createForm(fields:) must be Input Type but got: [Field!]!.
c
@veksen I think it's because your mutation needs to use an
input
instead of a
type
type
only works as a return type; if you want to specify input arguments, you have to use
input Field { ... }
v
omg thanks, this seems to work!
🦜