public function fromRelationshipType($type)
    {
        $relationships = $this->getRelationshipsThatMatchType($type);

        if (count($relationships) === 0) {
            return null;
        }

        $resource = reset($relationships);

        return new RelationshipResource(
            key($relationships),
            $resource
        );
    }