Fork me on GitHub

Is is possible to make the parser use idents in nested queries and put the node at the top level of the output to avoid repetition? Example:

{[user/id "x"] {:user/name "bob}
 :comments [{:message "yo" :>/user [:user/id "x"]}
            {:message "hi" :>/user [:user/id "x"]}]}


from pathom perspective, no, ident normalization is not a concept in pathom, given in Pathom idents just mean setting a value. this also respects a principle that the shape of the response must match the shape of the query, this avoids the user having to deal with complicated things to understand the output shape, by always being the same is simple and predictable


what you can do is write some post-processing plugin to move things around after the response is built, makes sense?


is the placeholder plugin a post processing too? Because what I want to do is basically instead of putting the content, put the indent and move the content to the top level


I don't fully understand yet what you are trying to do. can you send a more complete example, with the queyr, and an example of the result structure you are trying to achieve?


The motivation for that being obviously that it can drastically reduce the size of the response, and it also fits much better with libraries like re-frame which will be perfectly capable of exploiting normalized data like this, instead of having to re-parse and normalize client side