Skip to content

Commit

Permalink
Merge pull request #1743 from vtexdocs/fix/faststore-links
Browse files Browse the repository at this point in the history
Fix: FastStore links
  • Loading branch information
mariana-caetano authored Feb 21, 2025
2 parents ed6f966 + 81a6eb6 commit 2745a65
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docs/faststore/docs/api-extensions/extending-api-schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Once you have created the necessary folders, you will have a folder structure fo

Your new type definitions set the data structure for your new fields, extended from the existing FastStore API GraphQL queries and types.

1. Create a new `<typeName>.graphql` file inside the `vtex/typeDefs` folder. For example, if we extend the [StoreProduct](https://v1.faststore.dev/reference/api/objects#storeproduct) type from the FastStore API, the name of the file should be `product.graphql`.
1. Create a new `<typeName>.graphql` file inside the `vtex/typeDefs` folder. For example, if we extend the [StoreProduct](https://developers.vtex.com/docs/guides/faststore/schema-objects#storeproduct) type from the FastStore API, the name of the file should be `product.graphql`.

> ℹ️ The organization inside the `vtex/typeDefs` folder is flexible. You can create multiple typeDefs files or group them all together in one file.
> During the build process and when running the local server file, all `.graphql` files under this directory will be considered.
Expand All @@ -99,7 +99,7 @@ Refer to the next step to create the resolvers to provide the actual data to the

Now, you'll create a resolver to define how the new `customData` field should be resolved, specifically what data or logic should be associated with it when queried.

1. Create a new `<resolver>.ts` file inside the `vtex/resolvers` folder. Let's continue using the [StoreProduct](https://v1.faststore.dev/reference/api/objects#storeproduct) type
1. Create a new `<resolver>.ts` file inside the `vtex/resolvers` folder. Let's continue using the [StoreProduct](https://developers.vtex.com/docs/guides/faststore/schema-objects#storeproduct) type
example. That means the name of the file will be `product.ts`.

> ℹ️ The organization inside this folder is flexible. You can create multiple resolver files or group them all together in one file.
Expand Down
8 changes: 5 additions & 3 deletions docs/faststore/docs/api-extensions/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
title: "API Extensions"
---

This track will teach you how to extend the FastStore API schema by adding new data to the existing [queries](https://v1.faststore.dev/reference/api/queries).
This track will teach you how to extend the FastStore API schema by adding new data to the existing [queries](https://developers.vtex.com/docs/guides/faststore/schema-queries).

While the [FastStore API](https://developers.vtex.com/docs/guides/faststore/faststore-api-overview) provides a [GraphQL schema](https://v1.faststore.dev/reference/api/queries) that caters to common use cases, some stores may require access to additional and more specific data. If you need to retrieve data not natively provided by the FastStore API, you can achieve this by extending the FastStore API schema and incorporating new data into the existing [queries](https://v1.faststore.dev/reference/api/queries).
While the [FastStore API](https://developers.vtex.com/docs/guides/faststore/faststore-api-overview) provides a [GraphQL schema](https://developers.vtex.com/docs/guides/faststore/schema-queries) that caters to common use cases, some stores may require access to additional and more specific data. If you need to retrieve data not natively provided by the FastStore API, you can achieve this by extending the FastStore API schema and incorporating new data into the existing [queries](https://developers.vtex.com/docs/guides/faststore/schema-queries).

> ⚠️ Please be aware that introducing additional API endpoints to your storefront can potentially affect site performance, as already covered in [Best practices for fetching data](#best-practices-for-fetching-data).
Expand Down Expand Up @@ -34,6 +34,7 @@ These queries allow you to add or change fields within the query to tailor the d
</details>

### Fetching only the data you need

GraphQL allows you to customize your query to get precisely the data you need, which reduces the data returned from the requests. Double-check your queries to make sure they are not over-fetching.

This also means that you must be mindful of the data added to your query with [GraphQL fragments](https://graphql.org/learn/queries/#fragments) returned. Use them only when they do not include unnecessary data.
Expand All @@ -42,11 +43,12 @@ This also means that you must be mindful of the data added to your query with [G

Do not make direct requests to external APIs to avoid compromising website performance and `504` timeout errors. Instead, use the FastStore [API extension](https://developers.vtex.com/docs/guides/faststore/api-extensions-extending-api-schema) to access other data not available in the native FastStore API schema.

If you need data that is not available on the native [FastStore GraphQL schema](https://v1.faststore.dev/reference/api/objects), check the [root object](https://v1.faststore.dev/reference/api/objects).
If you need data that is not available on the native FastStore GraphQL schema, check the [root object](https://developers.vtex.com/docs/guides/faststore/schema-objects).
The [GraphQL root object](https://graphql.org/learn/execution/#root-fields-resolvers) represents the top-level object returned to a query. You can see the data that is available in the root object by adding logs.


### Avoid custom API Routes

We do not recommend using Next.js [API Routes](https://nextjs.org/docs/api-routes/introduction) other than the ones already built-in in FastStore.

If you do use this type of function, you must always check which ones are actually running and remove the ones that are not.
Expand Down
6 changes: 3 additions & 3 deletions docs/release-notes/2023-10-11-faststore-v1-abandoned-cart.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ excerpt: "Introducing a solution for precise abandoned cart tracking and analyti
createdAt: "2023-10-11T00:00:00.000Z"
---

We have implemented a solution to ensure correct tracking and monitoring of abandoned carts and analytics data for stores currently on [FastStorev1](https://v1.faststore.dev/). Stores using this version of FastStore must update their project code with the new `VTEX_METADATA` object.
We have implemented a solution to ensure correct tracking and monitoring of abandoned carts and analytics data for stores currently on [FastStorev1](https://v1.faststore.dev/docs). Stores using this version of FastStore must update their project code with the new `VTEX_METADATA` object.

> ⚠️ This change only affects stores using [FastStore v1](https://v1.faststore.dev/).
> ⚠️ This change only affects stores using [FastStore v1](https://v1.faststore.dev/docs).
## What has changed?

Expand All @@ -18,7 +18,7 @@ Now, by implementing the `VTEX_METADATA` object, you can set the correct account

## What needs to be done?

Stores using [FastStore v1](https://v1.faststore.dev/) must define the `VTEX_METADATA` object to ensure the correct behavior. To do so, open your FastStore project code and follow the steps below:
Stores using [FastStore v1](https://v1.faststore.dev/docs) must define the `VTEX_METADATA` object to ensure the correct behavior. To do so, open your FastStore project code and follow the steps below:

1. In the `src/sdk/analytics/index.tsx` file, add the highlighted code:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ If your store uses [FastStore](https://developers.vtex.com/docs/guides/faststore

* **Publishing failures**

See this guide on [Debugging Releases and VTEX Headless CMS publishing errors](https://v1.faststore.dev/how-to-guides/troubleshooting/debugging-releases-publishing).
See this guide on [Debugging Releases and VTEX Headless CMS publishing errors](https://developers.vtex.com/docs/troubleshooting/my-pages-are-taking-too-long-to-be-published-on-headless-cms).
* **Lighthouse tests**

[Lighthouse](https://developer.chrome.com/docs/lighthouse/overview) is an open-source tool that helps developers assess website performance. FastStore projects run automatic Lighthouse tests with every pull request. You need to consider the results of these automatic tests to identify and mitigate any performance issues before they impact your store in production.

>ℹ️ Learn more about [using Lighthouse in your FastStore project](https://v1.faststore.dev/how-to-guides/performance/lighthouse\#how-to-run-lighthouse-audits).
>ℹ️ Learn more about [using Lighthouse in your FastStore project](https://developers.vtex.com/docs/guides/faststore/1-onboarding-dashboard#lighthouse-scores).
* **Data fetching**

Data fetching can negatively impact your storefront's performance if not done correctly on FastStore. See the [Best practices for fetching data on your storefront](https://developers.vtex.com/docs/guides/faststore/api-extensions-overview\#best-practices-for-fetching-data) and make sure they are implemented.
Expand Down

0 comments on commit 2745a65

Please sign in to comment.