Skip to content

Commit 17ae273

Browse files
committed
API-Endpoint
1 parent 5f28ecb commit 17ae273

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

website/pages/en/subgraphs/querying/from-an-application.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ Learn how to query The Graph from your application.
66

77
## Getting GraphQL Endpoint
88

9-
Once a subgraph is deployed to [Subgraph Studio](https://thegraph.com/studio/) or [Graph Explorer](https://thegraph.com/explorer), you will be given the endpoint for your GraphQL API that should look something like this:
9+
Once a subgraph is deployed to [Subgraph Studio](https://thegraph.com/studio/) or [Graph Explorer](https://thegraph.com/explorer), you will be given two endpoints for your GraphQL API that should look something like this:
1010

11-
### Subgraph Studio
11+
### Network Endpoint
1212

1313
```
14-
https://api.studio.thegraph.com/query/<ID>/<SUBGRAPH_NAME>/<VERSION>
14+
https://gateway.thegraph.com/api/<API_KEY>/subgraphs/id/<SUBGRAPH_ID>
1515
```
1616

17-
### Graph Explorer
17+
### Subgraph Studio Endpoint
1818

1919
```
20-
https://gateway.thegraph.com/api/<API_KEY>/subgraphs/id/<SUBGRAPH_ID>
20+
https://api.studio.thegraph.com/query/<ID>/<SUBGRAPH_NAME>/<VERSION>
2121
```
2222

2323
With your GraphQL endpoint, you can use various GraphQL Client libraries to query the subgraph and populate your app with data indexed by the subgraph.
@@ -88,11 +88,11 @@ sources:
8888
- name: uniswapv2
8989
handler:
9090
graphql:
91-
endpoint: https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2
91+
endpoint: https://gateway.thegraph.com/api/<API_KEY>/subgraphs/id/<SUBGRAPH_ID>
9292
- name: compoundv2
9393
handler:
9494
graphql:
95-
endpoint: https://api.thegraph.com/subgraphs/name/graphprotocol/compound-v2
95+
endpoint: https://gateway.thegraph.com/api/<API_KEY>/subgraphs/id/<SUBGRAPH_ID>
9696

9797
documents:
9898
- ./src/example-query.graphql
@@ -179,7 +179,7 @@ Query the API with the following code:
179179
```javascript
180180
import { ApolloClient, InMemoryCache, gql } from '@apollo/client'
181181

182-
const APIURL = 'https://api.studio.thegraph.com/query//<SUBGRAPH_NAME>/'
182+
const APIURL = 'https://gateway.thegraph.com/api/<API_KEY>/subgraphs/id/<SUBGRAPH_ID>'
183183

184184
const tokensQuery = `
185185
query {
@@ -268,7 +268,7 @@ Query the API with the following code:
268268
```javascript
269269
import { createClient } from 'urql'
270270

271-
const APIURL = 'https://api.thegraph.com/subgraphs/name/username/subgraphname'
271+
const APIURL = 'https://gateway.thegraph.com/api/<API_KEY>/subgraphs/id/<SUBGRAPH_ID>'
272272

273273
const tokensQuery = `
274274
query {

0 commit comments

Comments
 (0)