Question: When does the resolve for movies get executed for a directorType? Does it run the function every time you call for a director, or does this code run beforehand and is cached in case the user makes a call for a director's movies?
It would run every time you call for a director. And in a Real application that resolve function may end up calling a DB or making a HTTP request.
To make this more efficient a cache could be implemented so that the DB or HTTP call can be avoided whenever possible. But the cache implementation would be specific to your application.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for the tutorial Aditya!
Question: When does the resolve for movies get executed for a directorType? Does it run the function every time you call for a director, or does this code run beforehand and is cached in case the user makes a call for a director's movies?
Thanks!
That's a really good question.
It would run every time you call for a director. And in a Real application that resolve function may end up calling a DB or making a HTTP request.
To make this more efficient a cache could be implemented so that the DB or HTTP call can be avoided whenever possible. But the cache implementation would be specific to your application.