Open sprhawk opened 5 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This problem still persist with Django3. Here is simple code to get the same error
from django.contrib.postgres.fields import DecimalRangeField
from django.db import models
class Premium(models.Model):
percentage = models.DecimalField(max_digits=10, decimal_places=2)
sum_insured = DecimalRangeField() # Insurer accepts this range
def __str__(self):
return f"{self.percentage} | {self.sum_insured}"
from graphene import relay
from graphene_django import DjangoObjectType
from experiment_django3.insurances.models import Premium
class PremiumNode(DjangoObjectType):
class Meta:
model = Premium
filter_fields = [
'percentage',
'sum_insured',
]
interfaces = (relay.Node,)
Still a problem
Still a problem
Sorry to bump this, but it's been almost a year since the last comment. Today I hit this andgot as far as OP, also willing to make a PR if it would be welcomed
@aradkdj Yes a PR would be very much welcomed.
I'm using Django 2.2.x, graphene-django 2.3.0
I use a Postgres DateTimeRangeField, but GraphQL reports error ""User Error: expected iterable, but did not find one for field XXX"
I digged in, and found in
graphql
:execution/executor.py
where result is NonNull, inside is DateTimeTZRange. which is not declared List(DateTime) declared inside graphene-django converter.py
I want to define a data type to show structure for Range like:
which will introduce break changes to current API.
is it OK to do this. or what else better solution to this?