From 9752bf0983eff363a95d2b8e429e2cf9c862f60d Mon Sep 17 00:00:00 2001 From: Jade Geels Date: Tue, 10 Dec 2024 11:48:34 +0100 Subject: [PATCH] Update check prop & upgrade guide --- src/3.x/graphql-components.md | 2 +- src/3.x/upgrading.md | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/3.x/graphql-components.md b/src/3.x/graphql-components.md index c92de68..0ba59d1 100644 --- a/src/3.x/graphql-components.md +++ b/src/3.x/graphql-components.md @@ -30,7 +30,7 @@ Prop | Type | Default | Explanation `variables` | Object | `{}` | GraphQL variables `store` | String | `window.config.store_code` | Store code [`group`](#grouping) | String | | Bundle queries by a name into 1 request [see: group](#grouping) -`check` | String | | Run a check on the response data, for example: `check="data.countries[0] == 'Country'"` +`check` | Function | | Run a check on the response data, for example: `check="(data) => data.countries[0] == 'Country'"` `redirect` | String | | Where to redirect if the check fails `cache` | String | | Cache key in localstorage. Caches only when provided and will be prefixed with `graphql_`. Flushes when the [cache](cache.md) is cleared. `callback` | Function | | Called after the query diff --git a/src/3.x/upgrading.md b/src/3.x/upgrading.md index ae900fc..cac37cb 100644 --- a/src/3.x/upgrading.md +++ b/src/3.x/upgrading.md @@ -39,7 +39,8 @@ class Authenticate extends Middleware } ``` -## Frontend dependencies +## Frontend changes +### Dependencies 1. **Install** ``` @@ -54,6 +55,10 @@ yarn build If you need to interact with the current Vue instance, do not use `turbo:load`. Instead use `vue:loaded` to ensure Vue has actually been booted. +### Graphql component + +The `check` property on the graphql component has been changed from a string that gets evaluated to a function. This means that you will have to update each (normal) usage of `check="[...]"` to `check="(data) => data.[...]"`. + ## Checkout changes Everything has been migrated to use the GraphQL components for queries and mutations. On those components callbacks are used to process the data. So any changes made in an overwritten `checkout.vue` file and any checkout views should be reviewed.