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

E303

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

Invalid Primitive Value

Erroneous Code Example

This error occurs when you provide a primitive value that is not valid for the expected type.

QUERY createUser() =>
    user <- N<User>::INSERT { age: "not a number" }
    RETURN user
N::User {
    name: String,
    age: U32,
}

Solution

Provide a valid primitive value that matches the expected type.

QUERY createUser() =>
    user <- N<User>::INSERT { age: 25 }
    RETURN user
N::User {
    name: String,
    age: U32,
}