I'm having trouble with the code snippet below. It seems like the K generic is not being treated as a union, causing unexpected behavior. Can anyone help me figure out what's going wrong here?
type GraphSubAttributeNames<N extends ApiModelNames, K extends GraphSubAttributeKeys<N>> =
GraphSubAttributesMap<N> extends never ?
'never' :
GraphSubAttributesMap<N>[K] extends MapRelation ?
GetGraphRelationMap<N, K> extends never ?
'case 1' :
'case 2' :
'case 3'
type T1 = GraphSubAttributeNames<'artist', 'portrait'> // 'case 3', which is correct
type T2 = GraphSubAttributeNames<'artist', 'heroArtwork'> // 'case 2', which is also correct
type T3 = GraphSubAttributeNames<'artist', 'heroArtwork' | 'portrait'> // case 3, but should be 'case 3' | 'case 2'
Unfortunately, I haven't been able to replicate this issue with a minimal example.
Some additional types that may be relevant:
import {Artist, Footer, Site, Artwork, StrapiUser, Navigation, Exhibition, StrapiMedia} from "~/models"
// More type definitions...