Skip to content

Converters cannot convert datetime.timedelta to float. #348

Open
@dionyself

Description

@dionyself

hello devs.
During a conversation about an issue of graphql-core @jkimbo found a possible error

@convert_django_field.register(models.DurationField)
def convert_field_to_float(field, registry=None):
return Float(description=field.help_text, required=not field.null)

raising something like { "message": "float() argument must be a string or a number, not 'datetime.timedelta'" }

you can check graphql-python/graphql-core#150 for more info.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions