Skip to content

Commit 16e99d1

Browse files
committed
Note that if props are missing, the class needs to be within a .dto.ts file
1 parent 277fa49 commit 16e99d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/common/resource.dto.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export class EnhancedResource<T extends ResourceShape<any>> {
194194
const props = this.type.Props;
195195
if (!props) {
196196
throw new Error(
197-
`${this.name} has no props declared. Decorate with @RegisterResource or a GraphQL type decorator.`,
197+
`${this.name} has no props declared.\n\nDecorate with @RegisterResource or a GraphQL type decorator and move it to a file named: *.dto.ts.`,
198198
);
199199
}
200200
return new Set<keyof T['prototype'] & string>(props);
@@ -205,7 +205,7 @@ export class EnhancedResource<T extends ResourceShape<any>> {
205205
const props = this.type.SecuredProps;
206206
if (!props) {
207207
throw new Error(
208-
`${this.name} has no props declared. Decorate with @RegisterResource or a GraphQL type decorator.`,
208+
`${this.name} has no props declared.\n\nDecorate with @RegisterResource or a GraphQL type decorator and move it to a file named: *.dto.ts.`,
209209
);
210210
}
211211
return new Set<SecuredResourceKey<T, false>>(props as any);

0 commit comments

Comments
 (0)