Replies: 5 comments 1 reply
-
This feature also has some good security uses, like when you only want to expose certain fields on a model. |
Beta Was this translation helpful? Give feedback.
-
This is the first thing I looked into doing after I installed this package. Even if there were a way to get at the fields that were requested, I could do the restriction in the resolver function manually. But I don't see a way to get at that information on Is there away to get at the fields requested ? |
Beta Was this translation helpful? Give feedback.
-
Was dealing with the same issue. Have a looksie under https://stackoverflow.com/questions/50502781/limiting-sql-query-to-defined-fields-columns-in-graphene-sqlalchemy/50770611#50770611 |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
A query like this:
Executes the exact same SQL as this:
They also both select all columns and not only the ones we are asking for. (only tested on sqlite but assume postgresql would be the same behavior) |
Beta Was this translation helpful? Give feedback.
-
Hi,
I have a relatively wide database table and use graphene to fetch maybe one or two fields from it. At the moment with the Django ORM it will fetch the entire record by default. Is there a way to integrate the only('col1', 'col2') for each column or field requested in the query? This should make the whole process much faster especially on wide tables where one wants maybe all records from one column.
Maybe there is a way to do this already?
Beta Was this translation helpful? Give feedback.
All reactions