Last active
January 20, 2019 18:14
-
-
Save pRoy24/e0e1a1559aff41223cd823bf9694c8bd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const req_query = | |
mutation productDuplicate($productId: ID!, $newTitle: String!) { | |
productDuplicate(productId: $productId, newTitle: $newTitle) { | |
userErrors { | |
field | |
message | |
} | |
imageJob { | |
id | |
} | |
newProduct { | |
id | |
} | |
shop { | |
id | |
} | |
} | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
axios.get(`/admin/product/id.json`).then(function(productResponse){ | |
let newProductBody = productResponse.product; | |
newProductBody.title = "My New Title"; | |
axios.post(`/admin/product.json, newProductBody).then(function(productCreateResponse) { | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment