@@ -4,7 +4,7 @@ import { DateTime } from 'luxon';
4
4
import { keys as keysOf } from 'ts-transformer-keys' ;
5
5
import { MergeExclusive } from 'type-fest' ;
6
6
import { BaseNode } from '~/core/database/results' ;
7
- import { abstractType , e } from '~/core/edgedb' ;
7
+ import { e } from '~/core/edgedb' ;
8
8
import { RegisterResource } from '~/core/resources' ;
9
9
import {
10
10
Calculated ,
@@ -56,7 +56,7 @@ export const resolveEngagementType = (val: Pick<AnyEngagement, '__typename'>) =>
56
56
? LanguageEngagement
57
57
: InternshipEngagement ;
58
58
59
- @RegisterResource ( )
59
+ @RegisterResource ( { db : e . Engagement } )
60
60
@InterfaceType ( {
61
61
resolveType : resolveEngagementType ,
62
62
implements : [ Resource , ChangesetAware ] ,
@@ -65,7 +65,6 @@ export const resolveEngagementType = (val: Pick<AnyEngagement, '__typename'>) =>
65
65
* This should be used for GraphQL but never for TypeScript types.
66
66
*/
67
67
class Engagement extends ChangesetAwareResource {
68
- static readonly DB : any = abstractType ( e . Engagement ) ;
69
68
static readonly Props : string [ ] = keysOf < Engagement > ( ) ;
70
69
static readonly SecuredProps : string [ ] = keysOf < SecuredProps < Engagement > > ( ) ;
71
70
static readonly Parent = import ( '../../project/dto' ) . then ( ( m ) => m . IProject ) ;
@@ -149,12 +148,11 @@ class Engagement extends ChangesetAwareResource {
149
148
// export as different names to maintain compatibility with our codebase.
150
149
export { Engagement as IEngagement , AnyEngagement as Engagement } ;
151
150
152
- @RegisterResource ( )
151
+ @RegisterResource ( { db : e . LanguageEngagement } )
153
152
@ObjectType ( {
154
153
implements : [ Engagement ] ,
155
154
} )
156
155
export class LanguageEngagement extends Engagement {
157
- static readonly DB = e . LanguageEngagement ;
158
156
static readonly Props = keysOf < LanguageEngagement > ( ) ;
159
157
static readonly SecuredProps = keysOf < SecuredProps < LanguageEngagement > > ( ) ;
160
158
static readonly Relations = {
@@ -195,12 +193,11 @@ export class LanguageEngagement extends Engagement {
195
193
readonly historicGoal : SecuredString ;
196
194
}
197
195
198
- @RegisterResource ( )
196
+ @RegisterResource ( { db : e . InternshipEngagement } )
199
197
@ObjectType ( {
200
198
implements : [ Engagement ] ,
201
199
} )
202
200
export class InternshipEngagement extends Engagement {
203
- static readonly DB = e . InternshipEngagement ;
204
201
static readonly Props = keysOf < InternshipEngagement > ( ) ;
205
202
static readonly SecuredProps = keysOf < SecuredProps < InternshipEngagement > > ( ) ;
206
203
static readonly Parent = import ( '../../project/dto' ) . then (
@@ -238,4 +235,9 @@ declare module '~/core/resources/map' {
238
235
InternshipEngagement : typeof InternshipEngagement ;
239
236
LanguageEngagement : typeof LanguageEngagement ;
240
237
}
238
+ interface ResourceDBMap {
239
+ Engagement : typeof e . default . Engagement ;
240
+ InternshipEngagement : typeof e . default . InternshipEngagement ;
241
+ LanguageEngagement : typeof e . default . LanguageEngagement ;
242
+ }
241
243
}
0 commit comments