3 ms·
You can cache the objects in the query by ID. And then reuse them across a number of queries. > It's not like in REST where the request tells you exactly and
by ojkelly 4y ago
You can cache the objects in the query by ID. And then reuse them across a number of queries.
> It's not like in REST where the request tells you exactly and precisely what resource the client wants to access.
It can be. You can have a query that does `getObject(id: $id): Object`.
> Adds overhead on the server side.
Yep it pulls a heap of complexity around data fetching, synchronisation, and data modelling from the client to the server.
As it requires both the client and server to come to some agreement about a shared data model, it can appear as more work up front. But it enables a decoupling of the client and server such that the client can make requests for new use cases with the existing shared data model.