-
Notifications
You must be signed in to change notification settings - Fork 765
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Limit fields fetched from database for graphene-django #402
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
This feature also has some good security uses, like when you only want to expose certain fields on a model. |
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 ? |
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 |
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. |
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) |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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?
The text was updated successfully, but these errors were encountered: