Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript 5 support #2328

Closed
darkbasic opened this issue Mar 21, 2023 · 1 comment · Fixed by #2329
Closed

Typescript 5 support #2328

darkbasic opened this issue Mar 21, 2023 · 1 comment · Fixed by #2329

Comments

@darkbasic
Copy link
Contributor

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

@dotansimha
Copy link
Collaborator

dotansimha commented Mar 22, 2023

Thanks @darkbasic !
This was merged and released in graphql-modules@2.1.2. I confirmed it's working with both TS5 and TS4.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants