Example: (Using https://jsonplaceholder.typicode.com)
class BaseResource extends Resource {
static client = new CustomClient('https://jsonplaceholder.typicode.com')
}
class UserResource extends BaseResource {
static endpoint = '/users'
}
class TodoResource extends BaseResource {
static endpoint = '/todos'
static related = {
userId: UserResource
}
}
const todo = await TodoResource.detail(1) // GET /todos/1
const name = await todo.resolveAttribute('userId.name') // GET /users/1
// UserID 1 does not show up in cache
console.log(UserResource.cache[1])