https://github.com/graphprotocol/query-examples
Provides examples of how to query Subgraphs published to The Graph Network in a variety of frameworks/languages
https://github.com/graphprotocol/query-examples
Last synced: 2 days ago
JSON representation
Provides examples of how to query Subgraphs published to The Graph Network in a variety of frameworks/languages
- Host: GitHub
- URL: https://github.com/graphprotocol/query-examples
- Owner: graphprotocol
- Created: 2024-03-28T03:36:53.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-06T15:01:54.000Z (11 months ago)
- Last Synced: 2025-03-06T16:21:35.887Z (11 months ago)
- Size: 632 KB
- Stars: 15
- Watchers: 18
- Forks: 13
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# The Graph Protocol - Query Examples
Provides examples on how to query Subgraphs published to [The Graph Network](https://thegraph.com/) using API Keys.
## Obtaining an API Key
An API Key will be needed to query Subgraphs published to The Graph Network. Users are offered 100,000 free queries every month to query Subgraphs.
1. Open [The Graph Studio](https://thegraph.com/studio/)
2. Connect your Wallet
3. Navigate to [API Keys Page](https://thegraph.com/studio/apikeys/)
4. Click, "Create API Key" CTA
5. Enter a Name for the API Key in the pane input
6. Click "Create API Key" submit button
7. API Key Details page will open
8. Copy the key value. Will be a 32-digit key.
## Examples
- [ReactJS](./examples/reactjs/)
- [NextJS app router](./examples/nextjs-app-router/)
- [NextJS pages router](./examples/nextjs-pages-router/)
- [Remix](./examples/remix/)
- [VueJS](./examples/vuejs/)
- [Nuxt (SSR Vue)](./examples/nuxt/)
- [SvelteKit](./examples/sveltejs/)
- [NodeJS Fastify](./examples/nodejs-fastify/)
- [NodeJS CloudFlare Worker](./examples/nodejs-cf-worker/)
- [NodeJS CLI](./examples/nodejs-cli/)
- [cURL](./examples/curl/)
- [Python CLI](./examples/python-cli/)
- [Python FastAPI](./examples/python-fastapi/)
- [Golang API](./examples/golang_api/)
## Additional Resources
- [Querying Best Practices](https://thegraph.com/docs/en/querying/querying-best-practices/)
- [Managing API Keys](https://thegraph.com/docs/en/querying/managing-api-keys/)
- [Querying from an app](https://thegraph.com/docs/en/querying/querying-from-an-application/)