-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathschema.graphql
63 lines (59 loc) · 1.57 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
type Movie @exclude(operations: [CREATE, UPDATE, DELETE]) {
budget: Int
countries: [String]
imdbId: ID
imdbRating: Float
imdbVotes: Int
languages: [String]
movieId: ID!
plot: String
poster: String
released: String
revenue: Int
runtime: Int
title: String
tmdbId: String
url: String
year: Int
genres: [Genre!]! @relationship(type: "IN_GENRE", direction: OUT)
actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN)
directors: [Director!]! @relationship(type: "DIRECTED", direction: IN)
similar(first: Int = 3): [Movie]
@cypher(
statement: """
MATCH (this)-[:ACTED_IN|:DIRECTED|:IN_GENRE]-(overlap)-[:ACTED_IN|:DIRECTED|:IN_GENRE]-(rec:Movie)
WITH rec, COUNT(*) AS score
RETURN rec ORDER BY score DESC LIMIT $first
"""
)
}
type Genre @exclude(operations: [CREATE, UPDATE, DELETE]) {
name: String
movies: [Movie!]! @relationship(type: "IN_GENRE", direction: IN)
}
type User @exclude(operations: [CREATE, UPDATE, DELETE]) {
userId: ID!
name: String
rated: [Movie!]! @relationship(type: "RATED", direction: OUT)
}
type Actor @exclude(operations: [CREATE, UPDATE, DELETE]) {
bio: String
born: Date
bornIn: String
imdbIb: String
name: String
poster: String
tmdbId: String
url: String
acted_in: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT)
}
type Director @exclude(operations: [CREATE, UPDATE, DELETE]) {
bio: String
bornIn: String
imdbIb: String
name: String
poster: String
tmdbId: String
url: String
directed: [Movie!]! @relationship(type: "DIRECTED", direction: OUT)
}