Skip to content

Instantly share code, notes, and snippets.

@pRoy24
Last active January 20, 2019 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pRoy24/e0e1a1559aff41223cd823bf9694c8bd to your computer and use it in GitHub Desktop.
Save pRoy24/e0e1a1559aff41223cd823bf9694c8bd to your computer and use it in GitHub Desktop.
const req_query =
mutation productDuplicate($productId: ID!, $newTitle: String!) {
productDuplicate(productId: $productId, newTitle: $newTitle) {
userErrors {
field
message
}
imageJob {
id
}
newProduct {
id
}
shop {
id
}
}
}
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