Getting 500 Internal Server Error When Tried To Add Menu Items Via Graphql API

I Have List Of Many Items To Add In Menu So It Is Not Possible To Do Manually, So i Have Tried To Go With API . I Have Checked That With GraphQL if i want to append the menu item without replacing existing menu is not possible we need to update the entire menu with new items only so i go with it . now i think the menu iteams are now more then 2000 and now i am trying to add more iteams it is showing me error of 500 internal server . so how can i resolve it or how can i add more iteams in menu with api?

Below is my Queary Which i am using

Endpoint
admin/api/2024-10/graphql.json

mutation UpdateMenu($id: ID!, $title: String!, $items: [MenuItemUpdateInput!]!) {
menuUpdate(id: $id, title: $title, items: $items) {
menu {
id
title
items {
title
url
items {
title
url
items {
title
url
}
}
}
}
userErrors {
field
message
}
}
}

Hi Manavmehta75,

Just trying to understand the result you’re looking to achieve here - just to confirm, you’re looking to add ~2k menu items to a stores’ menu? How would you be displaying this on the front-end, or is there another purpose for this?

i am using it for different purpose , you can able to see conditional form below on the home page it will be linked with that navigation , so there are many options which I need to add as hierarchy , i have also tried with bulk api but i am not able to upload the file , when i tried to upload file in provided stagedTargetsurl it is showing me some how 401 . is there any way to add it?