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
When I try to pass the value through the DjangoObjectType, I received the following error:
Exception: Don't know how to convert the Django field ModelName.total_price (<class 'django.db.models.fields.generated.GeneratedField'>)
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via
a github repo, https://repl.it or similar (you can use this template as a starting point: https://repl.it/@jkimbo/Graphene-Django-Example).
Create a model with a GeneratedField
Create a DjangoObjectType for the model created in step 1
Error will appear when trying to query the generated field in GraphQL
What is the expected behavior?
The expected behavior is for DjangoObjectType to use the output_field type defined in the GeneratedField.
What is the motivation / use case for changing the behavior?
We would like to leverage the new GeneratedField functionality in Django 5.
Please tell us about your environment:
Version: 14,2,1
Platform: macOS Sonoma
Django_version = 5.0.1
-Graphene_version = 3.3
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)
The text was updated successfully, but these errors were encountered:
kiendang
changed the title
Exception: Don't know how to convert the Django field ModelName.total_price (<class 'django.db.models.fields.generated.GeneratedField'>)
Support Django 5 GeneratedField
Jan 27, 2024
Note: for support questions, please use stackoverflow. This repository's issues are reserved for feature requests and bug reports.
I used Django 5's GenerativeField to define one of my fields
When I try to pass the value through the
DjangoObjectType
, I received the following error:Exception: Don't know how to convert the Django field ModelName.total_price (<class 'django.db.models.fields.generated.GeneratedField'>)
a github repo, https://repl.it or similar (you can use this template as a starting point: https://repl.it/@jkimbo/Graphene-Django-Example).
GeneratedField
DjangoObjectType
for the model created in step 1What is the expected behavior?
The expected behavior is for
DjangoObjectType
to use theoutput_field
type defined in the GeneratedField.What is the motivation / use case for changing the behavior?
We would like to leverage the new
GeneratedField
functionality in Django 5.Please tell us about your environment:
-Graphene_version = 3.3
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)
The text was updated successfully, but these errors were encountered: