GDPR allows sharing & processing your data if it can be reasonably assumed that it’s necessary for providing the service and in the user’s benefit.
If WHOIS is how domain business works then there shouldn’t be a problem? It’s necessary for you to get the domain which would also be in your benefit if you’re buying a domain?
See: 6(1)(a) to 6(1)(f)
Correct me if I’m wrong :)