python-ts-graphql-demo icon indicating copy to clipboard operation
python-ts-graphql-demo copied to clipboard

Select only fields requested by graphql

Open Secretmapper opened this issue 4 years ago • 1 comments

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)

Secretmapper avatar Dec 02 '21 15:12 Secretmapper

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.

jokull avatar Dec 02 '21 15:12 jokull