Anyone had experience with an afterware that modifies the response data?
const parseResponse = new ApolloLink((operation, forward) => {
return forward(operation).map((response) => {
response.data.parsed = transformData(response.data)
return response
})
})
const link = parseResponse.concat(networkLink)
This works great on websockets events - the data is transformed, added to this parsed
field in the data response.data
, but on a regular <Query...
request, the parsed field is deleted so the component can't read it. I've confirmed that this method is called correctly in query requests and that the parsed
field is added as well, but somewhere between the afterware and the component the parsed
field gets stripped