Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for relationships on the same node types #22

Closed
lilianaziolek opened this issue Apr 24, 2019 · 0 comments
Closed

Support for relationships on the same node types #22

lilianaziolek opened this issue Apr 24, 2019 · 0 comments

Comments

@lilianaziolek
Copy link
Contributor

When specifying a relation with 2 different node types on both ends (e.g. Movie and Actor), this relation can be used inside Movie or Actor and gets correct direction (depending on from/to values in relation).
If both ends of a relation have the same type, there currently seems to be no way to indicate which "side" of the relation a field should relate to. See an example below:

type User {
  name:String
  referredBy: Referral @relation(direction: OUT)
  referred:[Referral] @relation(direction: IN)
}
type Referral @relation (name:"REFERRED_BY", from:"user", to: "referredBy" ) {
  user:User
  referredBy:User
  referralDate:String
}

At the moment, generated query will use outgoing relationship for both referredBy and referred

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants