Right now I have a django model.
class MyModel(models.Model, GetMixin):
logo_url = models.URLField()
And attached it up to DjangoObjectType
.
class MyModelType(DjangoObjectType):
class Meta:
model = MyModel
Now I need to change the field name of logo_url
of response to look like this --logo-url
instead of logoUrl
so I can have this desired result.
{
"data": {
"myData": {
"site": {
"--logo-url": "https://www.company.com/logo.png"
}
}
}
}
UPDATES
This feature is very hard to achieve! I was able to get ahold of extending an objecttype meta and successfully composed the desired field name structure but graphene standard won't allow me to do so:
AssertionError: Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "--logo-url"
does not.