Goals:
- Write resolvers that allow you to do "complex" queries in one pop, such as fetching the entire definition of an object
- "Push" updates so that the slowest endpoint doesn't hold up the entire request
// Create a fetcher. Fetches some data
const fetchBook = createFetcher(
// The fetcher
(movieId) => {
return fetch(`/books/${movieId}`);
},
// The transformer
(result) => result.book)
);
// Actually do the fetch
fetchBook('1042');
// okay, how about when you need to fetch the book for an author?