Skip to content

Commit

Permalink
Query app update (#853)
Browse files Browse the repository at this point in the history
* API-Endpoint

* adjustment

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

---------

Co-authored-by: Benoît Rouleau <[email protected]>
  • Loading branch information
idalithb and benface authored Jan 16, 2025
1 parent 5f28ecb commit 3b3fc9e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions website/pages/en/subgraphs/querying/from-an-application.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ title: Querying from an Application

Learn how to query The Graph from your application.

## Getting GraphQL Endpoint
## Getting GraphQL Endpoints

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:
Once a subgraph is deployed to [Subgraph Studio](https://thegraph.com/studio/) or [Graph Explorer](https://thegraph.com/explorer), you will receive two GraphQL API endpoints that look like this:

### Subgraph Studio
### Subgraph Studio Endpoint

```
https://api.studio.thegraph.com/query/<ID>/<SUBGRAPH_NAME>/<VERSION>
```

### Graph Explorer
### Network Endpoint

```
https://gateway.thegraph.com/api/<API_KEY>/subgraphs/id/<SUBGRAPH_ID>
Expand Down Expand Up @@ -88,11 +88,11 @@ sources:
- name: uniswapv2
handler:
graphql:
endpoint: https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2
endpoint: https://gateway.thegraph.com/api/<API_KEY>/subgraphs/id/<SUBGRAPH_ID>
- name: compoundv2
handler:
graphql:
endpoint: https://api.thegraph.com/subgraphs/name/graphprotocol/compound-v2
endpoint: https://gateway.thegraph.com/api/<API_KEY>/subgraphs/id/<SUBGRAPH_ID>

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

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

const tokensQuery = `
query {
Expand Down Expand Up @@ -268,7 +268,7 @@ Query the API with the following code:
```javascript
import { createClient } from 'urql'

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

const tokensQuery = `
query {
Expand Down

0 comments on commit 3b3fc9e

Please sign in to comment.