Skip to content

Commit 75a4e62

Browse files
committed
adding curl command example
1 parent 6284e6e commit 75a4e62

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

website/src/pages/en/subgraphs/querying/managing-api-keys.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ When you query The Graph from your dapp, you can use your API key in two ways:
4848
Authorization: Bearer <YOUR_API_KEY>
4949
```
5050

51+
Curl command example:
52+
53+
```
54+
curl -X POST \
55+
-H "Content-Type: application/json" \
56+
-H "Authorization: Bearer {api-key}" \
57+
-d '{"query": "{ graphNetworks(first: 5) { id controller graphToken epochManager } graphAccounts(first: 5) { id names { id } defaultName { id } createdAt } }", "operationName": "Subgraphs", "variables": {}}' \
58+
https://gateway.thegraph.com/api/subgraphs/id/DZz4kDTdmzWLWsV373w2bSmoar3umKKH9y82SUKr5qmp
59+
```
60+
5161
Check out [Querying from an App](/subgraphs/querying/from-an-application) for more details.
5262

5363
## Manage API Keys

0 commit comments

Comments
 (0)