@@ -46,6 +46,7 @@ type Actor {
46
46
id: ID!
47
47
name: String
48
48
movies: [Movie] @relation(name: "ACTED_IN", direction: "OUT")
49
+ knows: [Person] @relation(name: "KNOWS", direction: "OUT")
49
50
}
50
51
51
52
type User implements Person {
@@ -87,6 +88,8 @@ interface Camera {
87
88
type: String
88
89
make: String
89
90
weight: Int
91
+ operators: [Person] @relation(name: "cameras", direction: IN)
92
+ computedOperators(name: String): [Person] @cypher(statement: "MATCH (this)<-[:cameras]-(p:Person) RETURN p")
90
93
}
91
94
92
95
type OldCamera implements Camera {
@@ -95,6 +98,8 @@ type OldCamera implements Camera {
95
98
make: String
96
99
weight: Int
97
100
smell: String
101
+ operators: [Person] @relation(name: "cameras", direction: IN)
102
+ computedOperators(name: String): [Person] @cypher(statement: "MATCH (this)<-[:cameras]-(p:Person) RETURN p")
98
103
}
99
104
100
105
type NewCamera implements Camera {
@@ -103,6 +108,8 @@ type NewCamera implements Camera {
103
108
make: String
104
109
weight: Int
105
110
features: [String]
111
+ operators: [Person] @relation(name: "cameras", direction: IN)
112
+ computedOperators(name: String): [Person] @cypher(statement: "MATCH (this)<-[:cameras]-(p:Person) RETURN p")
106
113
}
107
114
108
115
type CameraMan implements Person {
@@ -115,11 +122,19 @@ type CameraMan implements Person {
115
122
}
116
123
117
124
type Query {
118
- Movie(movieId: ID, title: String, year: Int, plot: String, poster: String, imdbRating: Float): [Movie] MoviesByYear(year: Int, first: Int = 10, offset: Int = 0): [Movie]
125
+ Movie(movieId: ID, title: String, year: Int, plot: String, poster: String, imdbRating: Float): [Movie]
126
+ MoviesByYear(year: Int, first: Int = 10, offset: Int = 0): [Movie]
119
127
AllMovies: [Movie]
120
128
MovieById(movieId: ID!): Movie
121
129
GenresBySubstring(substring: String): [Genre] @cypher(statement: "MATCH (g:Genre) WHERE toLower(g.name) CONTAINS toLower($substring) RETURN g")
122
130
Books: [Book]
131
+ CustomCameras: [Camera] @cypher(statement: "MATCH (c:Camera) RETURN c")
132
+ CustomCamera: Camera @cypher(statement: "MATCH (c:Camera) RETURN c")
133
+ }
134
+
135
+ type Mutation {
136
+ CustomCamera: Camera @cypher(statement: "CREATE (newCamera:Camera:NewCamera {id: apoc.create.uuid(), type: 'macro'}) RETURN newCamera")
137
+ CustomCameras: [Camera] @cypher(statement: "CREATE (newCamera:Camera:NewCamera {id: apoc.create.uuid(), type: 'macro', features: ['selfie', 'zoom']}) CREATE (oldCamera:Camera:OldCamera {id: apoc.create.uuid(), type: 'floating', smell: 'rusty' }) RETURN [newCamera, oldCamera]")
123
138
}
124
139
` ;
125
140
@@ -146,15 +161,3 @@ export const resolvers = {
146
161
}
147
162
}
148
163
} ;
149
-
150
- // Mutation: {
151
- // CreateGenre(object, params, ctx, resolveInfo) {
152
- // return neo4jgraphql(object, params, ctx, resolveInfo, true);
153
- // },
154
- // CreateMovie(object, params, ctx, resolveInfo) {
155
- // return neo4jgraphql(object, params, ctx, resolveInfo, true);
156
- // },
157
- // AddMovieGenre(object, params, ctx, resolveInfo) {
158
- // return neo4jgraphql(object, params, ctx, resolveInfo, true);
159
- // }
160
- // }
0 commit comments