The gross domestic product (GDP) measures the monetary status of the market value of all final goods and services. With this definition therefore, the GDP of all these transactions only account the selling the final product, hamburger.
Add to GDP = 10,000 * $5
Add to GDP = $50,000