Please:

```js
if (isSympleQuery(queries))
  return getAllChildren([], { id: queries[0].folder }); 
```

and move all this explanations and logic to that function.