DEV Community

Discussion on: Neo4j & GraphQL - A Match Made In Heaven

Collapse
 
godara01 profile image
Sanket Chaudhary

Hey!
can you tell how to get properties of relationships involving same type of nodes. ex.
type AssignmnentInterest @relation(name: "ASSIGNMENT_INTEREST"){
id: ID!
from: Assignment
to: Assignment
acres: String
}

Thanks

Collapse
 
muddybootscode profile image
Michael Porter

I'm not exactly sure but its possible you could do something like this:

type Assignment {
   previousAssignment: Assignment @relation(name: "ASSIGNEMNT_INTEREST", direction:(this could be out or in depeneding upon your requirements))
}

Something like that should work. If not, you could do something like create an initial installment type and have that be the first assignment in your chain. I hope this helps.