How to let the root (node) type of inherited scene be a derived gdextension class

Godot Version

Godot 4.3

Question

When we use scene inherit, the default root (node) type of inherited scene is same as base scene. And if we attach or extend a script (gdscript) to the root node, we can define a derived class to change the type of the node accordingly.

But when use gdextension, I already define the derived class in cpp, then how can I change the root (node) type to that derived class?