You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wanted to know if there is a way to load from a resolver from within a resolver.
That is:
A resolver for type Bookstore, which has several FieldResolvers (loading from different dbs).
I am writing a resolver for type BookstoreInspector.
Within BookstoreInspector, given a Bookstore id should return the results of the inspection.
e.g.
@ResolverexportclassBookstoreInspector{
@Query(returns=>[InspectionResult])inspect(@Arg("id")id, @Ctx()ctx: Context){// need to load the whole Bookstore (with FieldResolvers resolved, etc.)varbookstore=query.getBookstore(id)// effectively running a query here.// I can't just grab from db, as the fieldresolvers have a lot of code grabbing data from here and there and modifying itvarresults=inspect(bookstore)returnresults}}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Wanted to know if there is a way to load from a resolver from within a resolver.
That is:
Within BookstoreInspector, given a Bookstore id should return the results of the inspection.
e.g.
Thoughts?
I hope it's just my lack of understanding!
Beta Was this translation helpful? Give feedback.
All reactions