An open API service indexing awesome lists of open source software.

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

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/)