Support for Proxy Models
See original GitHub issueIs there support for querying proxy models? I’m trying to query a model that has a bunch of proxy models but am getting an error. Here’s an abbreviated look at my setup:
class Column:
...
class FieldColumn(Column):
proxy=True
class Query(graphene.ObjecType):
column = graphene.Field(ColumnType)
all_columns = DjangoFilterConnectionField(ColumnType)
and
class ColumnType(DjangoObjectType):
class Meta:
model = Column
filter_fields = ['sheet__name', 'name']
interfaces = (relay.Node, )
exclude_fields = [
'legislation_type', 'project_stat_type', ... # weirdly have to exclude these fields because the 'type' in the variable name makes the field introspector sad
]
my query is:
query {
allColumns(sheet_Name:"Simple Sheet") {
edges {
node{
id, name
}
}
}
}
Here’s the trace:
Traceback (most recent call last):
File "/Users/jonathanmares/.virtualenvs/quorum/lib/python2.7/site-packages/promise/promise.py", line 65, in try_catch
return (handler(*args, **kwargs), None)
File "/Users/jonathanmares/.virtualenvs/quorum/lib/python2.7/site-packages/graphql/execution/executor.py", line 375, in <lambda>
resolved
File "/Users/jonathanmares/.virtualenvs/quorum/lib/python2.7/site-packages/graphql/execution/executor.py", line 405, in complete_value
return complete_object_value(exe_context, return_type, field_asts, info, result)
File "/Users/jonathanmares/.virtualenvs/quorum/lib/python2.7/site-packages/graphql/execution/executor.py", line 499, in complete_object_value
field_asts
graphql.error.base.GraphQLError: Expected value of type "ColumnType" but got: FieldColumn.
I know this PR https://github.com/graphql-python/graphene-django/pull/156/files is waiting to be merged, but I tried running my query with the proposed changes and still get the same error.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Contact — Proxy Models
Send us your project details, and we will come back to you with a quote within 48 hours. studio@proxymodels.com WhatsApp (+49) 157 8731...
Read more >Supporting proxy models throughout Wagtail · Issue #4973
I think we can all agree that supporting proxy models is much simpler/cleaner when proxy models have their own ContentType , and model ......
Read more >Chapter 2 Development of Proxy Model (Less Rich Model ...
[^1] Here, we call proxy reservoir model because it is less rich in complexity and in addition is not fully based on solving...
Read more >MRA Part 2 – Proxy Model - NGINX
In this "proxy model", you would implement mutual tls between the proxy and the target. You can use one of many approaches to...
Read more >Causal Proxy Models for Concept-Based Model Explanations
In this paper, we show that robust causal explainability methods can be created using approximate counterfactuals, which can be written by ...
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
IRT #599, I’ve created #603 to try and better address this issue.
Let’s take this over to #603, thanks all.