how to disambiguate query relations
Hi everyone, I'm currently facing an issue with the Query API where I don't understand how to disambiguate a foreign key. I have the following schema:
as you can see users can have many sent and received transactions, but
many
offers no way to reference a field like one
does, so I'm not sure how to build the users relations for this case. Ideally I would love to be able to query a list of users with their sent or received transactions.
For example, in Prisma I would be able to set the reference name in the CoinsTransaction
model and then use the same name for the relations in the User
model, like they do here: https://www.prisma.io/docs/concepts/components/prisma-schema/relations#disambiguating-relations.
Thanks!Prisma
Relations (Reference)
A relation is a connection between two models in the Prisma schema. This page explains how you can define one-to-one, one-to-many and many-to-many relations in Prisma.
1 Reply
I think I figured it out
It would be good to document this on the site, is it ok to create a PR for the docs?