Kity Cartman
Kity Cartman

Reputation: 896

How to create a relationship property in graphql type definitions using neo4j-graphql library

Using neo4j-graphql library, from property graph models we could create a graphql type definitions.

For example, for the contrived imdb graph model below:

enter image description here

We could create graphql type definitions like so:

type Movie {
    movieId: ID! 
    title: String!
    actors: [Person] @relationship(type: "ACTOR_IN", direction: IN)
}

type Person {
    personId: ID!
    name: String!
    actorInMovies: [Movie] @relationship(type: "ACTOR_IN", direction: OUT)
}

Notice how @relationship annotations could be used to establish relationships between different types.

However, neo4j also allows you to create relationship properties as well, as shown in the example below: enter image description here

I can't seem to find any neo4j-graphql library document that explains how to achieve this. Please suggest. TIA.

Upvotes: 0

Views: 925

Answers (2)

Dan Starns
Dan Starns

Reputation: 3815

AS OF 15/06/2021

Relationship properties are not supported by the Neo4j GraphQL Library. We are working on it right now and you can see the RFC for it here https://github.com/neo4j/graphql/pull/193.

Upvotes: 1

Related Questions