Godot version, v4.2.2.stable.official [15073afe3]

I’m aiming to use the the get_closest_point function and it is returning this error:

Invalid call. Nonexistent function ‘get_closest_point’ in base ‘Callable’.

I’ve checked the documentation and I couldn’t find a solution- here’s a link:AStar2D — Godot Engine (stable) documentation in English

The graph variable is defined as an astar2d in the ready function

func createPoint(cell):

var dot= DOT.instantiate()

```
dot.position = tileMap.map_to_local(Vector2(cell[0],cell[1]-1))
var pos= dot.position
if graph.get_point_position(graph.get_closest_point(pos))==pos:
return
add_child(dot)
graph.add_point(graph.get_available_point_id(),pos)
```

Thanks in advance