Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,83 @@ Run the file using `ts-node` to view the result:
ts-node {lab-file}
----

You can check the result in the Neo4j Browser by running the following query:
If successful, you should see output similar to the following (with your name instead of "Your Name"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Providing a view of what the user should see is a good addition.

It gives learners:

  1. an indication that they have completed a task successfully
  2. confidence that they can progress.


.Expected Output
[source,json,role=nocopy]
----
{
identity: Integer { low: 12345, high: 0 },
labels: [ 'Person' ],
properties: { name: 'Your Name' },
elementId: '4:abc123:12345'
}
----

You can also verify the result in the Neo4j Browser by running the following query:

[source, cypher]
----
MATCH (m:Movie {title: "Matrix, The"})<-[a:ACTED_IN]-(p:Person)
RETURN m, a, p
----

You should see your `Person` node connected to _The Matrix_ movie.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. Tell the learner what the expect outcome should be.



include::questions/verify.adoc[leveloffset=+1]


== Troubleshooting

.ts-node: command not found
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Troubleshooting - good idea for complex activities. Used as a last resort, we should design the course content so that these scenarios are few, and prepare the learner to be able to solve their own issues.

Im not sure about giving multiple options for fixing an issue:

. use ts-node
. or npx

It prompts questions for the learner:

  • Which one should I use?
  • Is one better than the other?
  • Why am I experiencing this problem?

I would direct them back to the installation instructions in the course which should be comprehensive / robust enough to cover the majority of scenarios.

[%collapsible]
====
If you receive a `ts-node: command not found` error, you can either:

1. Install `ts-node` globally:
+
[source,sh]
----
npm install -g ts-node
----

2. Or run via npx:
+
[source,sh,subs=attributes+]
----
npx ts-node {lab-file}
----
====

.Cannot use import statement outside a module
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like a [TIP] if its something we expect to happen often.

We cant control all environment issues on all learners computers though - this is why codespaces are such a positive.

[%collapsible]
====
This error occurs when Node.js tries to run TypeScript/ES modules as CommonJS.
Ensure your `tsconfig.json` has the correct module settings, or run with:

[source,sh,subs=attributes+]
----
npx ts-node --esm {lab-file}
----
====

.Verification fails but code works
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. We could end up putting this on every lesson where the code uses the database though. I would prefer a test at the start to ensure everything is setup correctly before proceeding.

[%collapsible]
====
If your code runs successfully and creates the node (you can see it in Neo4j Browser) but the verification fails:

1. Ensure you are using the sandbox provided by GraphAcademy (not a local database)
2. Check that the Person node was created with an `ACTED_IN` relationship to the movie titled "Matrix, The"
3. Try refreshing the page and clicking Verify again
====


[.summary]
== Lesson Summary

In this challenge, you used your knowledge to create a driver instance and run a Cypher statement.

Next, we will look at the Neo4j Type System and some of the considerations that you need to make when working with values coming from Neo4j in your TypeScript application.

// @last-fix 2025-12-02