You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of the InputValueSerializer in the DGS Codegen library does not support custom serialization for Date fields. This limitation makes it challenging to handle Date objects properly when constructing GraphQL queries, especially when dates need to be serialized to ISO 8601 format.
Steps to Reproduce
Create a GraphQL query request that includes Date fields in the input.
Attempt to serialize the query using GraphQLQueryRequest.serialize().
Observe that Date fields are not converted to ISO 8601 format.
Expected Behavior
The InputValueSerializer should provide a way to handle custom serialization for Date fields, allowing dates to be converted to ISO 8601 strings during the serialization process.
Current Workaround
Currently, users need to preprocess the input map manually before creating the GraphQLQueryRequest. This involves traversing the input map and converting Date objects to ISO 8601 strings using a utility method. While effective, this approach adds additional complexity and is not ideal.
Enhance the InputValueSerializer to support custom serializers for specific types, including Date. This could be achieved by allowing users to register custom serializers for different classes, which would then be used during the serialization process.
Additional Context
Adding support for custom serializers will improve the flexibility and usability of the DGS Codegen library, making it easier to work with various data types, including Date, in a more seamless and intuitive manner.
The text was updated successfully, but these errors were encountered:
Issue Description
The current implementation of the
InputValueSerializer
in the DGS Codegen library does not support custom serialization forDate
fields. This limitation makes it challenging to handleDate
objects properly when constructing GraphQL queries, especially when dates need to be serialized to ISO 8601 format.Steps to Reproduce
Date
fields in the input.GraphQLQueryRequest.serialize()
.Date
fields are not converted to ISO 8601 format.Expected Behavior
The
InputValueSerializer
should provide a way to handle custom serialization forDate
fields, allowing dates to be converted to ISO 8601 strings during the serialization process.Current Workaround
Currently, users need to preprocess the input map manually before creating the
GraphQLQueryRequest
. This involves traversing the input map and convertingDate
objects to ISO 8601 strings using a utility method. While effective, this approach adds additional complexity and is not ideal.Example of the Current Workaround
Proposed Solution
Enhance the
InputValueSerializer
to support custom serializers for specific types, includingDate
. This could be achieved by allowing users to register custom serializers for different classes, which would then be used during the serialization process.Additional Context
Adding support for custom serializers will improve the flexibility and usability of the DGS Codegen library, making it easier to work with various data types, including
Date
, in a more seamless and intuitive manner.The text was updated successfully, but these errors were encountered: