I spent hours on this and no luck it looks like a bug. All fields show up in the results of my query but the "type" and there is no difference between the "type" and the "issuer" for example, both are foriegn keys. Graphene randomly removes the type while it is there and when I print it in the resolver i see it has a value. When I try to query the field type in graphiql i get the following error: "Cannot query field \"type\" on type \"Post\"." Any thought?
class T(models.Model):
type=models.CharField(default="type 1",null=False,blank=False,max_length=40)
def str(self):
return self.type
class Post(models.Model):
slug=models.SlugField(unique=True)
issuer=models.ForeignKey(User,on_delete=models.SET_NULL,blank=False,null=True,related_name="posts")
date_created=models.DateTimeField(default=timezone.now)
last_edited=models.DateTimeField(null=True)
num_interests = models.IntegerField(verbose_name="Number of interests so far",default=0)
status=models.CharField(max_length=30,default="posted")
tags=TaggableManager()
title=models.CharField (max_length=200,blank=False)
description =models.TextField(max_length=settings.MAX_TEXTAREA_LEN,default="",
validators=[MaxLengthValidatorFactory(settings.MAX_TEXTAREA_LEN)],blank=False)
goodUntil = models.DateField(verbose_name=_("Date"),default=datetime.now()+timedelta(days=7))
subjects=models.ManyToManyField(to=Subject,related_name='posts',blank=False)
type=models.ForeignKey(T,on_delete=models.SET_NULL,blank=False,null=True,related_name="type")