Hello, I've been working on a project to get famil...
# orm-help
p
Hello, I've been working on a project to get familiar with GraphQL and Prima. As for now, I'm using the sample database on prima. The project is a finance app where you can manage your finance. This is sample of my datamodel
Copy code
type 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
Copy code
`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