Showing results for 
Search instead for 
Did you mean: 

Nested type definition in GraphQL:: Address, City, State, Country

Node Link

I have the following address relationship.


Please clarify how do we define our type definition in GraphQL.

type Country {
countryId: ID!
name: String!
type State {
stateId: ID!
name: String!
belongs_to: Country @relation(direction: OUT, name: "BELONGS_TO")

type City {
cityId: ID!
name: String!
part_of: State @relation(direction: OUT, name: "PART_OF")

type Address {
address1: String!
address2: String
address3: String
location: Point
city: City @relation(name: "LIVES_IN", direction: OUT)
state: ?? <<<<<< Should i use Cypher with Merge?
country: ?? <<<<< Should I use Cyper with Merge?

Please clarify!

Nodes 2022
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.