cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

GraphQL type definition for article similar with another article

LJRB
Graph Buddy

I want to make an app with GRANDstack.

In my Neo4j database I have articles that are similar to other articles.

It looks like this: (:ARTICLE)-[:SIMILAR]->(:ARTICLE)

I know that I have to firstly define GraphQL types, so I did this in my schema.graphql file:

type ARTICLE {
   _id: Long!
   id: Int!
   community: Int
   label: String!
   seed_label: Int
   title: String!
   keywords: [KEYWORD] @relation(name: "APPEARS_IN", direction: IN)
}

Knowing that this is article similar with other articles, how do I add the relationship SIMILAR ?

2 REPLIES 2

MuddyBootsCode
Graph Steward

Similar too would be the same:

type ARTICLE {
... previous fields,
similar: ARTICLE @relation (name: "SIMILAR", direction: "IN")
}

Or however you want to direct it.