On a project of mine I noticed this unexpected behavior:
Using graphene_django with graphene.relay converts IntegrierFields of my models to graphene.Float properties in the API, e.g.:
class Incident(models.Model):
incident_id = models.IntegerField(unique=True)
class IncidentType(graphene_django.types.DjangoObjectType):
class Meta:
model = Incident
interfaces = (graphene.relay.Node,)
filter_fields = {
'incident_id': ['exact'],
}
class Query:
incident = graphene.relay.Node.Field(IncidentType)
incidents = DjangoFilterConnectionField(IncidentType)
To be precise, using the incident attribute shows the incidentId to be of type Int. But using the incidents attribute suggests that incidentId is of type Float.
I'd like to point out, that there is no error occurring, but it strikes me as weird.
I observed this with:
- Django 2.2
- django-filter 2.1.0
- graphene 2.1.3
- graphene-django 2.2.0
- graphql-core 2.1
- graphql-relay 0.4.5
On a project of mine I noticed this unexpected behavior:
Using
graphene_djangowithgraphene.relayconvertsIntegrierFields of my models tographene.Floatproperties in the API, e.g.:To be precise, using the
incidentattribute shows theincidentIdto be of typeInt. But using theincidentsattribute suggests thatincidentIdis of typeFloat.I'd like to point out, that there is no error occurring, but it strikes me as weird.
I observed this with: