Open AndresPrez opened 2 years ago
Apologies for the delay getting this reviewed, I'm traveling this week so it might take a few more days before I can get this reviewed and merged. I'll aim to do so by early next week at the latest. Thank you so much for submitting this! It looks like a great improvement.
@chanind Ive added a new Rewriter:
FieldRewriter
inspired by theScalarFieldToObjectFieldRewriter
and aCustomRewriter
to allow custom implementation of the Rewriter public methods.PR should be backwards compatible and comes with unit tests.
New functionalities:
ScalarFieldToObjectFieldRewriter
, but it can also rename the field in question.nodeAndParent
context variable to rewriteResponse fn: Useful for response rewrites that need to know what the query was initially (e.g, for__typename
response rewrites).