This PR refactors the utility functions in the graphene_django_extras.utils module to enhance flexibility and improve handling of user-defined schema requirements and date-time formats. Specifically:
Customizable Non-Required Fields: Users can now provide a list of fields to mark as not required, allowing for more tailored schema definitions.
CustomDateTime Functionality: Added support for parsing date-time values in both epoch and standard datetime formats, improving compatibility with varied input formats.
Problem Addressed
Rigid Field Requirements: The existing implementation did not allow users to customize field requirements, leading to potential over-specification of fields in schemas.
Limited Date-Time Parsing: Handling of date-time values was limited to standard formats, making it challenging to support epoch-based timestamps.
Proposed Solution
Refactored utility functions to incorporate a mechanism for skipping non-required fields based on user input.
Introduced the CustomDateTime class to seamlessly handle epoch timestamps and standard datetime formats, ensuring flexible and robust date parsing.
Impact
Enhanced Flexibility: Provides developers with greater control over schema generation by allowing customization of required fields.
Broader Compatibility: Simplifies handling of diverse date-time formats, reducing preprocessing efforts and increasing ease of use.
Backward Compatibility: These changes are non-breaking and integrate smoothly with existing setups.
Description
This PR refactors the utility functions in the
graphene_django_extras.utils
module to enhance flexibility and improve handling of user-defined schema requirements and date-time formats. Specifically:Problem Addressed
Proposed Solution
CustomDateTime
class to seamlessly handle epoch timestamps and standard datetime formats, ensuring flexible and robust date parsing.Impact