Typegraphql field that can be generic for any custom type

Typegraphql field that can be generic for any custom type


0

I have a typegraphql base interface and want to be able to have object types use this class with their own relationship/attribute types. Is there a way to create a custom type that accepts any typegraphql objecttype?

@InterfaceType()
export abstract class BaseObjectType {
    @Field(type => ID)
    id: string;

    @Field()
    type: string;

    @Field()
    relationships?: any;

    @Field()
    attributes?: any;

    @Field(() => MetaType)
    meta: MetaType;

    @Field(() => [LinkType])
    links: LinkType[];
}


Load 7 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *