Extends generic type in Graphql (NestJs)

Viewed 502

im new in graphql. I have trouble with input type extends generic type. Source code like this:

function Edge<T>(Node: Type<T>) {
  class EdgeType {
    @Field(() => String)
    company: string;

    @Field(() => String)
    lang: string;

    @Field(() => String)
    collection: string;

    @Field(() => String)
    user_id: string;

    @Field(() => String, { nullable: true })
    token: string;

    @Field(() => Node)
    condition: T;

    @Field(() => [Node], { nullable: true })
    data: T[];
  }
  return EdgeType;
}

@InputType()
export class EdgeMasterData extends Edge(MasterData) {
  @Field(() => String, { nullable: true })
  _key: string;
}

I only hay one field is _key, cannot get field in Edge..

Actually i did a lot of time research but didn't solve the problem

Need help !!!

0 Answers
Related