Variable: query-replace-interactive

Non-nil means `query-replace' uses the last search string.
That becomes the "string to replace".