SerializerMethodResourceRelatedField does not include a meta section in the relationship response like ResourceRelatedField does. This doesn't make sense, because SerializerMethodResourceRelatedField extends ResourceRelatedField and both seem to return every related record in the response (for the record I've only tried with a little over a thousand related records).
So for example if you had an ObjectA with a has many relationship with ObjectB:
objectbs = SerializerMethodResourceRelatedField(
source='get_objectbs',
many=True,
model=ObjectB,
read_only=True
)
def get_objectbs(self, obj):
return ObjectB.objects.filter(objecta=obj)
then your response would look like:
"relationships": {
"objectb": {
"data": [...]
}
}
instead of:
"relationships": {
"objectb": {
"meta": {
"count": 2
},
"data": [...]
}
}