Skip to content

Commit df7e2db

Browse files
authored
fix: inject and optional decorators should allow key to be undefined (#2329)
1 parent e454a1d commit df7e2db

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.changeset/lazy-bulldogs-cry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'graphql-modules': patch
3+
---
4+
5+
TypeScript 5 support for the Inject and Optional decorators

packages/graphql-modules/src/di/decorators.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ export function Injectable(options?: ProviderOptions): ClassDecorator {
5151
};
5252
}
5353

54+
// https://github.com/microsoft/TypeScript/issues/52435
55+
type ParameterDecorator = (
56+
target: Object,
57+
propertyKey: string | symbol | undefined,
58+
parameterIndex: number
59+
) => void;
60+
5461
export function Optional(): ParameterDecorator {
5562
return (target, _, index) => {
5663
ensureReflect();

0 commit comments

Comments
 (0)