Hacker News new | ask | show | jobs
by dobs 2758 days ago
One service-to-service case where I've found GraphQL extremely useful is report generation.

For example, in one case we had around a dozen services with fairly typical REST APIs, a few of which we wanted to pull large inter-related sets of information from. Using GraphQL allowed us to:

- Have a single large-but-human-readable query to retrieve all report data.

- Analyze deep nesting up front to determine opportunities for caching and eager loading.

- Abstract details regarding what data was coming from what service, plus handle any quirks (e.g. inconsistent auth strategies) at the GraphQL layer.

Without having to make many modifications to the underlying services. We also saw a two-order-of-magnitude performance improvement that would otherwise have required building out a lot of service-specific awareness into our reporting service.

Granted reporting is a unique case, but the simplified gateway layer and potential for query analysis are also major advantages as the number of API consumers grows.