Is it possible to access the complete response on the server before returning it to the frontend?
I have tried extracting this information from the top-level resolver query (waiting after retrieving the sub-graphs) but it seems that the sub-graph objects are not being populated properly (only showing the ID).
export const resolvers = {
Query: {
sifKeysDeep: async (_, { clientId, ids, state }, { dataSources }) => {
// I expected an await here to provide the aggregate result, but it doesn't
return dataSources.sifAPI.getKeysDeepById(clientId, ids, state);
}
export const SifKeyDeep = `#graphql
type SifKeyDeep {
...
G0: SifOpt // Instead of getting the object from the top query, I only receive the ID
Is there a server-side hook that enables me to access the fully loaded query (aggregate) result before sending it to the client?
I want to store the final result in my memory cache.
As I am new to GraphQL, my terminology may be incorrect. Please let me know so I can clarify.