> ## 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.

# E302

# Variable Previously Declared

## Erroneous Code Example

This error occurs when you try to declare a variable that has already been declared in the current scope.
In this example, the variable `user_name` is declared twice.

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

## Solution

Use a different variable name.

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