veksen
03/03/2018, 1:28 AM// 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!]!.
ckelley
03/03/2018, 1:39 AMinput
instead of a type
ckelley
03/03/2018, 1:40 AMtype
only works as a return type; if you want to specify input arguments, you have to use input Field { ... }
veksen
03/03/2018, 1:47 AMveksen
03/03/2018, 1:47 AM