Dariusz Kuc
01/09/2020, 1:30 PMgraphql-java
world there is really no need for the data loader, e.g.
class Employee(val name: String, private val companyId: Int) {
suspend fun company() = myCompanyService.load(companyId)
}
there are number of ways of how to expose the myCompanyService
in the aboveRobert
02/08/2020, 7:46 PMDarren
02/11/2020, 4:55 PMRobert
02/11/2020, 5:02 PMDariusz Kuc
02/11/2020, 5:58 PMan output type shouldn’t have a service dependencywhy not? your output classes don't have to be simple data classes/POJOs and if you were to use them as such you will be severely limiting yourself (e.g. functions will only be invoked if your query requests for it vs fields get calculated always)
Darren
02/11/2020, 6:51 PMDariusz Kuc
02/11/2020, 6:55 PMRobert
04/29/2020, 7:38 AMDarren
05/07/2020, 9:54 PM@Fetchable
. A custom data fetcher factory looks for properties with that custom annotation.
This also lets us define the contract for how we resolve a related object (e.g. a product has a category, but must expose the category id for the data fetcher to resolve the related category)