Skip to main content

Simple Remappings  

Sometimes, you may want to rename a property that is returned from a traversal. You can access properties of an item by using the name of the property as defined in the schema.
You can use the name directly, or if you want to be more explicit, or in cases where there may be name clashes, you can use the _:: operator.
When using the SDKs or curling the endpoint, the query name must match what is defined in the queries.hx file exactly.

Example 1: Basic property remapping

Here’s how to run the query using the SDKs or curl

Nested Mappings  

The important thing to note here, is that if we were to access the ID like we have shown previously: nested_field: ID. This ID would be the ID of the other item, not the item_name item due to the tighter scope.
When accessing properties in nested mappings, scope matters. Use the explicit item_name::property syntax to access properties from outer scopes to avoid ambiguity.

Example 1: User posts with nested remappings

Here’s how to run the query using the SDKs or curl