Skip to content

Commit

Permalink
Merge pull request #5060 from kiva/fix-reduce-checkout-query-complexity
Browse files Browse the repository at this point in the history
fix: reduce checkout query complexity
  • Loading branch information
mcstover authored Nov 6, 2023
2 parents 88f80e5 + 646915b commit 04af76d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
3 changes: 2 additions & 1 deletion config/dev-local.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = merge(base, devVm, {
apolloBatching: false,
host: 'localhost',
publicPath: '/',
photoPath: 'https://www-dev-kiva-org.freetls.fastly.net/img/',
photoPath: 'https://www.development.kiva.org/img/',
graphqlUri: 'https://gateway.development.kiva.org/graphql',
enableAnalytics: false,
enableSnowplow: false,
Expand All @@ -23,6 +23,7 @@ module.exports = merge(base, devVm, {
enable: true,
browserCallbackUri: 'http://localhost:8888/process-browser-auth',
serverCallbackUri: 'http://localhost:8888/process-ssr-auth',
apiAudience: 'https://api.development.kiva.org/graphql',
},
},
server: {
Expand Down
12 changes: 12 additions & 0 deletions src/graphql/query/checkout/checkoutSettings.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ query checkoutSettings($basketId: String) {
value
key
}
ftd_message_enable: uiConfigSetting(key: "ftd_message_enable") {
key
value
}
ftd_message_amount: uiConfigSetting(key: "ftd_message_amount") {
key
value
}
ftd_message_valid_date: uiConfigSetting(key: "ftd_message_valid_date") {
key
value
}
}
shop (basketId: $basketId) {
id
Expand Down
12 changes: 0 additions & 12 deletions src/graphql/query/checkout/initializeCheckout.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,6 @@ query initializeCheckout($basketId: String) {
value
description
}
ftd_message_enable: uiConfigSetting(key: "ftd_message_enable") {
key
value
}
ftd_message_amount: uiConfigSetting(key: "ftd_message_amount") {
key
value
}
ftd_message_valid_date: uiConfigSetting(key: "ftd_message_valid_date") {
key
value
}
}
shop (basketId: $basketId) {
id
Expand Down
8 changes: 8 additions & 0 deletions src/pages/Checkout/CheckoutPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,14 @@ export default {
const validationErrors = _get(shopMutationData, 'validatePreCheckout', []);
this.showCheckoutError(validationErrors, true);
// Fire error for empty shop state
if (!this.isServer && !this.totals) {
Sentry.withScope(scope => {
scope.setTag('init_checkout', 'Missing baseline basket information');
Sentry.captureMessage(`Missing baseline basket information; totals value is ${this.totals}.`);
});
}
// TODO: Implement check against contentful setting
// to signify if holiday mode is enabled
Expand Down

0 comments on commit 04af76d

Please sign in to comment.