Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

E302

For the complete documentation index optimized for AI agents, see llms.txt.

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.

Query getUser(userId: ID) =>
    userId <- N<User>(userId)::ID
    RETURN userId

Solution

Use a different variable name.

Query getUser(userId: ID) =>
    user_id <- N<User>(userId)::ID
    RETURN user_id