-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathschema.graphql
36 lines (32 loc) · 909 Bytes
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
type User {
id: Int
name: String!
movies: [Movie] @relation(name: "RATED", direction: "out")
}
type Movie {
id: Int
title: String!
year: Int
plot: String
poster: String
imdbRating: Float
genres: [Genre] @relation(name: "IN_GENRE", direction: "out")
actors: [Actor] @relation(name: "ACTED_IN", direction: "in")
directors: [Director] @relation(name: "DIRECTED", direction: "in")
similar: [Movie] @cypher(statement: "WITH {this} AS this MATCH (this)-[:IN_GENRE]->(:Genre)<-[:IN_GENRE]-(rec:Movie) WITH rec, COUNT(*) AS num ORDER BY num DESC RETURN rec LIMIT 10")
}
type Genre {
id: Int
name: String!
movies: [Movie] @relation(name: "IN_GENRE", direction: "in")
}
type Director {
id: Int
name: String!
movies: [Movie] @relation(name: "DIRECTED", direction: "out")
}
type Actor {
id: Int
name: String!
movies: [Movie] @relation(name: "ACTED_IN", direction: "out")
}