Instructor: Let's make sure that we have some data in our graph that we can work with. By querying our GraphQL API, we can see that there are some data points that can be inferred by the relationships going to and from a node.
One such piece of data could be the list of species found on a given planet. The only way we can currently get that information is by going through our list of people and collecting their home world and species name properties.
Optimistically, we can update our schema to show a list of species on a planet. Let's take a look at how we can use the Cypher directive provided by Neo4j-graphql-js to make this easy for us.
Let's further edit our planet schema and add the @cypher directive along with its statement property, which represents a Cypher statement to run against the database.
The this parameter represents the planet node in question. As it happens, this will return one species per person that connects back to the planet. We'll need to only return the distinct species.
Now, we'll restart our API and write a query that includes the planet's species property.