Adding a child of a one to many relationship while updating the parent

You can do a mutation like this:

mutation {
  updateParent( input: { 
        filter: { 
          nome: ["parent-ID"] 
        },
        set: { 
            children: [{nome: "example"}],
        }
    }) {
      parent {
        nome
        children {
          nome
        }
      }
    }
  }
1 Like