EQuimper / twitter-clone-with-graphql-reactnative

164 stars 71 forks source link

Repeating event #44

Closed gHashTag closed 6 years ago

gHashTag commented 6 years ago

Greetings to the teacher!

The task is to make a repeating event.

Model

const EventSchema = new Schema({
  name: String,
  description: String,
  event_times: [{ start_time: Date, end_time: Date }]
}, { timestamps: true })

Schema

type EventTimes {
   start_time: Date!
   end_time: Date! 
}

I create a mutation

type Mutation {
createEvent(name: String!, teacher: String!, cover: String, description: String, start_time: String, end_time: String, event_times: [EventTimes]): Event 
}


I receive an error:

Error: Expected [EventTimes] to be a GraphQL input type

What am I doing wrong?

EQuimper commented 6 years ago

Change type for input and that should work. Finally a type object and input object are not the same