This is a cross-origin problem, and it's not really related to the Graph API, but I've found documentation for solving cross-origin problems that I hope will help you.
Solving cross-origin problems:
https://blog.logrocket.com/using-cors-next-js-handle-cross-origin-requests/
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.