File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ export class EnhancedResource<T extends ResourceShape<any>> {
194
194
const props = this . type . Props ;
195
195
if ( ! props ) {
196
196
throw new Error (
197
- `${ this . name } has not been decorated with @RegisterResource` ,
197
+ `${ this . name } has no props declared. Decorate with @RegisterResource or a GraphQL type decorator. ` ,
198
198
) ;
199
199
}
200
200
return new Set < keyof T [ 'prototype' ] & string > ( props ) ;
@@ -205,7 +205,7 @@ export class EnhancedResource<T extends ResourceShape<any>> {
205
205
const props = this . type . SecuredProps ;
206
206
if ( ! props ) {
207
207
throw new Error (
208
- `${ this . name } has not been decorated with @RegisterResource` ,
208
+ `${ this . name } has no props declared. Decorate with @RegisterResource or a GraphQL type decorator. ` ,
209
209
) ;
210
210
}
211
211
return new Set < SecuredResourceKey < T , false > > ( props as any ) ;
Original file line number Diff line number Diff line change @@ -34,7 +34,13 @@ export class ResourceVisitor {
34
34
( ts . canHaveDecorators ( node ) && ts . getDecorators ( node ) ) || [ ] ;
35
35
if (
36
36
ts . isClassDeclaration ( node ) &&
37
- hasDecorators ( decorators , [ 'RegisterResource' ] )
37
+ hasDecorators ( decorators , [
38
+ 'RegisterResource' ,
39
+ 'ObjectType' ,
40
+ 'InterfaceType' ,
41
+ 'InputType' ,
42
+ 'ArgsType' ,
43
+ ] )
38
44
) {
39
45
return this . enhanceDtoClass ( node , program , factory ) ;
40
46
}
You can’t perform that action at this time.
0 commit comments