Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions for adding bearer token to API requests #709

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions website/pages/en/deploying/subgraph-studio-faqs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,32 @@ Yes! You can create multiple API Keys to use in different projects. Check out th

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

## 5. Can I transfer my subgraph to another owner?
## 5. How do I add a bearer token ?

A bearer token can be added to the authorization header of your API request.

Example:
Update the query path:

```bash
../api/${api_key}/deployments/... -> ../api/deployments/...
```

Add the authorization header:

```bash
authorization: Bearer ${api_key}
```

Replace `${api_key}` with your actual API key.

## 6. Can I transfer my subgraph to another owner?

Yes, subgraphs that have been published to Arbitrum One 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'.

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

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

You can find the query URL of each subgraph in the Subgraph Details section of 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 Subgraph Studio.

Expand Down
15 changes: 13 additions & 2 deletions website/pages/en/querying/querying-the-graph.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,18 @@ Each subgraph published to The Graph Network has a unique query URL in Graph Exp
![Query Subgraph Pane](/img/query-subgraph-pane.png)

Learn more about querying from an application [here](/querying/querying-from-an-application).

As you can notice, this query URL must use a unique API key. You can create and manage your API keys in [Subgraph Studio](https://thegraph.com/studio), in the "API Keys" section. Learn more about how to use Subgraph Studio [here](/deploying/subgraph-studio).
As you can notice, this query URL must use a unique API key. A bearer token can also be used to authenticate the query.

Update the query path:
```bash
../api/${api_key}/deployments/... -> ../api/deployments/...
```
Add the authorization header:
```bash
authorization: Bearer ${api_key}
```
Replace ${api_key} with your actual API key.
itsjerryokolo marked this conversation as resolved.
Show resolved Hide resolved

You can create and manage your API keys in [Subgraph Studio](https://thegraph.com/studio), in the "API Keys" section. Learn more about how to use Subgraph Studio [here](/deploying/subgraph-studio).

Subgraph Studio users start on a Free Plan, which allows them to make 100,000 queries per month. Additional queries are available on the Growth Plan, which offers usage based pricing for additional queries, payable by credit card, or GRT on Arbitrum. You can learn more about billing [here](/billing).
Loading