My code has not changed, I simply upgraded Graphene (graphene-python, graphene-django)
What is the current behavior?
Since upgrading to the latest versions (on Django 3.2.16), I have started getting the following errors when an exception is raised in my resolvers and mutations:
platform | Traceback (most recent call last):
platform | File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
platform | response = get_response(request)
platform | File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
platform | response = wrapped_callback(request, *callback_args, **callback_kwargs)
platform | File "/usr/local/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
platform | return view_func(*args, **kwargs)
platform | File "/usr/local/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
platform | return self.dispatch(request, *args, **kwargs)
platform | File "/usr/local/lib/python3.9/site-packages/django/utils/decorators.py", line 43, in _wrapper
platform | return bound_method(*args, **kwargs)
platform | File "/usr/local/lib/python3.9/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
platform | response = view_func(request, *args, **kwargs)
platform | File "/usr/local/lib/python3.9/site-packages/graphene_django/views.py", line 179, in dispatch
platform | result, status_code = self.get_response(request, data, show_graphiql)
platform | File "/usr/local/lib/python3.9/site-packages/graphene_django/views.py", line 224, in get_response
platform | result = self.json_encode(request, response, pretty=show_graphiql)
platform | File "/usr/local/lib/python3.9/site-packages/graphene_django/views.py", line 235, in json_encode
platform | return json.dumps(d, separators=(",", ":"))
platform | File "/usr/local/lib/python3.9/json/__init__.py", line 234, in dumps
platform | return cls(
platform | File "/usr/local/lib/python3.9/json/encoder.py", line 199, in encode
platform | chunks = self.iterencode(o, _one_shot=True)
platform | File "/usr/local/lib/python3.9/json/encoder.py", line 257, in iterencode
platform | return _iterencode(o, 0)
platform | File "/usr/local/lib/python3.9/json/encoder.py", line 179, in default
platform | raise TypeError(f'Object of type {o.__class__.__name__} '
platform | TypeError: Object of type OperationType is not JSON serializable
Everything was working fine before, until I upgraded to these versions:
What is the expected behavior?
I expected everything to work as it used to before since I didn't change application code.
What is the motivation / use case for changing the behavior?
I was actually trying to get the latest version of the Graphiql GUI when I started. But then I noticed that my dependencies were very outdated.
My code has not changed, I simply upgraded Graphene (graphene-python, graphene-django)
Everything was working fine before, until I upgraded to these versions:
What is the expected behavior? I expected everything to work as it used to before since I didn't change application code.
What is the motivation / use case for changing the behavior? I was actually trying to get the latest version of the
Graphiql
GUI when I started. But then I noticed that my dependencies were very outdated.Please tell us about your environment: