Closed
Description
I'm running into the following error on all my models that are related to each other:
'TagTypeModelBase' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
Here is the file in question:
UserModel.base.ts
...
export const UserModelBase = MSTGQLObject
.named('User')
.props({
__typename: types.optional(types.literal("User"), "User"),
createdAt: types.maybe(types.frozen()),
email: types.maybe(types.string),
id: types.identifier,
name: types.maybe(types.string),
projects: types.optional(types.array(MSTGQLRef(types.late((): IAnyModelType => ProjectModel))), []),
updatedAt: types.maybe(types.frozen()),
})
...
Project
has a link back to the User
model. When I first ran into this I found:
and thought I could get around this by editing UserModel.ts
like the following:
export const UserModel = UserModelBase.props({
projects: types.optional(
types.array(MSTGQLRef(types.late((): IAnyModelType => ProjectModel))),
[],
),
})
But I still get the error in typescript. It seems like I need to edit UserModel.base.ts
directly to fix this issue, but that is a generated file.
Metadata
Metadata
Assignees
Labels
No labels