dart-backend / angel

A polished, production-ready backend framework in Dart for the VM, AOT, and Flutter.
https://github.com/dukefirehawk/angel
BSD 3-Clause "New" or "Revised" License
171 stars 22 forks source link

MapService serializes created_at and updated_at #95

Open jocubeit opened 1 year ago

jocubeit commented 1 year ago

This causes issues later during type conversion.

Specifically the following line:

https://github.com/dukefirehawk/angel/blob/9b85007072fdcd19bd79237ba2e3bf4e23c8021f/packages/framework/lib/src/core/map_service.dart#L87

If you amend the line to remove the serialization to an ISO 8601 string, then everything works as it should:

var now = DateTime.now(); //.toIso8601String();

Similarly the following lines would also need amending.

in the modify method: https://github.com/dukefirehawk/angel/blob/9b85007072fdcd19bd79237ba2e3bf4e23c8021f/packages/framework/lib/src/core/map_service.dart#L117

and in the update method: https://github.com/dukefirehawk/angel/blob/9b85007072fdcd19bd79237ba2e3bf4e23c8021f/packages/framework/lib/src/core/map_service.dart#L146

I raised an issue over at https://github.com/dart-backend/belatuk-examples/issues/3 which highlights the problem in the graphql example.

I'm happy to make the changes to the MapService class and push a merge request if you like.

jocubeit commented 1 year ago

Actually I'm having other issues now, as soon as I query nested objects. I'll investigate further and get back to this issue.

dukefirehawk commented 1 year ago

PR is always welcome.