Sorry I was not clear, I’ll will give a little more context.
I have 2 nodes Comment and Author:
Node Comment:
- uid
- content: string # The comment message
- authored: uid # Predicate to the node author
- comments: uid # Predicate the the other comments (for recursion)
Node Author:
- uid
- author_name string
My goal is to display on the front-end (web app) all the comments with for each comment the associated author_name.
With the recursive query on comments, I cannot retrieve the author_name because it breaks the “one level predicate recurse limitation”.
Thus it seems the only way I found to retrieve the author_name is by adding the following steps:
- First I update the schema and I add the “author_id” directly as string because this one can be retrieved on the recursive query.
Node Comment:
- uid
- content: string # The comment message
- author_id: string # ADDED to be retrieved on the recursive call
- authored: uid # Predicate to the node author
- comments: uid # Predicate the the other comments (for recursion)
Node Author:
- uid
- author_name string
- I execute the recursive query. In the response I retrieve programmatically all the author_id and I create a second query that given my list of “author_id” retrieves the “author_name” which is the one I wan to display on the front-end side.
Thus, I find this solution quite cumbersome. That’s why I’m asking if I’m doing something wrong and if there is an easiest alternative ?