# Edge nodes, auto and node distance

Consider the following MWE

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0)--(1,1) node[auto,midway] {$A$}
-- (2,0) node[auto,midway] {$B$};
\end{tikzpicture}
\end{document}

I am using auto here to get automatic left/right positioning. However, I am not satisfied with the distance between the edge labels and the edge itself, which is a bit too large (my real example is a picture with much more nodes in it, so there is room for confusion if they are not very close).

Is there a way to alter this distance? I tried adding node distance=something almost everywhere, but it seems to be ignored.

-