A convex polygon has at least one side with length $1$. If all diagonals of the polygon have integer lengths, at most how many sides does the polygon have?

$ 
\textbf{(A)}\ 3
\qquad\textbf{(B)}\ 5
\qquad\textbf{(C)}\ 7 
\qquad\textbf{(D)}\ 10
\qquad\textbf{(E)}\ \text{None of the preceding}
$
1. Let \( A_1A_2\cdots A_n \) be a convex polygon with \( A_1A_2 = 1 \). We need to determine the maximum number of sides \( n \) such that all diagonals have integer lengths.

2. Consider the triangle inequality for \( n \geq 6 \). For any three vertices \( A_1, A_2, A_4 \), the triangle inequality states:
   \[
   |A_1A_4 - A_4A_2| < A_1A_2 = 1
   \]
   Since \( A_1A_2 = 1 \), we have:
   \[
   -1 < A_1A_4 - A_4A_2 < 1
   \]
   This implies:
   \[
   A_1A_4 = A_4A_2
   \]
   Similarly, for \( A_1, A_2, A_5 \):
   \[
   A_1A_5 = A_5A_2
   \]

3. Since \( A_4 \) and \( A_5 \) must lie on the perpendicular bisector of \( A_1A_2 \), and they cannot be on the same perpendicular bisector due to the convexity of the polygon, it follows that \( n < 6 \).

4. For \( n = 5 \), consider the polygon \( A_1A_2A_3A_4A_5 \). We need to check if it is possible to have all diagonals with integer lengths without violating the convexity condition.

5. Let \( A_4A_1 = A_4A_2 = 3 \). Define \( C_1 \) as the circle centered at \( A_1 \) with radius 3, and \( C_2 \) as the circle centered at \( A_2 \) with radius 3. Let \( A_5 \) be a point on \( C_2 \) and inside the angle \( \widehat{A_4A_2A_1} \).

6. Let the circle centered at \( A_5 \) with radius 3 intersect \( C_1 \) at \( A_3 \). Then, \( A_1A_2A_3A_4A_5 \) forms a convex polygon with each diagonal having integer lengths.

7. Since we have constructed a valid convex polygon with \( n = 5 \) sides and all diagonals having integer lengths, and we have shown that \( n \geq 6 \) is not possible, the maximum number of sides is 5.

The final answer is \(\boxed{5}\)