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
Traceback (most recent call last):
File "/home/jwodder/.local/virtualenvwrapper/venvs/tmp-6802b9daf21c10c/lib/python3.8/site-packages/sgqlc/types/__init__.py", line 930, in __ensure__
return map_python_to_graphql[t]
KeyError: <class 'datetime.datetime'>
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "bug01a.py", line 4, in <module>
class MyType(Type):
File "bug01a.py", line 5, in MyType
createdAt = non_null(datetime)
File "/home/jwodder/.local/virtualenvwrapper/venvs/tmp-6802b9daf21c10c/lib/python3.8/site-packages/sgqlc/types/__init__.py", line 1128, in non_null
t = BaseType.__ensure__(t)
File "/home/jwodder/.local/virtualenvwrapper/venvs/tmp-6802b9daf21c10c/lib/python3.8/site-packages/sgqlc/types/__init__.py", line 932, in __ensure__
raise TypeError('Not %s or mapped: %s' % (cls, t)) from exc
TypeError: Not BaseType or mapped: <class 'datetime.datetime'>
Using createdAt = non_null(Field(datetime)) fails as well. Only createdAt = non_null(sgqlc.types.datetime.DateTime) works. However, I believe the failure of non_null(datetime) should be considered a bug, as things like non_null(str) work perfectly fine.
The text was updated successfully, but these errors were encountered:
otherwise it doesn't have the mapping. It's not automatic to avoid polluting the conversion with undesired mappings, so you must opt-in by importing that. After that you can use and it should work
As of sgqlc v14.1, running the following code:
fails with:
Using
createdAt = non_null(Field(datetime))
fails as well. OnlycreatedAt = non_null(sgqlc.types.datetime.DateTime)
works. However, I believe the failure ofnon_null(datetime)
should be considered a bug, as things likenon_null(str)
work perfectly fine.The text was updated successfully, but these errors were encountered: