{"id":18594677,"url":"https://github.com/ernitingarg/thegraph-subgraphs","last_synced_at":"2026-05-17T11:32:11.179Z","repository":{"id":214871652,"uuid":"737560425","full_name":"ernitingarg/thegraph-subgraphs","owner":"ernitingarg","description":"Explanation about subgraph creation","archived":false,"fork":false,"pushed_at":"2024-01-01T04:18:34.000Z","size":120,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-20T07:29:26.407Z","etag":null,"topics":["graphql","subgraph","thegraph"],"latest_commit_sha":null,"homepage":"https://thegraph.com/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ernitingarg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-31T14:22:27.000Z","updated_at":"2023-12-31T14:29:03.000Z","dependencies_parsed_at":"2024-12-26T20:41:00.718Z","dependency_job_id":"1e30673a-59a5-44e5-9dcf-ccd61be92f42","html_url":"https://github.com/ernitingarg/thegraph-subgraphs","commit_stats":null,"previous_names":["ernitingarg/thegraph-subgraphs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ernitingarg/thegraph-subgraphs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ernitingarg%2Fthegraph-subgraphs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ernitingarg%2Fthegraph-subgraphs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ernitingarg%2Fthegraph-subgraphs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ernitingarg%2Fthegraph-subgraphs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ernitingarg","download_url":"https://codeload.github.com/ernitingarg/thegraph-subgraphs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ernitingarg%2Fthegraph-subgraphs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33136700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphql","subgraph","thegraph"],"created_at":"2024-11-07T01:16:38.714Z","updated_at":"2026-05-17T11:32:11.165Z","avatar_url":"https://github.com/ernitingarg.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Overview\n\nThis document explains how to initialize, create, and deploy your subgraph to the sandbox [Subgraph Studio](https://thegraph.com/studio/) which can be published to hosted service once testing is done.\n\n0. Prerequisite\n\n   - Connect [Subgraph Sudio](https://thegraph.com/studio/) with wallet (eg: metamask)\n   - Create API key\n\n1. Install Graph CLI with either npm or yarn\n\n```bash\nnpm install -g @graphprotocol/graph-cli\n\nyarn global add @graphprotocol/graph-cli\n```\n\n2. Run below command to create new subgraph for existing smart contract. Below example creates the subgraph for [uniswap](https://etherscan.io/token/0x1f9840a85d5af5bf1d1762f925bdaddc4201f984) smart contract.\n\n```bash\ngraph init --protocol ethereum --network goerli --from-contract 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 --contract-name UNI --studio --index-events subgraph_slug_name subgraph_directory\n```\n\n3. Authenticate within CLI by providing Subgraph Studio API key\n\n```bash\ngraph auth --studio \u003capi_key\u003e\n```\n\n4. Go to subgraph directory\n\n```bash\ncd subgraph_directory\n```\n\n5. Build the subgraph\n\n```bash\ngraph codegen \u0026\u0026 graph build\n```\n\n6. Deploy subgraph to Subgraph Studio\n\n```bash\ngraph deploy --studio subgraph_slug_name\n```\n\n7. You can access and use playground for the deployed subgraph at below url\n\n```bash\nhttps://thegraph.com/studio/subgraph/subgraph_slug_name/\n```\n\n![image](https://github.com/ernitingarg/thegraph-subgraphs/assets/20875452/35a6ef69-752c-49af-81a5-21124e0d974d)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fernitingarg%2Fthegraph-subgraphs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fernitingarg%2Fthegraph-subgraphs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fernitingarg%2Fthegraph-subgraphs/lists"}