Skip to content

Commit 32f67d3

Browse files
authored
Apply suggestions from code review
using your api section
1 parent db9c22d commit 32f67d3

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

modules/ROOT/pages/aura-graphql-data-apis/using-your-api.adoc

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,51 @@
11
= Using your GraphQL API
22

3-
== Query your GraphQL API
3+
== Querying your GraphQL API
44

5-
Once the status for the GraphQL API is `ready` you can send GraphQL requests to it. As all requests are subject to authentication, you must include an API key or JWT token.
5+
When the status for the GraphQL API is "ready" you can send GraphQL requests to it.
6+
As all requests are subject to authentication, you must include an API key or JWT token.
67

7-
=== With an API Key Authentication Provider
8+
=== With an API Key authentication provider
89

9-
Add `x-api-key: YOUR_API_KEY` to the header of the request. For example, with curl replacing the UPPERCASE values with those of your own:
10+
Add `x-api-key: YOUR_API_KEY` to the header of the request.
11+
For example, with cURL and replacing the UPPERCASE values with those of your own:
1012

1113
[source, bash, indent=0]
1214
----
1315
curl --location YOUR_GRAPHQL_API_URL --header 'Content-Type: application/json' --header 'x-api-key: YOUR_API_KEY' --data 'YOUR_GRAPHQL_QUERY'
1416
----
1517

16-
=== With a JWKS Authentication Provider
18+
=== With a JWKS authentication provider
1719

18-
Obtain a JWT from your identity provider. Using the JWT, add `Authorization: Bearer YOUR_JWT` to the headers of the request.
20+
Obtain a JWT from your identity provider.
21+
Using the JWT, add `Authorization: Bearer YOUR_JWT` to the headers of the request.
1922

20-
For example, with curl replacing the UPPERCASE values with those of your own:
23+
For example, with cURL and replacing the UPPERCASE values with those of your own:
2124

2225
[source, bash, indent=0]
2326
----
2427
curl --location YOUR_GRAPHQL_API_URL --header 'Authorization: Bearer YOUR_JWT'--header 'Content-Type: application/json --data 'YOUR_GRAPHQL_QUERY'
2528
----
2629

27-
== Query your GraphQL API from a Browser
30+
== Querying your GraphQL API from a browser
2831

29-
=== CORS (Cross-Origin Resource Sharing) Policy
32+
=== CORS Policy
3033

31-
For security reasons, browsers restrict cross-origin requests to servers. This means that by default, if you configure a web app to make a request to your GraphQL APIs from a browser, it will fail. This is because your web app will be hosted at a different origin from your GraphQL API.
34+
For security reasons, browsers restrict cross-origin requests to servers.
35+
This means that by default, if you configure a web app to make a request to your GraphQL APIs from a browser, it will fail.
36+
This is because your web app is hosted at a different origin than your GraphQL API.
3237

33-
However, most modern browsers support Cross-Origin Resource Sharing. This involves the browser sending a “preflight” request to the server to check that it will allow the actual request. You can configure your GraphQL APIs to allow cross-origin requests from your web app by adding it to the list of allowed origins. For example, if you expect requests to be made by a web app hosted at https://example.com, this should be added to the list of allowed origins for your GraphQL API.
38+
However, most modern browsers support Cross-Origin Resource Sharing (CORS).
39+
This involves the browser sending a "preflight" request to the server to check that it will allow the actual request.
40+
You can configure your GraphQL APIs to allow cross-origin requests from your web app by adding it to the list of allowed origins.
41+
For example, if you expect requests to be made by a web app hosted at `https://example.com`, this should be added to the list of allowed origins for your GraphQL API.
3442

3543
[NOTE]
3644
====
37-
Only exact matches for allowed origins are supported - wildcards (*) will not work
45+
Only exact matches for allowed origins are supported - wildcards (*) will do not work.
3846
====
3947

40-
This can be done using the aura-cli using the following command, replacing the UPPERCASE values as required:
48+
Use the aura-cli and the following command, replacing the UPPERCASE values as required:
4149

4250
[source, bash, indent=0]
4351
----

0 commit comments

Comments
 (0)