Change mutation from update to upsert

The change allows to pass a key id or name for an entity that is not already existing.