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

Docs/api overview #1366

Merged
merged 13 commits into from
Jul 25, 2022
Merged
Show file tree
Hide file tree
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
48 changes: 28 additions & 20 deletions apps/docs/docs/reference/api/faststore-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,44 @@ import GraphQLExplorer from '@site/src/components/GraphQLExplorer/GraphQLExplore

# FastStore API

**FastStore API** is an interface between your ecommerce platform and your store's frontend. It uses **[GraphQL](https://graphql.org/)**, a query language for APIs and a runtime for fulfilling queries, to expose structured data from everyday e-commerce tasks to frontend components. With the FastStore API, it's possible to:
**FastStore API** is an interface between your ecommerce platform and your store's frontend. It uses **[GraphQL](https://graphql.org/)**, a query language for APIs and a runtime for fulfilling queries, in order to expose structured data from everyday ecommerce tasks to frontend components.

With the FastStore API, you can:

- Retrieve product data.
- Add items to the cart.
- Apply promotions to products.
- Filter search results.

Also, thanks to a type-safe **GraphQL** protocol, the FastStore API allows developers to fetch only the strongly **typed data** needed for building robust and responsive solutions. In practice, developers can source the FastStore API to the [**Next.js**](https://nextjs.org/) or [**Gatsby**](https://www.gatsbyjs.com/) data layers and consume it on frontend components to create stores that use the [**Jamstack**](https://jamstack.org/) architecture.
Also, thanks to a type-safe **GraphQL** protocol, the FastStore API allows developers to fetch only the strongly typed data needed for building robust and responsive solutions. In practice, developers can source the FastStore API to the [**Next.js**](https://nextjs.org/) or [**Gatsby**](https://www.gatsbyjs.com/) data layers and consume it on frontend components to create stores that use the [**Jamstack**](https://jamstack.org/) architecture.

![FastStore API usage architecture](https://vtexhelp.vtexassets.com/assets/docs/src/faststoreAPI2___58c4a9c4d23539900ef8b1cce9769288.png)

:::tip
:::info
To learn more about GraphQL and its main concepts, visit the official [GraphQL website](https://graphql.org/).
:::

## Playground
## Key features

FastStore API is based on [**Schema.org**](https://schema.org/) and inspired by **clean architecture**.

### Improved brand findability

FastStore API extends and simplifies [**Schema.org**](https://schema.org/), a set of agreed definitions for implementing structured data developed by Google, Microsoft, Yahoo, and Yandex.

The Schema markup aids search engines in understanding and displaying your content in a relevant way. It may improve your brand's findability by leading your website to a higher ranking in search results and, as a result, to more clicks and interactions with your store's website.

### Flexible backend for frontend architecture

The FastStore API types and resolvers use a clean architecture to tackle specific ecommerce needs. The types specified in this schema are platform agnostic and may be used to build a wide range of custom frontend solutions. For instance:

1. Develop an ecommerce website with Next.js or Gatsby.
2. Create an Apollo Server instance on Heroku.
3. Run the executable schema in a function on Next.js.

The FastStore GraphQL API allows you to query and modify your store public data in an efficient and flexible manner.
## Playground

Use the GraphQL playground in the following to test and explore the FastStore API.
You can use the GraphQL playground below to test and explore the FastStore API.

<GraphQLExplorer query="query {
allProducts(first: 10) {
Expand All @@ -38,20 +56,10 @@ Use the GraphQL playground in the following to test and explore the FastStore AP
}
}"/>

## Key features

FastStore API is based on [**Schema.org**](https://schema.org/) and inspired by **clean architecture**.

### Improved brand's findability
You can also install the `@faststore/api` dependency in your project to start exploring the data layer by running a local server. Learn more in the [Get started guide](/references/api/get-started).

FastStore API extends and simplifies [**Schema.org**](https://schema.org/), a set of agreed definitions for implementing structured data developed by Google, Microsoft, Yahoo, and Yandex.
## Going beyond

The Schema markup aids search engines in understanding and displaying your content in a relevant way. It may improve your brand's findability by leading your website to a higher ranking in search results and, consequently, to more clicks and interactions with your store's website.
With GraphQL, you can also [Extend the FastStore API schema](/how-to-guides/faststore-api/extending-the-faststore-api).

### Flexible backend for frontend architecture

The FastStore API types and resolvers use a clean architecture to tackle specific ecommerce needs. The types specified in this schema are platform agnostic and may be used to build a wide range of custom frontend solutions. For instance:

1. Develop an ecommerce website with Next.js or Gatsby.
2. Create an Apollo Server instance on Heroku.
3. Run the executable schema in a function on Next.js.
And if you wish to use an ecommerce platform that is not yet supported, see how you can [Create inline resolvers](/how-to-guides/faststore-api/creating-resolvers).
7 changes: 1 addition & 6 deletions apps/docs/docs/reference/api/get-started.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
---
description: Install the FastStore API and start building blazing fast ecommerce websites.
pagination_prev: null
---

# Get started

## Install
Expand All @@ -15,7 +10,7 @@ yarn add @faststore/api

## Usage

Explore the GraphQL data layer by running a local server of your FastStore project in your machine.
Explore the GraphQL data layer by running a local server of your FastStore project on your machine.

1. Open the terminal and change to your FastStore project directory.
2. Install dependencies using yarn (`yarn install`),
Expand Down