3 ms·
It's recommended to use nesting in GraphQL objects (both inputs and responses) for backward- and future compatibility. But your problem is mostly because the A
by nivertech 5y ago
It's recommended to use nesting in GraphQL objects (both inputs and responses) for backward- and future compatibility.
But your problem is mostly because the API is not under your control.
In GraphQL backends it's OK to add special queries adapted for specific UI/UX (I think it's the whole idea behind the BFF - Backend-For-Frontend pattern).
I.e. you can choose between Design-first (data-centric) or Client-first (optimized for rendering on the Client/Front-end) GraphQL schema methodologies.
In the Client-first GraphQL schema you can have queries returning flattened data.
A non-standard approach is to run transformations, i.e. you specify directives how to transform the GraphQL operation responses. This can be for flattening, aggregations, calculating statistics, or joining results of the different queries.
https://www.graphql-mesh.com/docs/getting-started/mesh-transforms https://www.graphql-mesh.com/docs/getting-started/mesh-trans...