Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Issues with DateTime ISO fields

Open
#29 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
api

Research direction

Start by inspecting gql/renderer_dataclasses.py around lines 153-160, especially how suffix is handled for nullable DateTime fields and when DATETIME_FIELD is selected. Reproduce the gql_run query with a DateTime result and verify that the generated dataclass can deserialize the returned ISO value without the reported TypeError.

Written by the indexing model from the issue text.

Description

when i run gql_run and the renderer_dataclasses.py encounters a DateTime field it generates a field:

var_name: datetime = None

when I run a query that returns a datetime object I get the following error:

File "/Users/jasper/Documents/test/test-graph-python-client/env/lib/python3.7/site-packages/dataclasses_json/core.py", line 220, in _decode_generic
    res = _get_type_cons(type_)(xs)
  File "/Users/jasper/Documents/test/test-graph-python-client/env/lib/python3.7/site-packages/dataclasses_json/core.py", line 260, in <genexpr>
    for x in xs)
  File "/Users/jasper/Documents/test/test-graph-python-client/env/lib/python3.7/site-packages/dataclasses_json/core.py", line 165, in _decode_dataclass
    infer_missing)
  File "/Users/jasper/Documents/test/test-graph-python-client/env/lib/python3.7/site-packages/dataclasses_json/core.py", line 179, in _decode_dataclass
    dt = datetime.fromtimestamp(field_value, tz=tz)
TypeError: an integer is required (got type str)

I think this is because in:
https://github.com/graphql-python/gql-next/blob/5c81e58862c8df3a335b81bb2f77a0fab2c50570/gql/renderer_dataclasses.py#L153-L160

suffix is being overwritten if the field is nullable and DATETIME_FIELD isn't being used.

Dominant language
Python
Stars
78
Forks
6
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from graphql-python/gql-next

All issues in graphql-python/gql-next

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.