The switch from REST to GraphQL was motivated by the limitations faced with REST in terms of frontend teams getting blocked, inefficient data fetching, and managing bloated APIs.
The flexibility of data requirements was a key factor in the decision to switch to GraphQL, allowing for a single schema to be exposed for clients to pull exactly what they need.
With GraphQL, frontend autonomy improved, the number of endpoints decreased significantly, precise responses were sent matching UI requirements, and auto-generated documentation streamlined onboarding.
Challenges encountered after the switch included difficulties in caching, complex authorization at the field level, N+1 query nightmares, weaker error monitoring, and a learning curve for the team, emphasizing the need for proper planning and training.