The 3.21 API has a draw tool that can draw arrows. This does not yet exist in 4.XX unfortunately.
A question though: you say the arrow should be drawn between point A and point B, but if A and B are fixed long/lats then the arrow has to scale as you zoom in and out. For example, in the 3.21 draw tool, both ends of the arrow are fixed long/lats, so the arrow must change sizes as the user zooms in and out. If it didn't change size, then it would no longer be fit to those two points.
If the 3.21 tool matches what you need I can probably make a quick sample that does roughly the same thing for the 4.X API.
Thank you for your answer, however this approach has the side effect i am trying to avoid (probably wasnt a good description, english is not my native language). Since you place the coordinates in worldspace the arrow occupies the whole view when you zoom in.
I was looking for something closer to how google solves it,
where the arrow is the same size even if u zoom in, thought this would be something simple already included in the api...
Some types of symbols remain the same size as you zoom in and out. For example, PictureMarkerSymbols and SimpleMarkerSymbols do this.
I think you could get something like this working using two graphics, one of them symbolized by a PictureMarkerSymbol to represent the head of the arrow and the other a polyline represented by a SimpleLineSymbol representing the rest of the arrow. You'd have to rotate the PMS based on the direction the arrow is facing.
The arrowhead image is a base64 svg, but you could use whatever image you wanted for the arrowhead. You might have to play with how the angle of rotation is calculated based on the orientation of the image you use.
You can create polyline and arrow at the end of line or make it repeatly along the line.