You’re not supposed to connect an external GPU to the Steam Deck, but someone did it anyway.
youtuber ETA Prime managed it, allowing him to play games like Elden Ring at 4K with maxed out settings. Valve has repeatedly said that external graphics cards are not compatible, but ETA Prime made it possible anyway.
They managed it by using Steam Deck’s M.2 PCIe x4 socket, which is normally intended for storage. ETA Prima used an external graphics card M.2 dock that goes into the storage socket on one side and the graphics card on the other. That only allows the Steam Deck to use four slivers of PCIe, but it still worked. To complete the build, ETA Prime connected both the M.2 dock and graphics card to a standard ATX power supply.
Since SteamOS does not natively support external graphics cards, ETA Prime had to boot Windows 11 from a microSD card. Ultimately, he uses a USB-C hub to connect accessories such as a mouse and keyboard. Although he tried it with several Nvidia graphics cards, it only worked with AMD. Presumably because of the AMD architecture used for the Steam Deck.
Obviously this is not recommended to do yourself. The whole point of the Steam Deck is that it is portable. That said, one of the strengths of the Steam Deck is the ability to connect an external monitor for a traditional mouse and keyboard setup.