For example, we have an entity called ServiceConfig
that contains a pointer
to a Service
and a Professional
. If returned without including the fields would look like this:
{
'type': '__Pointer',
'className': 'Service',
'objectId': 'q92he840'
}
At which point they could query again to retrieve that service. However, it is often the case that they need the Service
name. In which case it is inefficient to have to query again to get the service every time.
Options:
Automatically return the
Service
. In which case, we should automatically return theIndustry
for thatService
as well in case they need that... same applies to all. Seems like we're returning data too often here.Allow them to pass an
includes
parameter that specifies which entities to include. Format is an array of strings where using a.
can allow them to include subclasses. In this case['Professional', 'Service.Industry']
would work.
Can anyone identify why any one solution would be better than the others? I feel that the last solution is the best, however it does not seem to be common to do to in the APIs I've seen.