Skip to content

Latest commit

 

History

History
44 lines (37 loc) · 1012 Bytes

translator-tests2.adoc

File metadata and controls

44 lines (37 loc) · 1012 Bytes

Translator Tests

Schema

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
}

Tests

relation with same types

GraphQL-Query
{user(name:"Jane") {
  name
  referredBy { referralDate referredBy {name} }
  referred { referralDate user {name} }
} }
Cypher params
{"userName":"Jane"}
Cypher
MATCH (user:User) WHERE user.name = $userName RETURN user { .name, referredBy:[(user)-[userReferredBy:REFERRED_BY]->(userReferredByReferredBy:User) | userReferredBy { .referralDate, referredBy:userReferredByReferredBy { .name } }][0], referred:[(user)<-[userReferred:REFERRED_BY]-(userReferredUser:User) | userReferred { .referralDate, user:userReferredUser { .name } }] } AS user