The [REST API] uses server-driven fixed data responses, which means a developer (client) can’t determine the result of the response.
To create new microservices, developers using these REST APIs have been looking for ways to minimize over-fetching and under-fetching when retrieving data along with business logic.

[GraphQL] provides a client-driven query language and runtime to prevent this overhead on the client-side and instead retrieve the exact data that the REST API requires. When GraphQL came out, many developers thought that it could replace existing REST API specifications. However, it’s not a replacement but an alternative.

#java #api #rest api #graphql #combine graphql with java

Combine GraphQL With Java to Build a Flexible and Modern API
1.20 GEEK