When we are using graphqlHTTP, the first argument passed to the resolve method is actually the parameters passed by the client query not root this is fine for a query resolver. But for a usecase where field resolver needs to know of a value of the parent, how to achieve this?
type Person {
name: String,
cityId: String,
city: City,
}
In the above scenario I would like where city would be a field resolver, and it needs access to cityId which is a property on parent type. I assume this should have been passed as parameter to the field resolver but that is not the case. Is there a way to achieve this?
I see same can be done when schema is declared using objects, in that case the firs value passed to resolver functions is root.