product Variant Relationship Bulk Updatemutation
mutation
2024-10latest
Requires write
access scope. Also: The shop must have access to bundles feature.
Creates new bundles, updates existing bundles, and removes bundle components for one or multiple bundles.
Arguments
The input options for the product variant being updated.
Was this section helpful?
ProductVariantRelationshipBulkUpdatePayload returns
The product variants with successfully updated product variant relationships.
The list of errors that occurred from executing the mutation.
Was this section helpful?
Code examples for MUTATION: productVariantRelationshipBulkUpdate
Query Reference for MUTATION: productVariantRelationshipBulkUpdate
"mutation productVariantRelationshipBulkUpdate($input: [ProductVariantRelationshipUpdateInput!]!) {\n productVariantRelationshipBulkUpdate(input: $input) {\n parentProductVariants {\n # ProductVariant fields\n }\n userErrors {\n field\n message\n }\n }\n}"
Input Reference for MUTATION: productVariantRelationshipBulkUpdate
"{\n \"input\": [\n {\n \"parentProductId\": \"gid://shopify/<objectName>/10079785100\",\n \"parentProductVariantId\": \"gid://shopify/<objectName>/10079785100\",\n \"priceInput\": {\n \"calculation\": \"COMPONENTS_SUM\",\n \"price\": \"100.57\"\n },\n \"productVariantRelationshipsToCreate\": [\n {\n \"id\": \"gid://shopify/<objectName>/10079785100\",\n \"quantity\": 1\n }\n ],\n \"productVariantRelationshipsToRemove\": [\n \"gid://shopify/<objectName>/10079785100\"\n ],\n \"productVariantRelationshipsToUpdate\": [\n {\n \"id\": \"gid://shopify/<objectName>/10079785100\",\n \"quantity\": 1\n }\n ],\n \"removeAllProductVariantRelationships\": true\n }\n ]\n}"
Schema Reference for MUTATION: productVariantRelationshipBulkUpdate
"input ProductVariantRelationshipUpdateInput {\n parentProductId: ID\n parentProductVariantId: ID\n priceInput: PriceInput\n productVariantRelationshipsToCreate: [ProductVariantGroupRelationshipInput!]\n productVariantRelationshipsToRemove: [ID!]\n productVariantRelationshipsToUpdate: [ProductVariantGroupRelationshipInput!]\n removeAllProductVariantRelationships: Boolean\n}\n\ninput PriceInput {\n calculation: PriceCalculationType\n price: Money\n}\n\ninput ProductVariantGroupRelationshipInput {\n id: ID!\n quantity: Int!\n}\n"
Display Examples for MUTATION: productVariantRelationshipBulkUpdate
[ { "example": { "type_name": "productvariantrelationshipbulkupdate", "title": "Create a bundle by adding components to a product variant", "description": "Creates a new product variant relationship between the parent variant and the child variant\npassed in the input.\n", "query_string": "mutation CreateBundle($input: [ProductVariantRelationshipUpdateInput!]!) {\n productVariantRelationshipBulkUpdate(input: $input) {\n parentProductVariants {\n id\n productVariantComponents(first: 10) {\n nodes {\n id\n productVariant {\n id\n displayName\n }\n }\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n}", "variables": { "input": [ { "parentProductVariantId": "gid://shopify/ProductVariant/799757249", "productVariantRelationshipsToCreate": [ { "id": "gid://shopify/ProductVariant/149896808", "quantity": 1 }, { "id": "gid://shopify/ProductVariant/709406719", "quantity": 1 } ] } ] }, "response": { "data": { "productVariantRelationshipBulkUpdate": { "parentProductVariants": [ { "id": "gid://shopify/ProductVariant/799757249", "productVariantComponents": { "nodes": [ { "id": "gid://shopify/ProductVariantComponent/993184086", "productVariant": { "id": "gid://shopify/ProductVariant/149896808", "displayName": "Composite_Sauce_Pack - component_product_variant_classic_hot_sauce" } }, { "id": "gid://shopify/ProductVariantComponent/993184087", "productVariant": { "id": "gid://shopify/ProductVariant/709406719", "displayName": "Composite_Sauce_Pack - component_product_variant_classic_garlic_sauce" } } ] } } ], "userErrors": [] } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/merchandising/test/unit/merchandising/graph_api/admin/mutations/product_variant_relationship_bulk_update_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation CreateBundle($input: [ProductVariantRelationshipUpdateInput!]!) { productVariantRelationshipBulkUpdate(input: $input) { parentProductVariants { id productVariantComponents(first: 10) { nodes { id productVariant { id displayName } } } } userErrors { code field message } } }\",\n \"variables\": {\n \"input\": [\n {\n \"parentProductVariantId\": \"gid://shopify/ProductVariant/799757249\",\n \"productVariantRelationshipsToCreate\": [\n {\n \"id\": \"gid://shopify/ProductVariant/149896808\",\n \"quantity\": 1\n },\n {\n \"id\": \"gid://shopify/ProductVariant/709406719\",\n \"quantity\": 1\n }\n ]\n }\n ]\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation CreateBundle($input: [ProductVariantRelationshipUpdateInput!]!) {\n productVariantRelationshipBulkUpdate(input: $input) {\n parentProductVariants {\n id\n productVariantComponents(first: 10) {\n nodes {\n id\n productVariant {\n id\n displayName\n }\n }\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"input\": [\n {\n \"parentProductVariantId\": \"gid://shopify/ProductVariant/799757249\",\n \"productVariantRelationshipsToCreate\": [\n {\n \"id\": \"gid://shopify/ProductVariant/149896808\",\n \"quantity\": 1\n },\n {\n \"id\": \"gid://shopify/ProductVariant/709406719\",\n \"quantity\": 1\n }\n ]\n }\n ]\n },\n },\n);\n\nconst data = await response.json();\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 CreateBundle($input: [ProductVariantRelationshipUpdateInput!]!) {\n productVariantRelationshipBulkUpdate(input: $input) {\n parentProductVariants {\n id\n productVariantComponents(first: 10) {\n nodes {\n id\n productVariant {\n id\n displayName\n }\n }\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"input\": [{\"parentProductVariantId\"=>\"gid://shopify/ProductVariant/799757249\", \"productVariantRelationshipsToCreate\"=>[{\"id\"=>\"gid://shopify/ProductVariant/149896808\", \"quantity\"=>1}, {\"id\"=>\"gid://shopify/ProductVariant/709406719\", \"quantity\"=>1}]}]\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation CreateBundle($input: [ProductVariantRelationshipUpdateInput!]!) {\n productVariantRelationshipBulkUpdate(input: $input) {\n parentProductVariants {\n id\n productVariantComponents(first: 10) {\n nodes {\n id\n productVariant {\n id\n displayName\n }\n }\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"input\": [\n {\n \"parentProductVariantId\": \"gid://shopify/ProductVariant/799757249\",\n \"productVariantRelationshipsToCreate\": [\n {\n \"id\": \"gid://shopify/ProductVariant/149896808\",\n \"quantity\": 1\n },\n {\n \"id\": \"gid://shopify/ProductVariant/709406719\",\n \"quantity\": 1\n }\n ]\n }\n ]\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation CreateBundle($input: [ProductVariantRelationshipUpdateInput!]!) {\n productVariantRelationshipBulkUpdate(input: $input) {\n parentProductVariants {\n id\n productVariantComponents(first: 10) {\n nodes {\n id\n productVariant {\n id\n displayName\n }\n }\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n }\nQUERY;\n\n$variables = [\n \"input\" => [{\"parentProductVariantId\"=>\"gid://shopify/ProductVariant/799757249\", \"productVariantRelationshipsToCreate\"=>[{\"id\"=>\"gid://shopify/ProductVariant/149896808\", \"quantity\"=>1}, {\"id\"=>\"gid://shopify/ProductVariant/709406719\", \"quantity\"=>1}]}],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "input", "description": "The input options for the product variant being updated.", "type": { "kind": "INPUT_OBJECT", "name": "ProductVariantRelationshipUpdateInput", "list": true, "non_null": true }, "defaultValue": null, "typeSignature": "[ProductVariantRelationshipUpdateInput!]!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "input", "argValue": " [{\"parentProductVariantId\":\"gid://shopify/ProductVariant/799757249\",\"productVariantRelationshipsToCreate\":[{\"id\":\"gid://shopify/ProductVariant/149896808\",\"quantity\":1},{\"id\":\"gid://shopify/ProductVariant/709406719\",\"quantity\":1}]}]", "typeKind": "MUTATION" } ] }, { "example": { "type_name": "productvariantrelationshipbulkupdate", "title": "Delete a product variant component", "description": "Removes all the product variant relationships associated with a variant.", "query_string": "mutation RemoveABundleComponent($input: [ProductVariantRelationshipUpdateInput!]!) {\n productVariantRelationshipBulkUpdate(input: $input) {\n parentProductVariants {\n id\n productVariantComponents(first: 10) {\n nodes {\n id\n productVariant {\n id\n displayName\n }\n }\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n}", "variables": { "input": [ { "parentProductVariantId": "gid://shopify/ProductVariant/799757249", "productVariantRelationshipsToRemove": [ "gid://shopify/ProductVariant/149896808" ] } ] }, "response": { "data": { "productVariantRelationshipBulkUpdate": { "parentProductVariants": [ { "id": "gid://shopify/ProductVariant/799757249", "productVariantComponents": { "nodes": [ { "id": "gid://shopify/ProductVariantComponent/636669297", "productVariant": { "id": "gid://shopify/ProductVariant/709406719", "displayName": "Composite_Sauce_Pack - component_product_variant_classic_garlic_sauce" } } ] } } ], "userErrors": [] } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/merchandising/test/unit/merchandising/graph_api/admin/mutations/product_variant_relationship_bulk_update_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation RemoveABundleComponent($input: [ProductVariantRelationshipUpdateInput!]!) { productVariantRelationshipBulkUpdate(input: $input) { parentProductVariants { id productVariantComponents(first: 10) { nodes { id productVariant { id displayName } } } } userErrors { code field message } } }\",\n \"variables\": {\n \"input\": [\n {\n \"parentProductVariantId\": \"gid://shopify/ProductVariant/799757249\",\n \"productVariantRelationshipsToRemove\": [\n \"gid://shopify/ProductVariant/149896808\"\n ]\n }\n ]\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation RemoveABundleComponent($input: [ProductVariantRelationshipUpdateInput!]!) {\n productVariantRelationshipBulkUpdate(input: $input) {\n parentProductVariants {\n id\n productVariantComponents(first: 10) {\n nodes {\n id\n productVariant {\n id\n displayName\n }\n }\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"input\": [\n {\n \"parentProductVariantId\": \"gid://shopify/ProductVariant/799757249\",\n \"productVariantRelationshipsToRemove\": [\n \"gid://shopify/ProductVariant/149896808\"\n ]\n }\n ]\n },\n },\n);\n\nconst data = await response.json();\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 RemoveABundleComponent($input: [ProductVariantRelationshipUpdateInput!]!) {\n productVariantRelationshipBulkUpdate(input: $input) {\n parentProductVariants {\n id\n productVariantComponents(first: 10) {\n nodes {\n id\n productVariant {\n id\n displayName\n }\n }\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"input\": [{\"parentProductVariantId\"=>\"gid://shopify/ProductVariant/799757249\", \"productVariantRelationshipsToRemove\"=>[\"gid://shopify/ProductVariant/149896808\"]}]\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation RemoveABundleComponent($input: [ProductVariantRelationshipUpdateInput!]!) {\n productVariantRelationshipBulkUpdate(input: $input) {\n parentProductVariants {\n id\n productVariantComponents(first: 10) {\n nodes {\n id\n productVariant {\n id\n displayName\n }\n }\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"input\": [\n {\n \"parentProductVariantId\": \"gid://shopify/ProductVariant/799757249\",\n \"productVariantRelationshipsToRemove\": [\n \"gid://shopify/ProductVariant/149896808\"\n ]\n }\n ]\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation RemoveABundleComponent($input: [ProductVariantRelationshipUpdateInput!]!) {\n productVariantRelationshipBulkUpdate(input: $input) {\n parentProductVariants {\n id\n productVariantComponents(first: 10) {\n nodes {\n id\n productVariant {\n id\n displayName\n }\n }\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n }\nQUERY;\n\n$variables = [\n \"input\" => [{\"parentProductVariantId\"=>\"gid://shopify/ProductVariant/799757249\", \"productVariantRelationshipsToRemove\"=>[\"gid://shopify/ProductVariant/149896808\"]}],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "input", "description": "The input options for the product variant being updated.", "type": { "kind": "INPUT_OBJECT", "name": "ProductVariantRelationshipUpdateInput", "list": true, "non_null": true }, "defaultValue": null, "typeSignature": "[ProductVariantRelationshipUpdateInput!]!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "input", "argValue": " [{\"parentProductVariantId\":\"gid://shopify/ProductVariant/799757249\",\"productVariantRelationshipsToRemove\":[\"gid://shopify/ProductVariant/149896808\"]}]", "typeKind": "MUTATION" } ] }, { "example": { "type_name": "productvariantrelationshipbulkupdate", "title": "Remove all product variant components of a bundle", "description": "Removes all the product variant relationships associated with a variant.", "query_string": "mutation RemoveAllBundleComponents($input: [ProductVariantRelationshipUpdateInput!]!) {\n productVariantRelationshipBulkUpdate(input: $input) {\n parentProductVariants {\n id\n productVariantComponents(first: 10) {\n nodes {\n id\n productVariant {\n id\n displayName\n }\n }\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n}", "variables": { "input": [ { "parentProductVariantId": "gid://shopify/ProductVariant/799757249", "removeAllProductVariantRelationships": true } ] }, "response": { "data": { "productVariantRelationshipBulkUpdate": { "parentProductVariants": [ { "id": "gid://shopify/ProductVariant/799757249", "productVariantComponents": { "nodes": [] } } ], "userErrors": [] } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/merchandising/test/unit/merchandising/graph_api/admin/mutations/product_variant_relationship_bulk_update_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation RemoveAllBundleComponents($input: [ProductVariantRelationshipUpdateInput!]!) { productVariantRelationshipBulkUpdate(input: $input) { parentProductVariants { id productVariantComponents(first: 10) { nodes { id productVariant { id displayName } } } } userErrors { code field message } } }\",\n \"variables\": {\n \"input\": [\n {\n \"parentProductVariantId\": \"gid://shopify/ProductVariant/799757249\",\n \"removeAllProductVariantRelationships\": true\n }\n ]\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation RemoveAllBundleComponents($input: [ProductVariantRelationshipUpdateInput!]!) {\n productVariantRelationshipBulkUpdate(input: $input) {\n parentProductVariants {\n id\n productVariantComponents(first: 10) {\n nodes {\n id\n productVariant {\n id\n displayName\n }\n }\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"input\": [\n {\n \"parentProductVariantId\": \"gid://shopify/ProductVariant/799757249\",\n \"removeAllProductVariantRelationships\": true\n }\n ]\n },\n },\n);\n\nconst data = await response.json();\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 RemoveAllBundleComponents($input: [ProductVariantRelationshipUpdateInput!]!) {\n productVariantRelationshipBulkUpdate(input: $input) {\n parentProductVariants {\n id\n productVariantComponents(first: 10) {\n nodes {\n id\n productVariant {\n id\n displayName\n }\n }\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"input\": [{\"parentProductVariantId\"=>\"gid://shopify/ProductVariant/799757249\", \"removeAllProductVariantRelationships\"=>true}]\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation RemoveAllBundleComponents($input: [ProductVariantRelationshipUpdateInput!]!) {\n productVariantRelationshipBulkUpdate(input: $input) {\n parentProductVariants {\n id\n productVariantComponents(first: 10) {\n nodes {\n id\n productVariant {\n id\n displayName\n }\n }\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"input\": [\n {\n \"parentProductVariantId\": \"gid://shopify/ProductVariant/799757249\",\n \"removeAllProductVariantRelationships\": true\n }\n ]\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation RemoveAllBundleComponents($input: [ProductVariantRelationshipUpdateInput!]!) {\n productVariantRelationshipBulkUpdate(input: $input) {\n parentProductVariants {\n id\n productVariantComponents(first: 10) {\n nodes {\n id\n productVariant {\n id\n displayName\n }\n }\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n }\nQUERY;\n\n$variables = [\n \"input\" => [{\"parentProductVariantId\"=>\"gid://shopify/ProductVariant/799757249\", \"removeAllProductVariantRelationships\"=>true}],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "input", "description": "The input options for the product variant being updated.", "type": { "kind": "INPUT_OBJECT", "name": "ProductVariantRelationshipUpdateInput", "list": true, "non_null": true }, "defaultValue": null, "typeSignature": "[ProductVariantRelationshipUpdateInput!]!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "input", "argValue": " [{\"parentProductVariantId\":\"gid://shopify/ProductVariant/799757249\",\"removeAllProductVariantRelationships\":true}]", "typeKind": "MUTATION" } ] }, { "example": { "type_name": "productvariantrelationshipbulkupdate", "title": "Update a product variant relationship", "description": "Updates the quantity of a bundle component.", "query_string": "mutation UpdateBundleComponent($input: [ProductVariantRelationshipUpdateInput!]!) {\n productVariantRelationshipBulkUpdate(input: $input) {\n parentProductVariants {\n id\n productVariantComponents(first: 10) {\n nodes {\n id\n productVariant {\n id\n displayName\n }\n }\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n}", "variables": { "input": [ { "parentProductVariantId": "gid://shopify/ProductVariant/799757249", "productVariantRelationshipsToUpdate": [ { "id": "gid://shopify/ProductVariant/149896808", "quantity": 33 } ] } ] }, "response": { "data": { "productVariantRelationshipBulkUpdate": { "parentProductVariants": [ { "id": "gid://shopify/ProductVariant/799757249", "productVariantComponents": { "nodes": [ { "id": "gid://shopify/ProductVariantComponent/477596995", "productVariant": { "id": "gid://shopify/ProductVariant/149896808", "displayName": "Composite_Sauce_Pack - component_product_variant_classic_hot_sauce" } }, { "id": "gid://shopify/ProductVariantComponent/636669297", "productVariant": { "id": "gid://shopify/ProductVariant/709406719", "displayName": "Composite_Sauce_Pack - component_product_variant_classic_garlic_sauce" } } ] } } ], "userErrors": [] } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/merchandising/test/unit/merchandising/graph_api/admin/mutations/product_variant_relationship_bulk_update_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation UpdateBundleComponent($input: [ProductVariantRelationshipUpdateInput!]!) { productVariantRelationshipBulkUpdate(input: $input) { parentProductVariants { id productVariantComponents(first: 10) { nodes { id productVariant { id displayName } } } } userErrors { code field message } } }\",\n \"variables\": {\n \"input\": [\n {\n \"parentProductVariantId\": \"gid://shopify/ProductVariant/799757249\",\n \"productVariantRelationshipsToUpdate\": [\n {\n \"id\": \"gid://shopify/ProductVariant/149896808\",\n \"quantity\": 33\n }\n ]\n }\n ]\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation UpdateBundleComponent($input: [ProductVariantRelationshipUpdateInput!]!) {\n productVariantRelationshipBulkUpdate(input: $input) {\n parentProductVariants {\n id\n productVariantComponents(first: 10) {\n nodes {\n id\n productVariant {\n id\n displayName\n }\n }\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"input\": [\n {\n \"parentProductVariantId\": \"gid://shopify/ProductVariant/799757249\",\n \"productVariantRelationshipsToUpdate\": [\n {\n \"id\": \"gid://shopify/ProductVariant/149896808\",\n \"quantity\": 33\n }\n ]\n }\n ]\n },\n },\n);\n\nconst data = await response.json();\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 UpdateBundleComponent($input: [ProductVariantRelationshipUpdateInput!]!) {\n productVariantRelationshipBulkUpdate(input: $input) {\n parentProductVariants {\n id\n productVariantComponents(first: 10) {\n nodes {\n id\n productVariant {\n id\n displayName\n }\n }\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"input\": [{\"parentProductVariantId\"=>\"gid://shopify/ProductVariant/799757249\", \"productVariantRelationshipsToUpdate\"=>[{\"id\"=>\"gid://shopify/ProductVariant/149896808\", \"quantity\"=>33}]}]\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation UpdateBundleComponent($input: [ProductVariantRelationshipUpdateInput!]!) {\n productVariantRelationshipBulkUpdate(input: $input) {\n parentProductVariants {\n id\n productVariantComponents(first: 10) {\n nodes {\n id\n productVariant {\n id\n displayName\n }\n }\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"input\": [\n {\n \"parentProductVariantId\": \"gid://shopify/ProductVariant/799757249\",\n \"productVariantRelationshipsToUpdate\": [\n {\n \"id\": \"gid://shopify/ProductVariant/149896808\",\n \"quantity\": 33\n }\n ]\n }\n ]\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation UpdateBundleComponent($input: [ProductVariantRelationshipUpdateInput!]!) {\n productVariantRelationshipBulkUpdate(input: $input) {\n parentProductVariants {\n id\n productVariantComponents(first: 10) {\n nodes {\n id\n productVariant {\n id\n displayName\n }\n }\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n }\nQUERY;\n\n$variables = [\n \"input\" => [{\"parentProductVariantId\"=>\"gid://shopify/ProductVariant/799757249\", \"productVariantRelationshipsToUpdate\"=>[{\"id\"=>\"gid://shopify/ProductVariant/149896808\", \"quantity\"=>33}]}],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "input", "description": "The input options for the product variant being updated.", "type": { "kind": "INPUT_OBJECT", "name": "ProductVariantRelationshipUpdateInput", "list": true, "non_null": true }, "defaultValue": null, "typeSignature": "[ProductVariantRelationshipUpdateInput!]!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "input", "argValue": " [{\"parentProductVariantId\":\"gid://shopify/ProductVariant/799757249\",\"productVariantRelationshipsToUpdate\":[{\"id\":\"gid://shopify/ProductVariant/149896808\",\"quantity\":33}]}]", "typeKind": "MUTATION" } ] } ]