Skip to main content

Identifier Expected to be of Type ID

Erroneous Code Example

This error occurs when an identifier is expected to be of type ID but a different type was provided.
QUERY getUser(userId: String) =>
    user <- N<User>(userId)
    RETURN user

Solution

Ensure the identifier is of type ID.
QUERY getUser(userId: ID) =>
    user <- N<User>(userId)
    RETURN user