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

# E301

# Variable Not in Scope

## Erroneous Code Example

This error occurs when you try to reference a variable that is not currently in scope or has not been declared.

In this example, the variable `userId` is not declared.

<CodeGroup>
  ```rust queries.hx theme={null}
  Query getUser() =>
      user <- N<User>(userId)
      RETURN user
  ```
</CodeGroup>

## Solution

Declare the variable as a parameter before using it.

<CodeGroup>
  ```rust queries.hx theme={null}
  Query getUser(userId: ID) =>
      user <- N<User>(userId)
      RETURN user
  ```
</CodeGroup>
