Skip to content

How to modify response data #7209

Answered by tonxxd
tonxxd asked this question in Q&A
Nov 30, 2022 · 3 comments · 1 reply
Discussion options

You must be logged in to vote

I managed to solve by checking that response.body.singleResult.data contains other keys in addition to __schema.
Only at that point the willSendResponse response contains the final response.

if (Object.keys(omit(response.body.singleResult.data, "__schema")).length > 0){
  console.log(omit(response.body.singleResult.data, "__schema"))
  // {"entities": [{"id":1}, ...]}
}

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by tonxxd
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@glasser
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants