python-ts-graphql-demo
python-ts-graphql-demo copied to clipboard
Select only fields requested by graphql
Currently, everything is returned. Can we use info to only select the specific columns we want?
The main problem is this would load all data which is a problem if the properties are expensive to compute (ie. sqlalchemy)
This is more of an issue on the depth level when you traverse relationships than opting in and out of columns for rows fetched. That being said, sure ... we can maintain a branch on this repo that shows how to achieve column level granularity for selection - based on the GraphQL query. I wouldn't do that level of optimization by default though.