Open
Description
I have read #26 , #700 and #304 . It seems like there is no well-agreed way to combine GraphQL and database. GraphQL.js loses a certain amount of chances to do query optimization. Am I right? I have a simple proposal. In the resolve
function, we can return a DeferredObject instead of a normal JS object or Promise. Only in the very last moment, the deferred object queries the DB. Does this make sense?
The special DeferredObjects links with each other. So the minimal query fields needed can be detected. GraphQL.js may finally call await someDeferredObject.excute()
multiple times. Since we have ES6 getter and setter. I think it may be quite seamless to current code base.