Skip to content

Commit

Permalink
Add checkoutUserError field selection to remaining checkout mutations.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiemtdwyer committed Feb 14, 2019
1 parent 51d07c1 commit fc3f86f
Show file tree
Hide file tree
Showing 18 changed files with 1,146 additions and 454 deletions.
1 change: 1 addition & 0 deletions fixtures/checkout-line-items-add-fixture.js
Expand Up @@ -2,6 +2,7 @@ export default {
"data": {
"checkoutLineItemsAdd": {
"userErrors": [],
"checkoutUserErrors" : [],
"checkout": {
"id": "Z2lkOi8vc2hvcGlmeS9DaGVja291dC9lM2JkNzFmNzI0OGM4MDZmMzM3MjVhNTNlMzM5MzFlZj9rZXk9NDcwOTJlNDQ4NTI5MDY4ZDFiZTUyZTUwNTE2MDNhZjg=",
"createdAt": "2017-03-17T16:00:40Z",
Expand Down
20 changes: 20 additions & 0 deletions fixtures/checkout-line-items-add-with-user-errors-fixture.js
@@ -0,0 +1,20 @@
export default {
"data": {
"checkoutLineItemsAdd": {
"userErrors": [
{
"message": "Variant is invalid",
"field": ["lineItems", "0", "variantId"]
}
],
"checkoutUserErrors": [
{
"message": "Variant is invalid",
"field": ["lineItems", "0", "variantId"],
"code": "INVALID"
},
],
"checkout": null
}
}
};
1 change: 1 addition & 0 deletions fixtures/checkout-line-items-remove-fixture.js
Expand Up @@ -2,6 +2,7 @@ export default {
"data": {
"checkoutLineItemsRemove": {
"userErrors": [],
"checkoutUserErrors": [],
"checkout": {
"id": "Z2lkOi8vc2hvcGlmeS9DaGVja291dC9lM2JkNzFmNzI0OGM4MDZmMzM3MjVhNTNlMzM5MzFlZj9rZXk9NDcwOTJlNDQ4NTI5MDY4ZDFiZTUyZTUwNTE2MDNhZjg=",
"ready": true,
Expand Down
20 changes: 20 additions & 0 deletions fixtures/checkout-line-items-remove-with-user-errors-fixture.js
@@ -0,0 +1,20 @@
export default {
"data": {
"checkoutLineItemsRemove": {
"userErrors": [
{
"message": "Line item with id abcdefgh not found",
"field": null,
}
],
"checkoutUserErrors": [
{
"message": "Line item with id abcdefgh not found",
"field": null,
"code": "LINE_ITEM_NOT_FOUND"
}
],
"checkout": null
}
}
};
14 changes: 14 additions & 0 deletions fixtures/checkout-line-items-replace-with-user-errors-fixture.js
@@ -0,0 +1,14 @@
export default {
"data": {
"checkoutLineItemsReplace": {
"userErrors": [
{
"message": "Variant is invalid",
"field": ['lineItems', '0', 'variantId'],
"code": "INVALID"
}
],
"checkout": null
}
}
};
5 changes: 2 additions & 3 deletions fixtures/checkout-line-items-update-fixture.js
@@ -1,9 +1,8 @@
export default {
"data":{
"checkoutLineItemsUpdate":{
"userErrors":[

],
"userErrors":[],
"checkoutUserErrors": [],
"checkout":{
"id":"Z2lkOi8vc2hvcGlmeS9DaGVja291dC9lM2JkNzFmNzI0OGM4MDZmMzM3MjVhNTNlMzM5MzFlZj9rZXk9NDcwOTJlNDQ4NTI5MDY4ZDFiZTUyZTUwNTE2MDNhZjg=",
"ready":true,
Expand Down
20 changes: 20 additions & 0 deletions fixtures/checkout-line-items-update-with-user-errors-fixture.js
@@ -0,0 +1,20 @@
export default {
"data":{
"checkoutLineItemsUpdate":{
"userErrors": [
{
"message": "Variant is invalid",
"field": ['lineItems', '0', 'variantId']
}
],
"checkoutUserErrors": [
{
"message": "Variant is invalid",
"field": ['lineItems', '0', 'variantId'],
"code": "INVALID"
}
],
"checkout": null
}
}
};
1 change: 1 addition & 0 deletions fixtures/checkout-shipping-address-update-v2-fixture.js
Expand Up @@ -2,6 +2,7 @@ export default {
"data": {
"checkoutShippingAddressUpdateV2": {
"userErrors": [],
"checkoutUserErrors": [],
"checkout": {
"id": "Z2lkOi8vc2hvcGlmeS9DaGVja291dC9lM2JkNzFmNzI0OGM4MDZmMzM3MjVhNTNlMzM5MzFlZj9rZXk9NDcwOTJlNDQ4NTI5MDY4ZDFiZTUyZTUwNTE2MDNhZjg=",
"createdAt": "2017-03-17T16:00:40Z",
Expand Down
Expand Up @@ -4,9 +4,17 @@ export default {
"userErrors": [
{
"message": 'Country is not supported',
"field": ['shippingAddress country']
"field": ['shippingAddress', 'country'],
},
],
"checkoutUserErrors" : [
{
"message": 'Country is not supported',
"field": ['shippingAddress', 'country'],
"code": 'NOT_SUPPORTED'
}
]
],
"checkout": null
}
}
};
20 changes: 20 additions & 0 deletions fixtures/checkout-update-custom-attrs-with-user-errors-fixture.js
@@ -0,0 +1,20 @@
export default {
"data": {
"checkoutAttributesUpdateV2": {
"checkoutUserErrors": [
{
"message": "Note is too long (maximum is 5000 characters)",
"field": ['input', 'note'],
"code": "TOO_LONG"
}
],
"userErrors": [
{
"message": "Note is too long (maximum is 5000 characters)",
"field": ['input', 'note']
}
],
"checkout": null
}
}
};
20 changes: 20 additions & 0 deletions fixtures/checkout-update-email-with-user-errors-fixture.js
@@ -0,0 +1,20 @@
export default {
"data": {
"checkoutEmailUpdateV2": {
"checkoutUserErrors": [
{
"message": "Email is invalid",
"field": ['email'],
"code": "INVALID"
}
],
"userErrors": [
{
"message": "Email is invalid",
"field": ['email'],
}
],
"checkout": null
}
}
};

0 comments on commit fc3f86f

Please sign in to comment.