@@ -11,6 +11,7 @@ import {
11
11
import { createMetadataDecorator } from '@seedcompany/nest' ;
12
12
import { LazyGetter as Once } from 'lazy-get-decorator' ;
13
13
import { DateTime } from 'luxon' ;
14
+ import { type OmitIndexSignature } from 'type-fest' ;
14
15
import type {
15
16
ResourceDBMap ,
16
17
ResourceLike ,
@@ -29,6 +30,12 @@ import { getParentTypes } from './parent-types';
29
30
import { type MaybeSecured , type SecuredProps } from './secured-property' ;
30
31
import { type AbstractClassType } from './types' ;
31
32
33
+ // Merge with this to declare Relations types for Resources.
34
+ // Be sure to patch at runtime too.
35
+ // Don't reference this type directly, other than to declaration merge.
36
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
37
+ export interface DeclareResourceRelations { }
38
+
32
39
const GqlClassType = createMetadataDecorator ( {
33
40
key : CLASS_TYPE_METADATA ,
34
41
setter : ( type : ClassTypeVal ) => type ,
@@ -54,7 +61,12 @@ export const resolveByTypename =
54
61
@DbLabel ( 'BaseNode' )
55
62
export abstract class Resource extends DataObject {
56
63
// eslint-disable-next-line @typescript-eslint/naming-convention
57
- static readonly Relations = ( ) => ( { } satisfies ResourceRelationsShape ) ;
64
+ static readonly Relations =
65
+ ( ) : OmitIndexSignature < DeclareResourceRelations > => {
66
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
67
+ // @ts -ignore -- runtime needs to be patched in.
68
+ return { } ;
69
+ } ;
58
70
59
71
readonly __typename ?: string ;
60
72
0 commit comments