The _relationHasResource is invoked on a resource when we want to add another resource to a relation. It needs to say "return true if this resources list of related resources already includes this new resource", thus de-duplicating related resources.
If we make a new resource A and add a related resource of B it'll look something like this:
A => [ B ]
If we then try and add B again, we need to de-duplicate it as-per the JSON:API spec.
The
_relationHasResource
is invoked on a resource when we want to add another resource to a relation. It needs to say "return true if this resources list of related resources already includes this new resource", thus de-duplicating related resources.If we make a new resource
A
and add a related resource ofB
it'll look something like this:If we then try and add
B
again, we need to de-duplicate it as-per the JSON:API spec.