[Tex/LaTex] How to draw graph with rectangular nodes

graphstikz-pgftikz-styles

I want to draw a graph, where nodes will be rectangular in shape, inside them I want to have some text, and some of the nodes should even be filled with a specific color of my choice. Apart from these, I also want to have a a small text right where the edge starts, something like in the picture below.

enter image description here

And as I said the nodes are rectangular. I tried something like below, but it doesn't even display anything. Any ideas how to achieve stuff I want?

\usepackage{tikz}
\usetikzlibrary{shapes}

\begin{document}

\begin{figure}[H]
    \begin{tikzpicture}[auto,node distance=5 cm, scale=1, transform shape]

    \node[rectangle] (1) {1};
    \node[rectangle] (2) {2};
    \node[rectangle] (3) {3};

    \path[->] (1) edge [left]  node (2)
              (1) edge [right] node (3);
    \end{tikzpicture}
\end{figure}

\end{document}

Best Answer

enter image description here

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{positioning, quotes}

\begin{document}
    \begin{tikzpicture}[
    node distance = 12mm and 6mm,
       box/.style = {rectangle, draw, fill=#1, 
                     minimum width=12mm, minimum height=7mm}
                        ]
\node (n1) [box=blue!10] {1};
\node (n2) [box=white,below  left=of n1] {2};
\node (n3) [box=white,below right=of n1] {3};
%
\draw[->] (n1) to ["some text" '] (n2);
\draw[->] (n1) to ["some text"  ] (n3);
    \end{tikzpicture}
\end{document}

Edit: According to your comment see if the following solution is what you looking for:

enter image description here

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{backgrounds, scopes, positioning}

\begin{document}
    \begin{tikzpicture}[
     node distance = 12mm and 6mm,
every label/.style = {label distance=3pt, fill=white, inner sep=1pt},
        box/.style = {rectangle, draw, fill=#1,
                     minimum width=12mm, minimum height=7mm}
                        ]
\node (n1) [box=blue!10, label=below:some text] {1};
\node (n2) [box=white,below  left=of n1] {2};
\node (n3) [box=white,below right=of n1] {3};
%
\scoped[on background layer]
    \draw[->]   (n1) edge   (n2)    (n1) to     (n3);
    \end{tikzpicture}
\end{document}

From comments can be concluded that you actualy like to draw a tree of nodes. In this case you should consider different approach in which probably the best way is to use package forest.