Moving from REST to GraphQL
In today’s RESTfull world we fetch data from server using provided endpoint - where model on the server is tightly coupled with the view on the client.
When client asks to add new feature or UX designer wants to update the view, models on the server needs to be updated.
It results in creating new version for that endpoint. If we have different clients running different version of the app - we end up supporting multiple version of same endpoint and it could lead to fairly serious code debt.
On using graphql, server returns complete set of possibility that it could fulfill and client has to pick one which suits it.. So now models and view both are owned/choose by clients and need not depend on server. This way we can decouple them and create more robust microservices. Multiple client could run on different version and server doesn’t have to care about that any longer !
graphql is backed by code not by storage it’s all about leveraging existing code.
- Core principles.
- Query Syntax
- Server architecture.
Dhaval is Passionate about technology and Programming, He has expertise on api design and data modeling.