Pankaja
04/13/2019, 1:05 PMtype Wallet {
id: ID! @unique
name: String!
balance: Float! @default(value: "0.0")
user: User!
}
type Income {
id: ID! @unique
name: String
createdOn: DateTime!
value: Float!
wallet: Wallet!
category: Category!
isSettled: Boolean! @default(value: "true")
}
type Expense {
id: ID! @unique
name: String
createdOn: DateTime!
value: Float!
wallet: Wallet!
category: Category!
isSettled: Boolean! @default(value: "true")
}
This is working so far. However now I need to add a wallet to wallet transfer. So, I tried adding toWallet: Wallet to type Expense and fromWallet to type Income. But when I run prisma deploy, I'm getting an error like this
`Errors:
Income
:heavy_multiplication_x: The relation field 'wallet' must specify a '@relation' directive: '@relation(name: "MyRelation")'
:heavy_multiplication_x: The relation field 'fromWallet' must specify a '@relation' directive: '@relation(name: "MyRelation")'
Expense
:heavy_multiplication_x: The relation field 'wallet' must specify a '@relation' directive: '@relation(name: "MyRelation")'
:heavy_multiplication_x: The relation field 'toWallet' must specify a '@relation' directive: 'relation(name: "MyRelation")'
How can I fix this ? Any help would be appreciated.
Thanks