-
Notifications
You must be signed in to change notification settings - Fork 150
Updating from "Intro" to "How-to" #956
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,31 +1,45 @@ | ||||||
--- | ||||||
title: Querying The Graph | ||||||
sidebarTitle: Introduction | ||||||
title: How to Query a Subgraph Using The Graph | ||||||
sidebarTitle: How to Query | ||||||
--- | ||||||
|
||||||
To start querying right away, visit [The Graph Explorer](https://thegraph.com/explorer). | ||||||
To start querying right away, visit [The Graph Explorer](https://thegraph.com/explorer). This guide shows you how to find a [Subgraph](/subgraphs/developing/subgraphs/), generate a unique URL, and run queries. | ||||||
|
||||||
## Overview | ||||||
|
||||||
When a Subgraph is published to The Graph Network, you can visit its Subgraph details page on Graph Explorer and use the "Query" tab to explore the deployed GraphQL API for each Subgraph. | ||||||
Querying a Subgraph with The Graph lets you access onchain data in a fast, reliable, and structured way, without running your own indexing infrastructure. This guide shows you how to get started so you can power your dapp or analysis with blockchain data. | ||||||
|
||||||
## Specifics | ||||||
## Steps | ||||||
|
||||||
Each Subgraph published to The Graph Network has a unique query URL in Graph Explorer to make direct queries. You can find it by navigating to the Subgraph details page and clicking on the "Query" button in the top right corner. | ||||||
### Step 1: Locate Your Subgraph | ||||||
|
||||||
After a Subgraph is published to The Graph Network, you can visit its Subgraph details page on Graph Explorer. | ||||||
|
||||||
Click the “Query” tab to explore the deployed GraphQL API for each Subgraph. | ||||||
|
||||||
### Step 2: Retrieve the Query URL | ||||||
|
||||||
On the Subgraph details page, select **Query** in the top right corner. Each Subgraph published to The Graph Network has a unique query URL in Graph Explorer to make direct queries. | ||||||
Comment on lines
+18
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like there's a bit of repetition between lines 18 and 22. I realize there is both a "Query" tab (which is the default selected tab when navigating to a Subgraph's details page, so there's really no need to click on it) and a "Query" button, but the latter only scrolls down to the "Query quick start" section of the "Query" tab, where the Query URL (among other things like Base URL and Subgraph ID) can be found and copied. |
||||||
|
||||||
 | ||||||
|
||||||
 | ||||||
|
||||||
You will notice that this query URL must use a unique API key. You can create and manage your API keys in [Subgraph Studio](https://thegraph.com/studio), under the "API Keys" section. Learn more about how to use Subgraph Studio [here](/deploying/subgraph-studio/). | ||||||
> Please see the [Query API](/subgraphs/querying/graphql-api/) for a complete reference on how to query the Subgraph's entities. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
### Step 3: Manage Your API Key | ||||||
|
||||||
Each query URL requires a valid API key. In [Subgraph Studio](https://thegraph.com/studio), locate the **API Keys** section to create or manage your keys. Learn more about how to use Subgraph Studio [here](/subgraphs/developing/deploying/using-subgraph-studio/). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not link directly to the API Keys page?
Suggested change
|
||||||
|
||||||
### Step 4: Check Your Usage Plan | ||||||
|
||||||
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](/subgraphs/billing/). | ||||||
|
||||||
> Please see the [Query API](/subgraphs/querying/graphql-api/) for a complete reference on how to query the Subgraph's entities. | ||||||
## Handling Errors | ||||||
|
||||||
> Note: If you encounter 405 errors with a GET request to the Graph Explorer URL, please switch to a POST request instead. | ||||||
If you encounter 405 errors with a GET request to the Graph Explorer URL, please switch to a POST request instead. | ||||||
|
||||||
### Additional Resources | ||||||
## Additional Resources | ||||||
|
||||||
- Use [GraphQL querying best practices](/subgraphs/querying/best-practices/). | ||||||
- To query from an application, click [here](/subgraphs/querying/from-an-application/). | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Page titles should never be set in
_meta.js
files, but directly in the MDX's frontmatter, either astitle
or assidebarTitle
(as you've also done!), so that they remain translatable.