|
|
|
|
|
by true_religion
2931 days ago
|
|
> I stuck to ISO 8601 format string for standardizing time. In my App, I have scalar called ISO8601String, which is a custom scalar representing a date-time. The server outputs the correct serialized value, and clients are expected to deserialize as per the documentation. It's not automatic though. Every client app has to implement the custom scalar serialize/deserialize logic or else it isn't conforming to the schema that the server declares. GraphQL isn't a global schema standard, inclusive of implementation details. It's specific to your application's servers/clients. Someone else is free to have a scalar called ISO8601String, which demands totally different serialization. Implementing a client/server pretty much requires reading the documentation of the schema. You can make a Map restrict itself to only string keys, but that conformance of that will have to be a custom type implemented by your server to reject noncomforming objects. |
|