async def test_reused_operation_ids(ws: WebSocketClient):
    """Test that an operation id can be re-used after it has been
    previously used for a completed operation.
    """
    # Use sub1 as an id for an operation
    await ws.send_message(
        {
            "id": "sub1",
            "type": "subscribe",
            "payload": {"query": 'subscription { echo(message: "Hi") }'},
        }
    )

    next_message1: NextMessage = await ws.receive_json()
    assert_next(next_message1, "sub1", {"echo": "Hi"})

    complete_message: CompleteMessage = await ws.receive_json()
    assert complete_message == {"id": "sub1", "type": "complete"}

    # operation is now complete.  Create a new operation using
    # the same ID
    await ws.send_message(
        {
            "id": "sub1",
            "type": "subscribe",
            "payload": {"query": 'subscription { echo(message: "Hi") }'},
        }
    )

    next_message2: NextMessage = await ws.receive_json()
    assert_next(next_message2, "sub1", {"echo": "Hi"})
Test that an operation id can be re-used after it has been
    previously used for a completed operation.
    
tests/websockets/test_graphql_transport_ws.py