Diffraction (not "refraction" ) is determined by sensor size (extent of enlargement to make a certain print size), and resolution. Assuming a standardized print size and viewing distance (8x10"/8x12" print is typically what's used for comparison)... A 12MP FF camera will show initial effects of diffraction beginning at f/12.7, and more importantly diffraction limits extinction resolution at f/15.9. Smaller than that, you will see increased effect of diffraction.
For comparison, a 21MP FF camera shows initial effects at f/9.6 and limits at f/12. And a 20MP 1.6X APS-C camera will show initial effects at f/6.2 and limits at f/7.7 (this is largely because more enlargement is needed to make the same size print).
What this means is that there
begins to be loss of fine detail at these apertures, with these size and resolution sensors. It gradually increases with smaller apertures and will be more apparent in larger prints viewed closer than usual.
Concerns about diffraction limits runs counter to desire to use a small aperture to increase depth of field. DoF is determined by focal length, aperture diameter and distance. In other words, DoF is lens-related, while diffraction is camera-sensor-related, and the two are somewhat at odds with each other.
But, there are other considerations. Lens resolving power, sensor resolution, the strength of anti-aliasing filter used on the camera's sensor are all factors that will determine image qualities and how enlargeable images will be. Even atmospheric conditions can come into play.
And there are "work-arounds". For example, focus stacking is a technique to increase depth of field in a finished image without resorting to extremely small apertures.
You can read a lot more about diffraction and its effects here:
http://www.cambridgeincolour.com/tutorials/diffraction-photography-2.htmAnd here:
https://luminous-landscape.com/understanding-lens-diffraction/I would recommend you set up and take a bunch of shots with your own cameras and lenses at various aperture, to become familiar with how they render fine detail in images, to find your own acceptable limits. Might be quite different than the theoretical limits. All you need is a nice, flat target with lots of fine detail (a brick wall or a weathered fence might work well).