Skip to content

Commit d56f365

Browse files
committed
Add visibility to the removal of queries from ACCS
1 parent b4b0d7b commit d56f365

File tree

1 file changed

+88
-6
lines changed

1 file changed

+88
-6
lines changed

src/pages/graphql/index.md

Lines changed: 88 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,99 @@ keywords:
77

88
# GraphQL overview
99

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.
1111

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.
1313

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/).
1515

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.
1717

18-
The following image shows a sample query, its response, and the GraphQL browser:
18+
## Why use GraphQL?
1919

20-
![GraphiQL browser](../_images/graphql/graphql-browser.png)
20+
- **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:
31+
32+
- [GraphiQL](https://github.com/graphql/graphiql)
33+
- [Altair GraphQL client](https://altairgraphql.dev/)
34+
- [Altair Chrome extension](https://chrome.google.com/webstore/detail/altair-graphql-client/flnheeellpciglgpaodhkhmapeljopja)
35+
- [Apollo Studio](https://studio.apollographql.com/)
36+
37+
1. Access your GraphQL endpoint. Your Adobe Commerce GraphQL endpoint is available at:
38+
39+
&#8203;<Edition name="paas" /> `https://<commerce-server>/graphql`
40+
41+
&#8203;<Edition name="saas" /> `https://<region>-<environment>.api.commerce.adobe.com/<tenantId>/graphql`
42+
43+
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+
query IntrospectionQuery {
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.
85+
86+
```graphql
87+
{
88+
data {
89+
storeConfig {
90+
store_code: "default"
91+
store_name: "Default Store View"
92+
is_default_store: true
93+
store_group_code: "main_website_store"
94+
is_default_store_group: true
95+
locale: "en_US"
96+
base_currency_code: "USD"
97+
default_display_currency_code: "USD"
98+
timezone: "America/Los_Angeles"
99+
}
100+
}
101+
}
102+
```
21103

22104
## Commerce API playground
23105

0 commit comments

Comments
 (0)