This is awesome but how do you deal with circular references?
{
"user": [
{ "id": 456, "name": "Sita K", "user_id": 123 },
{ "id": 123, "name": "John Doe", "user_id": 123 }
]
}
Do you have anything else in mind?PS: Co-author here
query {
user {
id
name
childUser: userByUserId {
id
name
}
}
}
The response would be: {
"data": {
"user": [
{
"id": 123,
"name": "John Doe",
"childUser": {
"id": 123,
"name": "John Doe"
}
},
{
"id": 456,
"name": "Sita K",
"childUser": {
"id": 123,
"name": "John Doe"
}
}
]
}
}
Did I answer your question?I was thinking you could replace or supplement the real user IDs with their indices in the array of returned users.
https://stackoverflow.com/questions/6163683/cycles-in-family...