diff --git a/apps/site/pages/docs/migration-guides/Migrating to 2.2.65 - graphql-utils depreciation.mdx b/apps/site/pages/docs/migration-guides/Migrating to 2.2.65 - graphql-utils depreciation.mdx index 9be03cfbce..f2e7a52c69 100644 --- a/apps/site/pages/docs/migration-guides/Migrating to 2.2.65 - graphql-utils depreciation.mdx +++ b/apps/site/pages/docs/migration-guides/Migrating to 2.2.65 - graphql-utils depreciation.mdx @@ -1,8 +1,8 @@ -# Migrating your store to v2.2.65 +# Improvements to API extensions -In this guide, learn how to migrate your store version to v2.2.65 to leverage the latest improvements in the API extension. +In this guide, learn how to migrate your store version to v3.0.0 to leverage the latest improvements in the API extension. -Version 2.2.65 and above, introduces the following enhancements to API extension users: +Version 3.0.0 and above, introduces the following enhancements to API extension users: - Deprecation of the `@faststore/graphql-utils` package in favor of the [`client-preset`](https://the-guild.dev/graphql/codegen/plugins/presets/preset-client) plugin. @@ -15,28 +15,28 @@ Version 2.2.65 and above, introduces the following enhancements to API extension import { Callout } from 'nextra/components' - For more details about these changes, also refer to the release note [TBD](/tbd) + For more details about these changes, also refer to the [GitHub releases](/tbd) related to this version. -The `@faststore/graphql-utils` has been replaced by open-source solutions maintained by the community that are now re-exported from `@faststore/core`. There are minor breaking changes on how developers should write GraphQL definitions and invoke queries and mutations, which were introduced in version 2.2.60. +The `@faststore/graphql-utils` has been replaced by open-source solutions maintained by the community that are now re-exported from `@faststore/core`. There are minor breaking changes on how developers should write GraphQL definitions and invoke queries and mutations, which were introduced in version 3.0.0. ## Before you begin -Make sure your store version is updated to v2.2.65 or above. If it’s not updated follow the instructions below: +Make sure your store version is updated to v3.0.0 or above. If it’s not updated follow the instructions below: 1. Open your store code and navigate to the `package.json` file. 2. In `dependencies` > `@faststore/core`, change the version to the following: ```json -"@faststore/core": "^2.2.65", +"@faststore/core": "^3.0.0", ``` 3. Open the terminal and run `yarn` to update the version. + ## Updating the `gql` helper usage The `gql` helper serves as a function to define GraphQL operations such as queries, mutations, or fragments within the store code. Before, the function was imported directly from the `@faststore/graphql-utils` which was not recommended. See the example below: -```tsx -// src/fragments/ClientProduct.tsx +```tsx filename="src/fragments/ClientProduct.tsx" import { gql } from '@faststore/graphql-utils' export const fragment = gql` @@ -55,10 +55,9 @@ export const fragment = gql` ` ``` -Now with the v2.2.65, you should import the `gql` helper from `@faststore/core/api`and be called as a function - with the argument between parenthesis. This also applies to query and mutation definitions inside the components. For example: +Now with the v3.0.0, you should import the `gql` helper from `@faststore/core/api`and be called as a function - with the argument between parenthesis. This also applies to query and mutation definitions inside the components. For example: -```tsx {1} -// src/fragments/ClientProduct.tsx +```tsx filename="src/fragments/ClientProduct.tsx" {1} import { gql } from '@faststore/core/api' export const fragment = gql(` @@ -100,7 +99,7 @@ function CustomComponent() { } ``` -With v2.2.65, queries and mutations are now only invoked using more secure hashes, which are randomly generated and do to that you must pass the query or mutation object - result of the `gql` call - to `useQuery` directly. For example: +With v3.0.0, queries and mutations are now only invoked using more secure hashes, which are randomly generated and do to that you must pass the query or mutation object - result of the `gql` call - to `useQuery` directly. For example: ```tsx import { gql } from '@faststore/core/api'