GraphQL Query to fully expand a hierarchical property #5110
-
I am putting a Graph QL layer over an API which has within its response a recursive list as a hierarchy for location. Definition of Location class
As you can see, this can effectively go infinitely deep, but in reality it wont, but I have no idea how deep it would go. How do I write a GraphQL request to fully expand each location |
Beta Was this translation helpful? Give feedback.
Answered by
PascalSenn
Jun 1, 2022
Replies: 1 comment
-
@bo55vxr this is not possible in GraphQL. Recursive structures have to be fetched in batches. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
bo55vxr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@bo55vxr this is not possible in GraphQL. Recursive structures have to be fetched in batches.
You can e.g. fetch the first three layers and then execute another query to fetch another three layers based on the Ids