You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/introduction.md
+8-10Lines changed: 8 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ import Link from '../src/components/link'
8
8
9
9
# What is WooGraphQL?
10
10
11
-
WPGraphQL WooCommerce, WooGraphQL for short, is a WPGraphQL/WooCommerce extension that exposes WooCommerce along with it’s functionality to the GraphQL server created by WPGraphQL, making it possible to create betterwritten and performing client-side application.
11
+
WPGraphQL WooCommerce, WooGraphQL for short, is a WPGraphQL/WooCommerce extension that exposes WooCommerce along with its functionality to the GraphQL server created by WPGraphQL, making it possible to create better-written and more performant client-side applications.
12
12
13
13
```
14
14
query {
@@ -39,7 +39,7 @@ query {
39
39
}
40
40
}
41
41
```
42
-
This means the data for products, orders, coupons, items in the shopping cart, and much more can be retrieve through the use of queries, like in the example above. Retrieving only the data you require, making request speedy and efficient
42
+
This means the data for products, orders, coupons, items in the shopping cart, and much more can be retrieved through the use of queries, like in the example above. Retrieve only the data you require, which makes requests speedy and efficient.
43
43
44
44
```
45
45
mutation {
@@ -80,29 +80,27 @@ You can also add items to cart, create orders, and more, using the mutations tha
80
80
81
81
# Why Use WooGraphQL?
82
82
83
-
[benefits/advantage image]
84
-
WooGraphQL has neither the team or the development hours that WooCommerce (WC) REST does, but there are advantages in both application performance and design.
83
+
WooGraphQL has neither the team nor the development hours that WooCommerce (WC) REST does, but there are advantages in both application performance and design.
85
84
86
85
## GraphQL vs REST
87
86
- The shapes of the data object returned by WC REST are limited and more times than not include data that you don’t require. GraphQL only retrieves the data you want making requests speedy and efficient.
88
87
- WC REST relies heavily on page-based pagination as do most WordPress REST APIs. If the store has a large amount of products, database requests with take much longer to process. WooGraphQL manipulates WordPress’ core querying functions implement [cursor-based pagination](https://dev.to/jackmarchant/offset-and-cursor-pagination-explained-b89), which handles large amount of products more efficiently.
89
88
90
-
## It comes with a Cart.
89
+
## It comes with a Cart
91
90
- WC REST doesn’t include any cart endpoints for manipulating the cart, meaning a cart has be implemented client-side, which is no small task. Cart-specific utilities are provided so you can rely on WooCommerce’s built-in cart to continue managing the end-user cart session data.
92
-
- Although WC REST doesn’t provide any support for managing the user session alternative options for doing this task do exist, however their usage can be limited to applications within the same origin as the WordPress installation. This is due to WooCommerce using cookies to store user session token. WooGraphQL provides a utility that changes this behavior during GraphQL request by passing the token to HTTP Header to be cached client-side and used like a HTTP Authorization header.
91
+
- Although WC REST doesn’t provide any support for managing the user session, alternative options for doing this task do exist; however, their usage can be limited to applications within the same origin as the WordPress installation. This is due to WooCommerce using cookies to store user session token. WooGraphQL provides a utility that changes this behavior during GraphQL request by passing the token to HTTP Header to be cached client-side and used like a HTTP Authorization header.
93
92
94
93
# Getting Started
95
94
96
-
WPGraphQL WooCommerce (WooGraphQL) is a both WPGraphQL extension and a WooCommerce extension so both plugin are required for it’s use.
95
+
WPGraphQL WooCommerce (WooGraphQL) is a both WPGraphQL extension and a WooCommerce extension so both plugins are required for its use.
97
96
98
97
1. Install and activate **[WPGraphQL](https://wpgraphql.com)** and **[WooCommerce](https://woocommerce.com)**
99
98
2. Clone or download the most stable **[release](https://github.com/wp-graphql/wp-graphql-woocommerce/releases)** from the **[repository](https://github.com/wp-graphql/wp-graphql-woocommerce)** into your WordPress plugin directory & activate the plugin.
100
-
3. (Optional, but highly recommend) Install and activate **[WPGraphiQL](https://github.com/wp-graphql/wp-graphiql)**.
101
-
4. Set your GraphQL client endpoint to the GraphQL endpoint of your site. Typically, this is `your-store.domain/graphql`.
99
+
3. Set your GraphQL client endpoint to the GraphQL endpoint of your site. Typically, this is `your-store.domain/graphql`.
102
100
103
101
## What next?
104
102
- If you’re looking to develop a client-side application, take a look at the <Linkto="/guides">Guides</Link>. They walk through the process of developing some common components in a React /Apollo application using data provided by WooGraphQL.
105
103
- If you wish to customize the WooGraphQL schema to fit your particular store, try the <Linkto="/contributing">Contributing</Link> section. You can find tools/utilities for setting a development environment and testing locally and with Docker, as well as tips for extending and change the behavior of the WooGraphQL schema.
106
104
107
105
> ### A Quick Tip
108
-
> Use **[WPGraphiQL](https://github.com/wp-graphql/wp-graphiql)** to build your queries during development. WPGraphiQL come equipped with an Explorer component for quick query building and a Schema Viewer component so individual types’ information can be searched.
106
+
> Use **[WPGraphiQL](https://github.com/wp-graphql/wp-graphiql)** to build your queries during development. WPGraphiQL comes equipped with an Explorer component for quick query building and a Schema Viewer component so individual types’ information can be searched.
0 commit comments