Singularities frequently appear in the solution of PDEs when the computational domains has edges, interfaces or corners. A popular technique for 2D problems is to include the singularity, if it is known, into the approximation space. This is less feasible for 3D problems, as it becomes harder to analytically characterise the singularities. An alternative is to resolve the singularities, for which the predominant approaches in finite element methods use mesh refinement. It is customary in hp-methods in particular to use geometrically graded meshes. We first survey known results on the resolution of singularities on graded meshes. Yet, the main topic of the talk is its similarity to approximation by rational functions. We demonstrate that similar mathematics underlies both approximation by piecewise polynomials and approximation by rational functions with clustered poles. This is true beyond univariate functions: singular behaviour of PDE solutions near edges can be resolved to high accuracy using multivariate piecewise polynomials or using multivariate rational functions, with the latter being relatively unexplored in comparison. This talk is based on joined work with Nicolas Boullé, Astrid Herremans and Nick Trefethen.