Utils#

Subgrounds request/response transformation layers module

This module defines interfaces (abstract classes) for transformation layers. Transformation layers, or transforms, can be applied to entire requests (see RequestTransform) or on a per-document basis (see DocumentTransform). Classes that implement either type of transforms can be used to perform modifications to queries and their response data.

For example, the TypeTransform class is used to tranform the response data of BigInt and BigDecimal fields (which are represented as strings in the response JSON data) to python int and float respectively (see the actual transforms in DEFAULT_SUBGRAPH_TRANSFORMS).

Transforms are also used to apply SyntheticField to queries and the response data (see LocalSyntheticField transform class). Each SyntheticField defined on a subgraph creates a new transformation layer by instantiating a new LocalSyntheticField object.