Skip to content

Commit 7e9f3ee

Browse files
committed
build(): logs the InputType class name, if it is available.
1 parent c294d48 commit 7e9f3ee

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
import { GqlTypeReference } from '../../interfaces';
2+
13
export class CannotDetermineInputTypeError extends Error {
2-
constructor(hostType: string) {
4+
constructor(hostType: string, typeRef?: GqlTypeReference) {
5+
const inputObjectName: string | false = typeof typeRef === 'function' && typeRef.name;
36
super(
4-
`Cannot determine a GraphQL input type for the "${hostType}". Make sure your class is decorated with an appropriate decorator.`,
7+
`Cannot determine a GraphQL input type for the "${hostType}"${inputObjectName ? `, on "${inputObjectName}` : null}". Make sure your class is decorated with an appropriate decorator.`,
58
);
69
}
710
}

lib/schema-builder/factories/input-type.factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class InputTypeFactory {
3232
typeRef as any,
3333
);
3434
if (!inputType) {
35-
throw new CannotDetermineInputTypeError(hostType);
35+
throw new CannotDetermineInputTypeError(hostType, typeRef);
3636
}
3737
}
3838
return this.typeMapperService.mapToGqlType(

0 commit comments

Comments
 (0)