Skip to content

"Class constructor ChildClass cannot be invoked without 'new' when using Partial  #10

@techanyonymous

Description

@techanyonymous

I am trying to get the all the properties from the parent class as optional in typegraphl. But when I used Partial with @inputType decorator it throws this error. If I change the decorator to @ObjectType, there seems to be no issue.

@InputType
class Parent {
   @Field()
   fieldA: string
}

@InputType
class child extends Partial(Parent) {
constructor(){super()}

@Field()
fieldB: string
}

@ChrisLahaye can you please look into this

my versions
"type-graphql": "^2.0.0-beta.2",
"type-graphql-utils": "^2.1.0",
"graphql": "^16.6.0",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions