Skip to content

Commit f332428

Browse files
authored
Fixed usage of species in a cluster
1 parent 0350a63 commit f332428

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

schema.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ humanType = new gql.GraphQLObjectType({
160160
// https://docs.arangodb.com/Aql/GraphTraversals.html#working-on-collection-sets
161161
const species = args.species || null;
162162
return db._query(aqlQuery`
163+
WITH graphql_characters
163164
FOR friend IN ANY ${human} ${friends}
164165
FILTER !${species} || friend.$type == ${species}
165166
SORT friend._key ASC
@@ -177,6 +178,7 @@ humanType = new gql.GraphQLObjectType({
177178
// appear in a character), so we are only interested
178179
// in OUTBOUND edges.
179180
return db._query(aqlQuery`
181+
WITH graphql_characters
180182
FOR episode IN OUTBOUND ${human._id} ${appearsIn}
181183
SORT episode._key ASC
182184
RETURN episode
@@ -231,6 +233,7 @@ droidType = new gql.GraphQLObjectType({
231233
resolve(droid, args) {
232234
const species = args.species || null;
233235
return db._query(aqlQuery`
236+
WITH graphql_characters
234237
FOR friend IN ANY ${droid} ${friends}
235238
FILTER !${species} || friend.$type == ${species}
236239
SORT friend._key ASC

0 commit comments

Comments
 (0)