Skip to content

Typescript 5 support #2328

@darkbasic

Description

@darkbasic

Describe the bug

Typescript 5 has tighter parameter decorator checking with --experimentalDecorators.
That means constructor parameter decorators should allow undefined as the type of key.

To Reproduce

Use the Inject decorator with Typescript 5+:

error TS1239: Unable to resolve signature of parameter decorator when called as an expression.
  Argument of type 'undefined' is not assignable to parameter of type 'string | symbol'.

50     @Inject(Pool) pool: DatabasePool,
        ~~~~~~~~~~~~

Expected behavior

Works with TS5+.

Environment:

  • OS: Gentoo Linux ppc64le
  • graphql-modules: 2.1.1
  • NodeJS: v18.15.0

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions