assume I have schema like this
type Result{
fieldA: TypeA,
fieldB: TypeB,
# other fileds ...
}
fieldB is computed based on fieldA like:
function getData(){...}
function transformData(){...}
resolverA:()=>getData()
resolverB:()=>transformData(getData())
queries could ask for either/both or non of field A/B
assume both getData() and transformData() are expensive operations,
how do I write the resolvers so that :
1) resolverB use the resolved data from resolverA
2) getData only gets called once when both AB fields are in the query
3) None of getData/transformData gets called when only asking for other fields