Skip to content

Commit fe7713d

Browse files
committed
Add instructions for adding bearer token to API requests
1 parent 0bc6510 commit fe7713d

File tree

4 files changed

+31
-11
lines changed

4 files changed

+31
-11
lines changed

.husky/pre-commit

-4
This file was deleted.

.husky/pre-push

-4
This file was deleted.

website/pages/en/deploying/subgraph-studio-faqs.mdx

+18-2
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,29 @@ Yes! You can create multiple API Keys to use in different projects. Check out th
1818

1919
After creating an API Key, in the Security section, you can define the domains that can query a specific API Key.
2020

21-
## 5. Can I transfer my subgraph to another owner?
21+
## 5. How do I add a bearer token ?
22+
23+
A bearer token can be added to the authorization header of your API request.
24+
25+
Example:
26+
```
27+
Update the query path:
28+
```bash
29+
../api/${api_key}/deployments/... -> ../api/deployments/...
30+
```
31+
Add the authorization header:
32+
```bash
33+
authorization: Bearer ${api_key}
34+
```
35+
Replace ${api_key} with your actual API key.
36+
37+
## 6. Can I transfer my subgraph to another owner?
2238

2339
Yes, subgraphs that have been published to Mainnet can be transferred to a new wallet or a Multisig. You can do so by clicking the three dots next to the 'Publish' button on the subgraph's details page and selecting 'Transfer ownership'.
2440

2541
Note that you will no longer be able to see or edit the subgraph in Studio once it has been transferred.
2642

27-
## 6. How do I find query URLs for subgraphs if I’m not the developer of the subgraph I want to use?
43+
## 7. How do I find query URLs for subgraphs if I’m not the developer of the subgraph I want to use?
2844

2945
You can find the query URL of each subgraph in the Subgraph Details section of The Graph Explorer. When you click on the “Query” button, you will be directed to a pane wherein you can view the query URL of the subgraph you’re interested in. You can then replace the `<api_key>` placeholder with the API key you wish to leverage in the Subgraph Studio.
3046

website/pages/en/querying/querying-the-graph.mdx

+13-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,19 @@ Each subgraph published to the decentralized Graph Explorer has a unique query U
2525

2626
![Query Subgraph Pane](/img/query-subgraph-pane.png)
2727

28-
As you can notice, this query URL must use a unique API key. You can create and manage your API keys in the [Subgraph Studio](https://thegraph.com/studio) in the "API Keys" section. Learn more about how to use Subgraph Studio [here](/deploying/subgraph-studio).
28+
As you can notice, this query URL must use a unique API key. A bearer token can also be used to authenticate the query.
29+
30+
Update the query path:
31+
```bash
32+
../api/${api_key}/deployments/... -> ../api/deployments/...
33+
```
34+
Add the authorization header:
35+
```bash
36+
authorization: Bearer ${api_key}
37+
```
38+
Replace ${api_key} with your actual API key.
39+
40+
You can create and manage your API keys in the [Subgraph Studio](https://thegraph.com/studio) in the "API Keys" section. Learn more about how to use Subgraph Studio [here](/deploying/subgraph-studio).
2941

3042
Querying subgraphs using your API keys will generate query fees that will be paid in GRT. You can learn more about billing [here](/billing).
3143

0 commit comments

Comments
 (0)