I'm trying to add a field to my Mutation that has an array in it with my own type. When I added the attraction the the createTour
mutation, I started getting this error:
Error: The type of Mutation.createTour(attractions:) must be Input Type but got: [Attraction].
Here is the problematic Mutation
type Mutation {
createTour(
title: String!
description: String!
attractions: [Attraction] <----- THIS LINE
): Tour
addCommentToTour(id: ID!, comment: String!): Tour
}
And here are the typedefs I have as well.
type Attraction {
title: String
description: String
coordinateLat: Int
coordinateLong: Int
}
type Tour {
id: ID!
title: String!
description: String!
author: String!
attractions: [Attraction]
}
How can I get this Mutation to take in this array?