Error Using Graphene Django with Polymorphic (typed models)
See original GitHub issueI am trying to query a field source
on a model called Requirement
which can have a source
which is a pool
however pool
is polymorphic. That is, it is a typed model.
Pool(TypedModel):
...
ManufacturedLabwarePool(Pool):
...
When I try to query source
as a field on Requirement
I get the following error:
I’m not sure how to resolve this so that we do not expect a specific type for a given field.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Django & Graphene: How to handle bidirectional relationship ...
graphene -django doesn't recognize the relationship, but declaring and resolving ... registry from . import models class EventType(graphene.
Read more >Queries & ObjectTypes - Graphene-Python
By default, DjangoObjectType will present all fields on a Model through GraphQL. If you only want a subset of fields to be present,...
Read more >Graphql cannot query field on type - Para Erboristeria Ruocco
When we query or mutate data using our GraphQL schema, we first have to ... And I used the same versions of Django,...
Read more >GraphQL Implementation in Django| Graphene Tutorial
We will use the graphene library, which works with GraphQL and Python. ... class to create the GraphQL types for each of our...
Read more >[Solved]-Does graphene-django dynamically create an API ...
[Solved]-Does graphene-django dynamically create an API documentation?-django ... Yes, it's very easy to do by using GraphiQL, which is embedded in to Graphene....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was able to solve this by using:
@lucas-bremond yes, looks the same I’ve done. Take a look at my WIP branch here for a project I am developing: https://github.com/chessbr/shuup-graphql/blob/basket/shuup_graphql/front/types/contact.py#L35 and the tests: https://github.com/chessbr/shuup-graphql/blob/basket/shuup_graphql_tests/front/test_basket.py#L54