Another option is to use
echo -e "{query}\n" >> ~/Desktop/cap.txt
echo -e "{query}
The -e flag "enables interpretation of backslash escapes". The \n is a newline character, so just add one for each new line you want. Or, if you wanted to add a tab, it just add \t, which could work nicely when adding a timestamp:
echo -e "$(date +"%e %B %Y %H.%M")\t{query}\n" >> ~/Desktop/cap.txt
echo -e "{query}"