Base solution for your next web application
Open Closed

Datetime in GraphQL #9342


User avatar
0
mahendra created

Hi Expert,

I am not getting the timepart in a datetime field in GraphQL playground. See attached image

Please advise....


2 Answer(s)
  • User Avatar
    0
    mahendra created

    Please don't bother. The issue has been fixed by converting the daetime datetype to datetimeoffset datatype...

    Regards, Mahendra

  • User Avatar
    0
    mahendra created

    Hi,

    When I chaged the datatype of my Dto from DateTime to DateTimeOffset, the GraphQL started returning the time with date value. But the next problem started in AutoMapper.

    Now my entity class has a DateTime datatype but my dto (say, CreateOrUpdate DTO) has a a DateTimeOffset datatype. Due to this it started throwing error while mapping the dto object to entity object or vice versa.

    What is the best way to overcome this problem.

    Regards, Mahendra