Hi guys! Having these relations (a customer have N...
# orm-help
m
Hi guys! Having these relations (a customer have N contracts and N billingAccounts), my prisma client generate a createCustomer mutation. But is possible to create only customer entity? In the mutation is requesting the relations as non nullable types..
m
I guess this is due to your datamodel. Can you share it?
m
Here you have https://github.com/prisma/prisma/issues/4095 (it's the same datamodel), It has a bug (doesn't create arrays), explained on the issue.
m
So then this is simply a bug in the introspection. The generated datamodel specifies that a customer must have exactly 1 account and contract. Therefore the API is forcing you to specify this parameter.
So your datamodel is something like this:
Copy code
type Customer {
  accounts: Account!
}
Instead it should be:
Copy code
type Customer {
  accounts: [Account]
}
Then that problem will be gone.
👍 1
m
Right @marcus, I have modified it by hand and all it's ok!