> ## Documentation Index
> Fetch the complete documentation index at: https://helix-claude-document-return-objects-rxi6v.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# E627

# Shortest Path Requires From or To Parameter

## Erroneous Code Example

This error occurs when you use a shortest path operation without providing either a `from` or `to` parameter.

<CodeGroup>
  ```helixql queries.hx theme={null}
  QUERY findPath() =>
      path <- N<User>::ShortestPath()
      RETURN path
  ```

  ```helixql schema.hx theme={null}
  N::User {
      name: String,
  }

  E::Follows {
      From: User,
      To: User,
  }
  ```
</CodeGroup>

## Solution

Add a `from` or `to` parameter to the shortest path operation.

<CodeGroup>
  ```helixql queries.hx theme={null}
  QUERY findPath(startId: ID, endId: ID) =>
      path <- N<User>::ShortestPath(from: startId, to: endId)
      RETURN path
  ```

  ```helixql schema.hx theme={null}
  N::User {
      name: String,
  }

  E::Follows {
      From: User,
      To: User,
  }
  ```
</CodeGroup>
