Home Why scalar Date GraphQL doesn't work
Reply: 0

Why scalar Date GraphQL doesn't work

user1285
1#
user1285 Published in May 25, 2018, 11:08 am

I have project where I use graphql and need provide date thought graphql, when I use String type date properly shows in resolver, but when I use scalar Date in resolver I get false intead date. In docs find nothing. Date provided as Wed Jan 11 2018 21:30:00. Should I install moment cause I get warning eprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date() and I don't use moment in my project.

/*---- doesn't work ----*/
scalar Date
type Event {
  id: ID!
  title: String!
  dateStart: Date!
  dateEnd: Date!
  users: [User]
  room: Room
}
input EventInput {
  title: String!
  dateStart: Date!
  dateEnd: Date!
}

/*---- works ----*/
type Event {
  id: ID!
  title: String!
  dateStart: String!
  dateEnd: String!
  users: [User]
  room: Room
}
input EventInput {
  title: String!
  dateStart: String!
  dateEnd: String!
}

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.387296 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO