Skip to content

fix #3 #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down