Version: unstable
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/unstable/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation UpdateMenu($id: ID!, $title: String!, $handle: String!, $items: [MenuItemUpdateInput!]!) { menuUpdate(id: $id, title: $title, handle: $handle, items: $items) { menu { id handle items { id title items { id title } } } } }\",\n \"variables\": {\n \"id\": \"gid://shopify/Menu/442047006\",\n \"title\": \"updated menu\",\n \"handle\": \"danielstuff-main-menu\",\n \"items\": [\n {\n \"id\": \"gid://shopify/MenuItem/398712010\",\n \"title\": \"Electronics\",\n \"url\": \"collection/tables\",\n \"resourceId\": \"gid://shopify/Collection/71762467\",\n \"type\": \"COLLECTION\",\n \"items\": []\n },\n {\n \"id\": \"gid://shopify/MenuItem/643685044\",\n \"title\": \"Furniture\",\n \"url\": \"/collections/furniture\",\n \"resourceId\": \"gid://shopify/Collection/643685044\",\n \"type\": \"COLLECTION\",\n \"items\": [\n {\n \"id\": \"gid://shopify/MenuItem/927352226\",\n \"title\": \"Updated Living Room\",\n \"url\": \"/collections/living-room\",\n \"resourceId\": \"gid://shopify/Collection/927352226\",\n \"type\": \"COLLECTION\",\n \"items\": [\n {\n \"id\": \"gid://shopify/MenuItem/307741084\",\n \"title\": \"Sofa\",\n \"url\": \"/collections/sofa\",\n \"resourceId\": \"gid://shopify/Collection/307741084\",\n \"type\": \"COLLECTION\",\n \"items\": []\n },\n {\n \"id\": \"gid://shopify/MenuItem/375350346\",\n \"title\": \"Sound System\",\n \"url\": \"/collections/sound-system\",\n \"resourceId\": \"gid://shopify/Collection/375350346\",\n \"type\": \"COLLECTION\",\n \"items\": []\n },\n {\n \"id\": \"gid://shopify/MenuItem/837241978\",\n \"title\": \"Massage Chairs\",\n \"url\": \"/collections/massage%20chairs\",\n \"resourceId\": \"gid://shopify/Collection/837241978\",\n \"type\": \"COLLECTION\",\n \"items\": []\n },\n {\n \"id\": \"gid://shopify/MenuItem/960081962\",\n \"title\": \"Living Room Rugs\",\n \"url\": \"/collections/living%20room%20rugs\",\n \"resourceId\": \"gid://shopify/Collection/960081962\",\n \"type\": \"COLLECTION\",\n \"items\": []\n }\n ]\n },\n {\n \"id\": \"gid://shopify/MenuItem/715378231\",\n \"title\": \"Kitchen\",\n \"url\": \"/collections/kitchen\",\n \"resourceId\": \"gid://shopify/Collection/715378231\",\n \"type\": \"COLLECTION\",\n \"items\": [\n {\n \"id\": \"gid://shopify/MenuItem/108641250\",\n \"title\": \"Chairs\",\n \"url\": \"/collections/chairs\",\n \"resourceId\": \"gid://shopify/Collection/108641250\",\n \"type\": \"COLLECTION\",\n \"items\": []\n },\n {\n \"id\": \"gid://shopify/MenuItem/71762467\",\n \"title\": \"Tables\",\n \"url\": \"/collections/tables\",\n \"resourceId\": \"gid://shopify/Collection/71762467\",\n \"type\": \"COLLECTION\",\n \"items\": []\n },\n {\n \"id\": \"gid://shopify/MenuItem/826396515\",\n \"title\": \"Kitchen Rugs\",\n \"url\": \"/collections/kitchen%20rugs\",\n \"resourceId\": \"gid://shopify/Collection/826396515\",\n \"type\": \"COLLECTION\",\n \"items\": []\n }\n ]\n }\n ]\n },\n {\n \"id\": \"gid://shopify/MenuItem/698896745\",\n \"title\": \"Mega Sofa Sale\",\n \"url\": \"/collections/mega%20sale\",\n \"resourceId\": \"gid://shopify/Collection/307741084\",\n \"type\": \"COLLECTION\",\n \"items\": []\n }\n ]\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation UpdateMenu($id: ID!, $title: String!, $handle: String!, $items: [MenuItemUpdateInput!]!) {\n menuUpdate(id: $id, title: $title, handle: $handle, items: $items) {\n menu {\n id\n handle\n items {\n id\n title\n items {\n id\n title\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"id\": \"gid://shopify/Menu/442047006\",\n \"title\": \"updated menu\",\n \"handle\": \"danielstuff-main-menu\",\n \"items\": [\n {\n \"id\": \"gid://shopify/MenuItem/398712010\",\n \"title\": \"Electronics\",\n \"url\": \"collection/tables\",\n \"resourceId\": \"gid://shopify/Collection/71762467\",\n \"type\": \"COLLECTION\",\n \"items\": []\n },\n {\n \"id\": \"gid://shopify/MenuItem/643685044\",\n \"title\": \"Furniture\",\n \"url\": \"/collections/furniture\",\n \"resourceId\": \"gid://shopify/Collection/643685044\",\n \"type\": \"COLLECTION\",\n \"items\": [\n {\n \"id\": \"gid://shopify/MenuItem/927352226\",\n \"title\": \"Updated Living Room\",\n \"url\": \"/collections/living-room\",\n \"resourceId\": \"gid://shopify/Collection/927352226\",\n \"type\": \"COLLECTION\",\n \"items\": [\n {\n \"id\": \"gid://shopify/MenuItem/307741084\",\n \"title\": \"Sofa\",\n \"url\": \"/collections/sofa\",\n \"resourceId\": \"gid://shopify/Collection/307741084\",\n \"type\": \"COLLECTION\",\n \"items\": []\n },\n {\n \"id\": \"gid://shopify/MenuItem/375350346\",\n \"title\": \"Sound System\",\n \"url\": \"/collections/sound-system\",\n \"resourceId\": \"gid://shopify/Collection/375350346\",\n \"type\": \"COLLECTION\",\n \"items\": []\n },\n {\n \"id\": \"gid://shopify/MenuItem/837241978\",\n \"title\": \"Massage Chairs\",\n \"url\": \"/collections/massage%20chairs\",\n \"resourceId\": \"gid://shopify/Collection/837241978\",\n \"type\": \"COLLECTION\",\n \"items\": []\n },\n {\n \"id\": \"gid://shopify/MenuItem/960081962\",\n \"title\": \"Living Room Rugs\",\n \"url\": \"/collections/living%20room%20rugs\",\n \"resourceId\": \"gid://shopify/Collection/960081962\",\n \"type\": \"COLLECTION\",\n \"items\": []\n }\n ]\n },\n {\n \"id\": \"gid://shopify/MenuItem/715378231\",\n \"title\": \"Kitchen\",\n \"url\": \"/collections/kitchen\",\n \"resourceId\": \"gid://shopify/Collection/715378231\",\n \"type\": \"COLLECTION\",\n \"items\": [\n {\n \"id\": \"gid://shopify/MenuItem/108641250\",\n \"title\": \"Chairs\",\n \"url\": \"/collections/chairs\",\n \"resourceId\": \"gid://shopify/Collection/108641250\",\n \"type\": \"COLLECTION\",\n \"items\": []\n },\n {\n \"id\": \"gid://shopify/MenuItem/71762467\",\n \"title\": \"Tables\",\n \"url\": \"/collections/tables\",\n \"resourceId\": \"gid://shopify/Collection/71762467\",\n \"type\": \"COLLECTION\",\n \"items\": []\n },\n {\n \"id\": \"gid://shopify/MenuItem/826396515\",\n \"title\": \"Kitchen Rugs\",\n \"url\": \"/collections/kitchen%20rugs\",\n \"resourceId\": \"gid://shopify/Collection/826396515\",\n \"type\": \"COLLECTION\",\n \"items\": []\n }\n ]\n }\n ]\n },\n {\n \"id\": \"gid://shopify/MenuItem/698896745\",\n \"title\": \"Mega Sofa Sale\",\n \"url\": \"/collections/mega%20sale\",\n \"resourceId\": \"gid://shopify/Collection/307741084\",\n \"type\": \"COLLECTION\",\n \"items\": []\n }\n ]\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation UpdateMenu($id: ID!, $title: String!, $handle: String!, $items: [MenuItemUpdateInput!]!) {\n menuUpdate(id: $id, title: $title, handle: $handle, items: $items) {\n menu {\n id\n handle\n items {\n id\n title\n items {\n id\n title\n }\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"id\": \"gid://shopify/Menu/442047006\",\n \"title\": \"updated menu\",\n \"handle\": \"danielstuff-main-menu\",\n \"items\": [{\"id\"=>\"gid://shopify/MenuItem/398712010\", \"title\"=>\"Electronics\", \"url\"=>\"collection/tables\", \"resourceId\"=>\"gid://shopify/Collection/71762467\", \"type\"=>\"COLLECTION\", \"items\"=>[]}, {\"id\"=>\"gid://shopify/MenuItem/643685044\", \"title\"=>\"Furniture\", \"url\"=>\"/collections/furniture\", \"resourceId\"=>\"gid://shopify/Collection/643685044\", \"type\"=>\"COLLECTION\", \"items\"=>[{\"id\"=>\"gid://shopify/MenuItem/927352226\", \"title\"=>\"Updated Living Room\", \"url\"=>\"/collections/living-room\", \"resourceId\"=>\"gid://shopify/Collection/927352226\", \"type\"=>\"COLLECTION\", \"items\"=>[{\"id\"=>\"gid://shopify/MenuItem/307741084\", \"title\"=>\"Sofa\", \"url\"=>\"/collections/sofa\", \"resourceId\"=>\"gid://shopify/Collection/307741084\", \"type\"=>\"COLLECTION\", \"items\"=>[]}, {\"id\"=>\"gid://shopify/MenuItem/375350346\", \"title\"=>\"Sound System\", \"url\"=>\"/collections/sound-system\", \"resourceId\"=>\"gid://shopify/Collection/375350346\", \"type\"=>\"COLLECTION\", \"items\"=>[]}, {\"id\"=>\"gid://shopify/MenuItem/837241978\", \"title\"=>\"Massage Chairs\", \"url\"=>\"/collections/massage%20chairs\", \"resourceId\"=>\"gid://shopify/Collection/837241978\", \"type\"=>\"COLLECTION\", \"items\"=>[]}, {\"id\"=>\"gid://shopify/MenuItem/960081962\", \"title\"=>\"Living Room Rugs\", \"url\"=>\"/collections/living%20room%20rugs\", \"resourceId\"=>\"gid://shopify/Collection/960081962\", \"type\"=>\"COLLECTION\", \"items\"=>[]}]}, {\"id\"=>\"gid://shopify/MenuItem/715378231\", \"title\"=>\"Kitchen\", \"url\"=>\"/collections/kitchen\", \"resourceId\"=>\"gid://shopify/Collection/715378231\", \"type\"=>\"COLLECTION\", \"items\"=>[{\"id\"=>\"gid://shopify/MenuItem/108641250\", \"title\"=>\"Chairs\", \"url\"=>\"/collections/chairs\", \"resourceId\"=>\"gid://shopify/Collection/108641250\", \"type\"=>\"COLLECTION\", \"items\"=>[]}, {\"id\"=>\"gid://shopify/MenuItem/71762467\", \"title\"=>\"Tables\", \"url\"=>\"/collections/tables\", \"resourceId\"=>\"gid://shopify/Collection/71762467\", \"type\"=>\"COLLECTION\", \"items\"=>[]}, {\"id\"=>\"gid://shopify/MenuItem/826396515\", \"title\"=>\"Kitchen Rugs\", \"url\"=>\"/collections/kitchen%20rugs\", \"resourceId\"=>\"gid://shopify/Collection/826396515\", \"type\"=>\"COLLECTION\", \"items\"=>[]}]}]}, {\"id\"=>\"gid://shopify/MenuItem/698896745\", \"title\"=>\"Mega Sofa Sale\", \"url\"=>\"/collections/mega%20sale\", \"resourceId\"=>\"gid://shopify/Collection/307741084\", \"type\"=>\"COLLECTION\", \"items\"=>[]}]\n}\n\nresponse = client.query(query: query, variables: variables)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<\"gid://shopify/Menu/442047006\",\n \"title\" => \"updated menu\",\n \"handle\" => \"danielstuff-main-menu\",\n \"items\" => [{\"id\"=>\"gid://shopify/MenuItem/398712010\", \"title\"=>\"Electronics\", \"url\"=>\"collection/tables\", \"resourceId\"=>\"gid://shopify/Collection/71762467\", \"type\"=>\"COLLECTION\", \"items\"=>[]}, {\"id\"=>\"gid://shopify/MenuItem/643685044\", \"title\"=>\"Furniture\", \"url\"=>\"/collections/furniture\", \"resourceId\"=>\"gid://shopify/Collection/643685044\", \"type\"=>\"COLLECTION\", \"items\"=>[{\"id\"=>\"gid://shopify/MenuItem/927352226\", \"title\"=>\"Updated Living Room\", \"url\"=>\"/collections/living-room\", \"resourceId\"=>\"gid://shopify/Collection/927352226\", \"type\"=>\"COLLECTION\", \"items\"=>[{\"id\"=>\"gid://shopify/MenuItem/307741084\", \"title\"=>\"Sofa\", \"url\"=>\"/collections/sofa\", \"resourceId\"=>\"gid://shopify/Collection/307741084\", \"type\"=>\"COLLECTION\", \"items\"=>[]}, {\"id\"=>\"gid://shopify/MenuItem/375350346\", \"title\"=>\"Sound System\", \"url\"=>\"/collections/sound-system\", \"resourceId\"=>\"gid://shopify/Collection/375350346\", \"type\"=>\"COLLECTION\", \"items\"=>[]}, {\"id\"=>\"gid://shopify/MenuItem/837241978\", \"title\"=>\"Massage Chairs\", \"url\"=>\"/collections/massage%20chairs\", \"resourceId\"=>\"gid://shopify/Collection/837241978\", \"type\"=>\"COLLECTION\", \"items\"=>[]}, {\"id\"=>\"gid://shopify/MenuItem/960081962\", \"title\"=>\"Living Room Rugs\", \"url\"=>\"/collections/living%20room%20rugs\", \"resourceId\"=>\"gid://shopify/Collection/960081962\", \"type\"=>\"COLLECTION\", \"items\"=>[]}]}, {\"id\"=>\"gid://shopify/MenuItem/715378231\", \"title\"=>\"Kitchen\", \"url\"=>\"/collections/kitchen\", \"resourceId\"=>\"gid://shopify/Collection/715378231\", \"type\"=>\"COLLECTION\", \"items\"=>[{\"id\"=>\"gid://shopify/MenuItem/108641250\", \"title\"=>\"Chairs\", \"url\"=>\"/collections/chairs\", \"resourceId\"=>\"gid://shopify/Collection/108641250\", \"type\"=>\"COLLECTION\", \"items\"=>[]}, {\"id\"=>\"gid://shopify/MenuItem/71762467\", \"title\"=>\"Tables\", \"url\"=>\"/collections/tables\", \"resourceId\"=>\"gid://shopify/Collection/71762467\", \"type\"=>\"COLLECTION\", \"items\"=>[]}, {\"id\"=>\"gid://shopify/MenuItem/826396515\", \"title\"=>\"Kitchen Rugs\", \"url\"=>\"/collections/kitchen%20rugs\", \"resourceId\"=>\"gid://shopify/Collection/826396515\", \"type\"=>\"COLLECTION\", \"items\"=>[]}]}]}, {\"id\"=>\"gid://shopify/MenuItem/698896745\", \"title\"=>\"Mega Sofa Sale\", \"url\"=>\"/collections/mega%20sale\", \"resourceId\"=>\"gid://shopify/Collection/307741084\", \"type\"=>\"COLLECTION\", \"items\"=>[]}],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation UpdateMenu($id: ID!, $title: String!, $handle: String!, $items: [MenuItemUpdateInput!]!) {\n menuUpdate(id: $id, title: $title, handle: $handle, items: $items) {\n menu {\n id\n handle\n items {\n id\n title\n items {\n id\n title\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"id\": \"gid://shopify/Menu/442047006\",\n \"title\": \"updated menu\",\n \"handle\": \"danielstuff-main-menu\",\n \"items\": [\n {\n \"id\": \"gid://shopify/MenuItem/398712010\",\n \"title\": \"Electronics\",\n \"url\": \"collection/tables\",\n \"resourceId\": \"gid://shopify/Collection/71762467\",\n \"type\": \"COLLECTION\",\n \"items\": []\n },\n {\n \"id\": \"gid://shopify/MenuItem/643685044\",\n \"title\": \"Furniture\",\n \"url\": \"/collections/furniture\",\n \"resourceId\": \"gid://shopify/Collection/643685044\",\n \"type\": \"COLLECTION\",\n \"items\": [\n {\n \"id\": \"gid://shopify/MenuItem/927352226\",\n \"title\": \"Updated Living Room\",\n \"url\": \"/collections/living-room\",\n \"resourceId\": \"gid://shopify/Collection/927352226\",\n \"type\": \"COLLECTION\",\n \"items\": [\n {\n \"id\": \"gid://shopify/MenuItem/307741084\",\n \"title\": \"Sofa\",\n \"url\": \"/collections/sofa\",\n \"resourceId\": \"gid://shopify/Collection/307741084\",\n \"type\": \"COLLECTION\",\n \"items\": []\n },\n {\n \"id\": \"gid://shopify/MenuItem/375350346\",\n \"title\": \"Sound System\",\n \"url\": \"/collections/sound-system\",\n \"resourceId\": \"gid://shopify/Collection/375350346\",\n \"type\": \"COLLECTION\",\n \"items\": []\n },\n {\n \"id\": \"gid://shopify/MenuItem/837241978\",\n \"title\": \"Massage Chairs\",\n \"url\": \"/collections/massage%20chairs\",\n \"resourceId\": \"gid://shopify/Collection/837241978\",\n \"type\": \"COLLECTION\",\n \"items\": []\n },\n {\n \"id\": \"gid://shopify/MenuItem/960081962\",\n \"title\": \"Living Room Rugs\",\n \"url\": \"/collections/living%20room%20rugs\",\n \"resourceId\": \"gid://shopify/Collection/960081962\",\n \"type\": \"COLLECTION\",\n \"items\": []\n }\n ]\n },\n {\n \"id\": \"gid://shopify/MenuItem/715378231\",\n \"title\": \"Kitchen\",\n \"url\": \"/collections/kitchen\",\n \"resourceId\": \"gid://shopify/Collection/715378231\",\n \"type\": \"COLLECTION\",\n \"items\": [\n {\n \"id\": \"gid://shopify/MenuItem/108641250\",\n \"title\": \"Chairs\",\n \"url\": \"/collections/chairs\",\n \"resourceId\": \"gid://shopify/Collection/108641250\",\n \"type\": \"COLLECTION\",\n \"items\": []\n },\n {\n \"id\": \"gid://shopify/MenuItem/71762467\",\n \"title\": \"Tables\",\n \"url\": \"/collections/tables\",\n \"resourceId\": \"gid://shopify/Collection/71762467\",\n \"type\": \"COLLECTION\",\n \"items\": []\n },\n {\n \"id\": \"gid://shopify/MenuItem/826396515\",\n \"title\": \"Kitchen Rugs\",\n \"url\": \"/collections/kitchen%20rugs\",\n \"resourceId\": \"gid://shopify/Collection/826396515\",\n \"type\": \"COLLECTION\",\n \"items\": []\n }\n ]\n }\n ]\n },\n {\n \"id\": \"gid://shopify/MenuItem/698896745\",\n \"title\": \"Mega Sofa Sale\",\n \"url\": \"/collections/mega%20sale\",\n \"resourceId\": \"gid://shopify/Collection/307741084\",\n \"type\": \"COLLECTION\",\n \"items\": []\n }\n ]\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation UpdateMenu($id: ID!, $title: String!, $handle: String!, $items: [MenuItemUpdateInput!]!) {\n menuUpdate(id: $id, title: $title, handle: $handle, items: $items) {\n menu {\n id\n handle\n items {\n id\n title\n items {\n id\n title\n }\n }\n }\n }\n}"
input: { "id": "gid://shopify/Menu/442047006", "title": "updated menu", "handle": "danielstuff-main-menu", "items": [ { "id": "gid://shopify/MenuItem/398712010", "title": "Electronics", "url": "collection/tables", "resourceId": "gid://shopify/Collection/71762467", "type": "COLLECTION", "items": [] }, { "id": "gid://shopify/MenuItem/643685044", "title": "Furniture", "url": "/collections/furniture", "resourceId": "gid://shopify/Collection/643685044", "type": "COLLECTION", "items": [ { "id": "gid://shopify/MenuItem/927352226", "title": "Updated Living Room", "url": "/collections/living-room", "resourceId": "gid://shopify/Collection/927352226", "type": "COLLECTION", "items": [ { "id": "gid://shopify/MenuItem/307741084", "title": "Sofa", "url": "/collections/sofa", "resourceId": "gid://shopify/Collection/307741084", "type": "COLLECTION", "items": [] }, { "id": "gid://shopify/MenuItem/375350346", "title": "Sound System", "url": "/collections/sound-system", "resourceId": "gid://shopify/Collection/375350346", "type": "COLLECTION", "items": [] }, { "id": "gid://shopify/MenuItem/837241978", "title": "Massage Chairs", "url": "/collections/massage%20chairs", "resourceId": "gid://shopify/Collection/837241978", "type": "COLLECTION", "items": [] }, { "id": "gid://shopify/MenuItem/960081962", "title": "Living Room Rugs", "url": "/collections/living%20room%20rugs", "resourceId": "gid://shopify/Collection/960081962", "type": "COLLECTION", "items": [] } ] }, { "id": "gid://shopify/MenuItem/715378231", "title": "Kitchen", "url": "/collections/kitchen", "resourceId": "gid://shopify/Collection/715378231", "type": "COLLECTION", "items": [ { "id": "gid://shopify/MenuItem/108641250", "title": "Chairs", "url": "/collections/chairs", "resourceId": "gid://shopify/Collection/108641250", "type": "COLLECTION", "items": [] }, { "id": "gid://shopify/MenuItem/71762467", "title": "Tables", "url": "/collections/tables", "resourceId": "gid://shopify/Collection/71762467", "type": "COLLECTION", "items": [] }, { "id": "gid://shopify/MenuItem/826396515", "title": "Kitchen Rugs", "url": "/collections/kitchen%20rugs", "resourceId": "gid://shopify/Collection/826396515", "type": "COLLECTION", "items": [] } ] } ] }, { "id": "gid://shopify/MenuItem/698896745", "title": "Mega Sofa Sale", "url": "/collections/mega%20sale", "resourceId": "gid://shopify/Collection/307741084", "type": "COLLECTION", "items": [] } ] }
response: { "data": { "menuUpdate": { "menu": { "id": "gid://shopify/Menu/442047006", "handle": "danielstuff-main-menu", "items": [ { "id": "gid://shopify/MenuItem/398712010", "title": "Electronics", "items": [] }, { "id": "gid://shopify/MenuItem/643685044", "title": "Furniture", "items": [ { "id": "gid://shopify/MenuItem/927352226", "title": "Updated Living Room" }, { "id": "gid://shopify/MenuItem/715378231", "title": "Kitchen" } ] }, { "id": "gid://shopify/MenuItem/698896745", "title": "Mega Sofa Sale", "items": [] } ] } } } }