openbeta-graphql icon indicating copy to clipboard operation
openbeta-graphql copied to clipboard

Create an "update parent" mutation

Open vnugent opened this issue 3 years ago • 1 comments

Use case

I want to move an area to be under a different parent.

To do:

  • [ ] Update parent id
  • [ ] Update path tokens (look at area renaming code for ways to recursively update children's paths)
  • [ ] Update ancestors
  • [ ] Unit test

vnugent avatar Sep 06 '22 12:09 vnugent

I've been needing this for a while and have decided to tackle it in connection with another feature I am needing - which would benefit greatly from knowing how group structures are changed and validated.

I will create a PR soon, but the gist is that I am going to add a new field to the area collection by the name of 'parent'. This is the source of truth from which

  • path tokens
  • ancestors
  • children

will be derived (Not to mention my other structure hierarchy query will be able to run 2-4x faster through the mongo pipeline)

CocoisBuggy avatar Nov 07 '24 17:11 CocoisBuggy