public function patch($selection, $operations = null)
    {
        $isPatch = $selection instanceof Patch;
        $patch = $isPatch ? $selection : null;

        if ($isPatch) {
            $this->operations[] = ['patch' => $patch->serialize()];
            return $this;
        }

        if (!is_array($operations)) {
            throw new InvalidArgumentException(
                '`patch` requires either an instantiated patch or an array of patch operations'
            );
        }

        $sel = (new Selection($selection))->serialize();
        $this->operations[] = ['patch' => array_merge($sel, $operations)];
        return $this;
    }