Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EDU-11993: Improve API extension troubleshooting content #1737

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD046/code-block-style Code block style [Expected: fenced; Actual: indented]

> ℹ️ This optimization can also be performed while the development server is running.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD033/no-inline-html Inline HTML [Element: li]

| `warn: Failed to format generated files. 'yarn format:generated' thrown errors` | An issue occurred during the formatting process for the generated GraphQL optimization and types files. | This is a warning, not an error. Your GraphQL layer will still function correctly. If you want to investigate and resolve the formatting issue, follow these steps: <ol><li>1. Retry formatting: Run the `yarn format:generated` command again.</li> <li>2. Check formatting configuration: Ensure the formatting rules are correct and compatible with the generated files.</li><li>3. Inspect error logs: Look for specific error messages that might provide more clues about the issue.</li></ol> |

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD033/no-inline-html Inline HTML [Element: li]

| `warn: Failed to format generated files. 'yarn format:generated' thrown errors` | An issue occurred during the formatting process for the generated GraphQL optimization and types files. | This is a warning, not an error. Your GraphQL layer will still function correctly. If you want to investigate and resolve the formatting issue, follow these steps: <ol><li>1. Retry formatting: Run the `yarn format:generated` command again.</li> <li>2. Check formatting configuration: Ensure the formatting rules are correct and compatible with the generated files.</li><li>3. Inspect error logs: Look for specific error messages that might provide more clues about the issue.</li></ol> |

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD033/no-inline-html Inline HTML [Element: li]

| `warn: Failed to format generated files. 'yarn format:generated' thrown errors` | An issue occurred during the formatting process for the generated GraphQL optimization and types files. | This is a warning, not an error. Your GraphQL layer will still function correctly. If you want to investigate and resolve the formatting issue, follow these steps: <ol><li>1. Retry formatting: Run the `yarn format:generated` command again.</li> <li>2. Check formatting configuration: Ensure the formatting rules are correct and compatible with the generated files.</li><li>3. Inspect error logs: Look for specific error messages that might provide more clues about the issue.</li></ol> |

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD033/no-inline-html Inline HTML [Element: ol]

| `warn: Failed to format generated files. 'yarn format:generated' thrown errors` | An issue occurred during the formatting process for the generated GraphQL optimization and types files. | This is a warning, not an error. Your GraphQL layer will still function correctly. If you want to investigate and resolve the formatting issue, follow these steps: <ol><li>1. Retry formatting: Run the `yarn format:generated` command again.</li> <li>2. Check formatting configuration: Ensure the formatting rules are correct and compatible with the generated files.</li><li>3. Inspect error logs: Look for specific error messages that might provide more clues about the issue.</li></ol> |

Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,33 @@ Although the FastStore API provides a GraphQL schema for ecommerce, you can exte

Below are different troubleshooting checks and instructions you can use to solve API extension issues:

- [Debugging API extension issues](#debugging-api-extensions-issues)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD051/link-fragments Link fragments should be valid [Context: "Debugging API extension issues"]

- [GraphQL changes not visible during development](#graphql-changes-not-visible-during-development)
- [Deploy preview/production GraphQL schema different from development](#deploy-previewproduction-graphql-schema-different-from-development)
- [Type generation errors and warnings](#type-generation-errors-and-warnings)
- [Error details](#error-details)
- [GraphQL changes not visible in production/deploy preview](#graphql-changes-not-visible-in-productiondeploy-preview)

## Debugging API extension issues

1. Navigate to the `.faststore` folder by running the following in the terminal:

```bash
cd .faststore
```

2. Make sure all dependencies are installed, by running `yarn` in the terminal.

> ⚠ If you already have dependencies installed in the root folder, you can create a symbolic link to avoid reinstalling them by running the following in the terminal: `ln -s {your-project-path}/{yourrepository.name}/node_modules {your-project-path}/{yourrepository.name}/.faststore`.
>
> If you no longer need the symbolic link, unlink it by running the following in the terminal: `unlink -- {your-project-path}/{yourrepository.name}/node_modules {your-project-path}/{yourrepository.name}/.faststore/node_modules`.

3. In the terminal, run `yarn generate -d` to provide detailed logs and insights into what might be going wrong. Look for any error messages, warnings, or unexpected behavior in the output. Here's an example of what the debug output might look like:

![debug-example](https://vtexhelp.vtexassets.com/assets/docs/src/api-extension-debugl___07c80970289d7f2d90c280e5b0c9a527.png)

Once you have identified the error, check the following sections from this article to fix them.

## GraphQL changes not visible during development

If your GraphQL changes aren't visible during development, the changes you have made since you started the development server (`yarn dev`) are probably not optimized.
Expand Down
Loading