This can happen if you overcook the cheese sauce. You want to just melt the cheese into the sauce, not boil it. This will prevent it from tasting grainy.