$depth is used in while condition, so you define it.
Are you looking for shortest/longest path?
If you are using MATCH you can't return $depth, as workaroud you can use it with select:
SELECT @rid,$depth FROM (TRAVERSE * FROM V)
If you need to use it with MATCH you can open a request on github.
Alex.