private function updateUriQuery(): void
    {
        $sort = [];
        foreach ($this->order as $field => $direction) {
            if ($direction === self::ORDER_ASC) {
                $sort[] = $field;
            } elseif ($direction === self::ORDER_DESC) {
                $sort[] = '-' . $field;
            }
        }

        $fields = [];
        foreach ($this->fields as $type => $fields) {
            $fields[$type] = implode(',', $fields);
        }

        $query = [
            'sort' => implode(',', $sort),
            'pagination' => $this->pagination,
            'filter' => $this->filter,
            'include' => implode(',', $this->includes),
            'fields' => $fields
        ];

        $this->uri = $this->uri()->withQuery(http_build_query($query));
    }