This is called for each query before it is executed. You can modify the query by
transforming its OperationNode tree provided in args.node
and returning the transformed tree. You'd usually want to use an OperationNodeTransformer
for this.
If you need to pass some query-related data between this method and transformResult you
can use a WeakMap with args.queryId as the key:
You should use a WeakMap instead of a Map or some other strong references because transformQuery
is not always matched by a call to transformResult which would leave orphaned items in the map
and cause a memory leak.
This method is called for each query after it has been executed. The result
of the query can be accessed through args.result.
You can modify the result and return the modifier result.
This is called for each query before it is executed. You can modify the query by transforming its OperationNode tree provided in args.node and returning the transformed tree. You'd usually want to use an OperationNodeTransformer for this.
If you need to pass some query-related data between this method and
transformResultyou can use aWeakMapwith args.queryId as the key:You should use a
WeakMapinstead of aMapor some other strong references becausetransformQueryis not always matched by a call totransformResultwhich would leave orphaned items in the map and cause a memory leak.