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: src/pages/graphql/index.md
+88-6Lines changed: 88 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,17 +7,99 @@ keywords:
7
7
8
8
# GraphQL overview
9
9
10
-
[GraphQL](https://graphql.org/) is a data query language developed internally by Facebook in 2012 before being publicly released in 2015. Adobe Commerce and Magento Open Source implement GraphQL to provide an alternative to REST and SOAP web APIs for frontend development.
10
+
[GraphQL](https://graphql.org/) is a data query language and runtime that revolutionizes how you build and consume APIs. Originally developed by Facebook in 2012 and open-sourced in 2015, GraphQL has become the preferred choice for modern applications that need efficient, flexible, and performant data fetching.
11
11
12
-
## How to access GraphQL
12
+
Adobe Commerce provides two comprehensive GraphQL implementations that serve as the ideal foundation for building next-generation commerce experiences, including [headless storefronts](https://experienceleague.adobe.com/developer/commerce/storefront/get-started/) and sophisticated mobile applications.
13
13
14
-
Use a GraphQL IDE such as [GraphiQL](https://github.com/graphql/graphiql) or a browser extension to run the code samples and tutorials. If you install a browser extension, make sure it has the ability to set request headers. On Google Chrome, [Altair GraphQL Client](https://chrome.google.com/webstore/detail/altair-graphql-client/flnheeellpciglgpaodhkhmapeljopja) is one extension that can do the job.
14
+
- Adobe Commerce on Cloud and on-premises (PaaS) projects can implement the GraphQL schemas that have long been available to Adobe Commerce and Magento Open Source projects. Separate schemas are available for [core and B2B Commerce](../reference/graphql/2.4.8/index.md) functionality and service-based features, including [Catalog Service](./schema/catalog-service/index.md), [Live Search](./schema/live-search/index.md), and [Recommendations](./schema/product-recommendations/index.md). These schemas do not natively interact, but can be integrated with [API Mesh](https://developer.adobe.com/graphql-mesh-gateway/).
15
15
16
-
To begin exploring GraphQL, set the GraphQL endpoint by entering `http://<commerce-server>/graphql` in the URL bar of your IDE or extension. You can use the browser in the right column to determine how to set up a query or mutation. Examples are also available throughout the GraphQL documentation.
16
+
-[Adobe Commerce as a Cloud Service](https://developer.adobe.com/commerce/webapi/reference/graphql/saas/) (SaaS) projects can connect to a supergraph that not only combines and streamlines the schemas available to PaaS projects, but provides instant access to the latest features added in the [Storefront Compatability Package](https://experienceleague.adobe.com/developer/commerce/storefront/setup/configuration/storefront-compatibility/v248/) and other sources. Therefore, SaaS projects can take advantage of the latest GraphQL features without needing to wait for a new release.
17
17
18
-
The following image shows a sample query, its response, and the GraphQL browser:
-**Get exactly what you need.** Unlike traditional REST APIs that return fixed data structures, GraphQL lets you request exactly the fields you need in a single query. This means faster load times, reduced bandwidth usage, and better user experiences.
21
+
22
+
-**Superior performance.** GraphQL minimizes over-fetching and under-fetching of data, allowing you to optimize performance by fetching only the necessary information in a single request. In addition, minimized data transfer is ideal for mobile and low-bandwidth environments.
23
+
24
+
-**Enhanced developer experience.** GraphQL's strongly typed schema and introspection capabilities provide powerful tools for developers. You can explore the API, get real-time feedback, and leverage auto-completion in modern IDEs, making development faster and more efficient.
25
+
26
+
## Getting started with GraphQL
27
+
28
+
Ready to experience the power of Adobe Commerce GraphQL? Here's how to get started:
29
+
30
+
1. Choose Your GraphQL client. Select a GraphQL IDE or browser extension to explore and test queries and mutations. Some popular options include:
1. Explore the schema. Use the schema browser in your GraphQL IDE or extension to explore the available queries, mutations, and types. This will help you understand the structure of the API and how to construct your requests. You can also use introspection queries to discover the schema programmatically.
44
+
45
+
```graphql
46
+
queryIntrospectionQuery {
47
+
__schema {
48
+
mutationType {
49
+
name
50
+
fields {
51
+
name
52
+
description
53
+
}
54
+
}
55
+
queryType {
56
+
name
57
+
fields {
58
+
name
59
+
description
60
+
}
61
+
}
62
+
}
63
+
}
64
+
```
65
+
66
+
1. Run your first query. Try this simple product query to get started:
67
+
68
+
```graphql
69
+
{
70
+
storeConfig {
71
+
store_code
72
+
store_name
73
+
is_default_store
74
+
store_group_code
75
+
is_default_store_group
76
+
locale
77
+
base_currency_code
78
+
default_display_currency_code
79
+
timezone
80
+
}
81
+
}
82
+
```
83
+
84
+
The response will provide you with basic information about your store configuration, such as the store code, name, locale, and currency settings.
0 commit comments