3 ms·
I quite like GraphQL, but only as a filter and composition layer in addition to a REST interface. REST gives elegance to the non-GET operations and it is only
by buro9 11y ago
I quite like GraphQL, but only as a filter and composition layer in addition to a REST interface.
REST gives elegance to the non-GET operations and it is only the caching, JSON size, and composition of multiple resources that can sometimes be a strain for some applications (or all applications if the REST API is designed badly).
I'm probably going to investigate providing a common GraphQL query interface to my REST API. This would internally be an orchestration layer providing the filtering of properties as well as the composition of resources, and of course the instructions to that layer would be GraphQL queries. This would allow internally cacheable resources (perhaps via ESIs) and the filter would be applied in front of the cache layer.
I'm not yet at the point where I think GraphQL replaces REST, instead it complements it.