From 7f0b289c70346e625ddfb2cd1daa4ccb2edf8c3e Mon Sep 17 00:00:00 2001 From: Vincent Lecrubier Date: Mon, 16 Jan 2017 21:04:42 +0100 Subject: [PATCH] fix #3 --- schema.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/schema.js b/schema.js index bb12812..4f72f7d 100644 --- a/schema.js +++ b/schema.js @@ -160,6 +160,7 @@ humanType = new gql.GraphQLObjectType({ // https://docs.arangodb.com/Aql/GraphTraversals.html#working-on-collection-sets const species = args.species || null; return db._query(aqlQuery` + WITH ${characters} FOR friend IN ANY ${human} ${friends} FILTER !${species} || friend.$type == ${species} SORT friend._key ASC @@ -177,6 +178,7 @@ humanType = new gql.GraphQLObjectType({ // appear in a character), so we are only interested // in OUTBOUND edges. return db._query(aqlQuery` + WITH ${characters} FOR episode IN OUTBOUND ${human._id} ${appearsIn} SORT episode._key ASC RETURN episode @@ -231,6 +233,7 @@ droidType = new gql.GraphQLObjectType({ resolve(droid, args) { const species = args.species || null; return db._query(aqlQuery` + WITH ${characters} FOR friend IN ANY ${droid} ${friends} FILTER !${species} || friend.$type == ${species} SORT friend._key ASC @@ -243,6 +246,7 @@ droidType = new gql.GraphQLObjectType({ description: 'Which movies they appear in.', resolve(droid) { return db._query(aqlQuery` + WITH ${characters} FOR episode IN OUTBOUND ${droid._id} ${appearsIn} SORT episode._key ASC RETURN episode