public function buildRelationshipData($type, $ids)
    {
        if ($ids === null || (is_array($ids) && empty($ids))) {
            return null;
        }

        // one relationship to add
        if (is_string($ids)) {
            return [
                'type' => $type,
                'id' => $ids
            ];
        }

        // many relationships to add
        $data = [];
        if(!empty($ids)) {
            foreach($ids as $id) {
                $data[] = [
                    'type' => $type,
                    'id' => $id
                ];
            }
        }
        return $data;
    }