Skip to main content

Use of Undeclared Node or Vector Type in Schema

Erroneous Code Example

This error occurs when you reference a node or vector type in an edge definition before that type has been declared in the schema.
E::Follows {
    From: User,
    To: User,
}

// User is not defined yet

Solution

Declare the node or vector type in your schema before using it in an edge definition.
N::User {
    name: String,
}

E::Follows {
    From: User,
    To: User,
}