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

TODOs starting app serialization error #56

Closed tomwyr closed 1 year ago

tomwyr commented 2 years ago

After creating new GraphQL project using Angel CLI, any query/mutation requesting Date fields in its response fails.

{
  todos {
    id
    created_at
  }
}

Returns:

{
  "errors": [
    {
      "message": "Value of field \"created_at\" must be DateTime, got 2022-03-05T11:00:15.665164 (String) instead."
    }
  ]
}
tomwyr commented 2 years ago

I'm fairly new to Angel and GraphQL but it looks like MapService stores timestamps as String but then GQL Date type attempts to serialize them as if they were DateTime: https://github.com/dukefirehawk/graphql_dart/blob/master/graphql_server/lib/graphql_server2.dart#L564 https://github.com/dukefirehawk/graphql_dart/blob/master/graphql_schema/lib/src/scalar.dart#L133

dukefirehawk commented 2 years ago

We will get this resolved. Thanks for reporting it.