Refugee problem will always involve racism no matter what. Both cant be divorced.
If people remember the european refugee crisis whole rehtoric was racism. In the usa its the same story.
In Turkeys case its never been racist. We have taken millions of refugees over the decades. The recent issue is the sheer scale of it. Under 20 years of erdogan we could have taken in over 10 million refugees, mainly kurds and arabs, then after that afghans, pakistanis, north africans mainly from libya, egypt.
The problem facing Turks is that culturally these people are very different. Most Turks want to live a western lifestyle, individual liberties and freedoms as well as economic prosperity. Even the biggest erdogan supporters on this forum are living in the west, they won't give that up to go live in erdogans Turkey. Most refugees are coming from cultures that don't tolerate these sorts of things.
So potentially the massive influx aids Erdogan's sharia dictatorship state ambitions. He won't achieve it with ethnic Turks, but if he floods the country with people who are easier to fool over Islamist dictatorship then he does it. Some people will ignore this, but erdogan even went on record once saying the UK has the queen" why shouldnt Turkey have something similar. And what he meant is he wants a privileged untouchable position for his family.
None of this is happening by chance, the borders were demined on erdogans orders by an Isreali company for a purpose. Then at the height of the syrian civil war when you needed those people to stay and fight assad and not to leave the regions the PKK had their eyes on, he tells them to come to Turkey.
In nature the fool always gets crushed, if Turks want to continue to decieve themselves dont be surprised if Turkey doesnt exist in 100 years time. Its worth reading Ataturks great speech to get an idea of how close Turks came to extinction at the end of world war one.