Skip to content

Commit

Permalink
Merge pull request #7 from mak626/date-field-support
Browse files Browse the repository at this point in the history
feat: add support for mongo date field
  • Loading branch information
abhinand-c authored Aug 1, 2023
2 parents 60f2273 + 9be137c commit cb56602
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions graphene_mongo/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ def convert_field_to_datetime(field, registry=None, executor: ExecutorEnum = Exe
)


@convert_mongoengine_field.register(mongoengine.DateField)
def convert_field_to_date(field, registry=None, executor: ExecutorEnum = ExecutorEnum.SYNC):
return graphene.Date(
description=get_field_description(field, registry), required=field.required
)


@convert_mongoengine_field.register(mongoengine.DictField)
@convert_mongoengine_field.register(mongoengine.MapField)
def convert_field_to_jsonstring(field, registry=None, executor: ExecutorEnum = ExecutorEnum.SYNC):
Expand Down

0 comments on commit cb56602

Please sign in to comment.