edgedb-ui icon indicating copy to clipboard operation
edgedb-ui copied to clipboard

Unable to insert nested object in UI with duplicate property names

Open FinnRG opened this issue 8 months ago • 3 comments

I have two types called Song and ArtistForSong. Both of these objects have a property called name. When I try to insert ArtistForSong objects during an insertion of a Song the gel UI fails to commit the changes and throws the following error:

SchemaError: cannot create union (default::ArtistForSong | default::Song) with property 'name' it is illegal to create a type union that causes a computed property 'name' to mix with other versions of the same property 'name'
Image

FinnRG avatar Jul 16 '25 21:07 FinnRG

Can you give a minimal schema, and steps to reproduce the error? I'm trying to reproduce with the following schema, and the inserts from the screenshot, but I don't get the error.

type Artist {
  name: str;
}
type ArtistForSong {
  name: str;
  artist: Artist;
}
type Song {
  multi artists: ArtistForSong;
}

jaclarke avatar Jul 17 '25 13:07 jaclarke

@jaclarke I can reproduce the error with this schema:

module default {
    type ArtistForSong {
        optional artist: int64;
        optional name: str;

        single song := assert_single(.<artists[is Song]);
    }

    abstract type HasName {
        name := '';
    }

    type Song extending HasName {
        multi artists: ArtistForSong {
            constraint exclusive;
        };
    }
}

FinnRG avatar Jul 17 '25 17:07 FinnRG

Here is also a video just in case I am using the UI wrong

https://github.com/user-attachments/assets/703e7114-c41a-47cd-ad0c-0747da91d4d2

FinnRG avatar Jul 17 '25 17:07 FinnRG