-
Notifications
You must be signed in to change notification settings - Fork 823
Abstract ObjectTypes don't have a specific type. #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Are the inherited classes ( By abstract I meant this: # In trainings/schema.py
class Query(graphene.ObjectType):
class Meta:
abstract = True Check this comment in a related issue: #55 (comment) Going to close this issue, but feel free to reopen if is not working for you! |
Yes my classes are abstracts like this.
and
An idea ? |
@Grmiade Can you copy the output of the error here? |
Sure.
|
Reopening the issue as the previous fix #55 was invalidated by a major refactor. |
Thanks. |
@Grmiade A new version of graphene is uploaded to PyPI |
It's work ! |
Hello, i have the same 500 error in 0.7.3 version when trying this is my schema class NotesNode(DjangoNode):
class Meta:
model = Notes
filter_fields = ['title',]
filter_order_by = ['title'] class Query(ObjectType):
note = relay.NodeField(NotesNode)
all_notes = DjangoFilterConnectionField(NotesNode)
class Meta:
abstract = True schema = graphene.Schema(name='Notes Schema')
schema.query = Query and this is my model class Notes(models.Model):
title = models.CharField(max_length=100)
text = models.TextField()
def __str__(self):
return self.title |
@greenteamer could you detail a little bit more? A stacktrace of the Exception or the output of the |
|
@greenteamer The final query type used in the schema should not be abstract. class Query(ObjectType):
note = relay.NodeField(NotesNode)
all_notes = DjangoFilterConnectionField(NotesNode) (without the Meta) |
The abstract queries bases should only be used when we inherit the final Example: class QueryNotes(ObjectType):
note = relay.NodeField(NotesNode)
all_notes = DjangoFilterConnectionField(NotesNode)
class Meta:
abstract = True
class QueryUsers(ObjectType):
user = relay.NodeField(UserNote)
all_users = DjangoFilterConnectionField(UserNote)
class Meta:
abstract = True
class Query(QueryNotes, QueryUsers):
pass
schema = graphene.Schema(name='My Schema')
schema.query = Query |
wow ... this is amasing!!! thank you !!! you did a great job |
Hi, I wasn't sure where this comment was best placed. Which is also in: I'm attempting to create this level of abstraction as well. I'm using graphql-sqlalchemy and when I do something like:
I'm getting the following error:
|
I have this error, when I add a second inheritance class in my main
Query
.The text was updated successfully, but these errors were encountered: