{"id":19945052,"url":"https://github.com/luisvid/gravatarsubgraph","last_synced_at":"2026-04-16T00:32:16.216Z","repository":{"id":151674670,"uuid":"437116437","full_name":"luisvid/GravatarSubgraph","owner":"luisvid","description":"An example of how to get started with The Graph using Hosted Service and the Gravatar smart contract","archived":false,"fork":false,"pushed_at":"2021-12-15T19:58:20.000Z","size":111,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-26T12:38:35.169Z","etag":null,"topics":["blockchain","solidity","thegraph"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luisvid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-12-10T21:17:49.000Z","updated_at":"2021-12-15T19:58:23.000Z","dependencies_parsed_at":"2023-06-29T19:15:32.822Z","dependency_job_id":null,"html_url":"https://github.com/luisvid/GravatarSubgraph","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/luisvid/GravatarSubgraph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisvid%2FGravatarSubgraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisvid%2FGravatarSubgraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisvid%2FGravatarSubgraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisvid%2FGravatarSubgraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luisvid","download_url":"https://codeload.github.com/luisvid/GravatarSubgraph/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisvid%2FGravatarSubgraph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31866314,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: 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":["blockchain","solidity","thegraph"],"created_at":"2024-11-13T00:24:00.377Z","updated_at":"2026-04-16T00:32:16.195Z","avatar_url":"https://github.com/luisvid.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# first steps with TheGraph\n\nAn example of how to get started with The Graph using Hosted Service and the Gravatar smart contract\n\n### 1. Install the Graph CLI\n\n```\nNPM\n$ npm install -g @graphprotocol/graph-cli\n```\n\n### 2. Initialize your Subgraph\n\nInitialize your subgraph from an existing contract.\n\n```\n$ graph init --product hosted-service --from-contract \u003cAddress\u003e\n```\n\n```\n$ graph init --product hosted-service --from-example\n✔ Protocol · ethereum\n✔ Subgraph name · luisvid/subgraphtest\n✔ Directory to create the subgraph in · subgraphtest\n———\n✔ Cloning example subgraph\n✔ Update subgraph name and commands in package.json\n✔ Initialize subgraph repository\n✔ Install dependencies with yarn\n✔ Generate ABI and schema types with yarn codegen\n\nSubgraph luisvid/subgraphtest created in subgraphtest\n```\n\nIn the case of the example, the subgraph is based on the Gravity contract by Dani Grant that manages user avatars and emits NewGravatar or UpdateGravatar events whenever avatars are created or updated.\n\n\n### 3. Write your Subgraph\nThe previous command will have created a scaffold from where you can build your subgraph. When making changes to the subgraph, you will mainly work with three files:\n\n- Manifest (subgraph.yaml) - The manifest defines what datasources your subgraph will index\n- Schema (schema.graphql) - The GraphQL schema define what data you wish to retrieve from the subgraph\n- AssemblyScript Mappings (mapping.ts) - This is the code that translates data from your datasources to the entities defined in the schema\n\n\n### 4. Deploy your Subgraph\n\n- Sign into the Hosted Service using your github account\n- Click Add Subgraph and fill out the required information. Use the same subgraph name as in step 2.\n- Run codegen in the subgraph folder\n\n```\nNPM\n$ npm run codegen\n```\n\nAdd your Access token and deploy your subgraph. The access token is found on your dashboard in the Hosted Service.\n\n```\n$ graph auth --product hosted-service \u003cACCESS_TOKEN\u003e\n$ graph deploy --product hosted-service luisvid/subgraphtest\n```\n\n```\n✔ Load subgraph from subgraph.yaml\n  Compile data source: Gravity =\u003e build/Gravity/Gravity.wasm\n✔ Compile subgraph\n  Copy schema file build/schema.graphql\n  Write subgraph file build/Gravity/abis/Gravity.json\n  Write subgraph manifest build/subgraph.yaml\n✔ Write compiled subgraph to build/\n  Add file to IPFS build/schema.graphql\n                .. QmbSFRGGvHM7Cn8YSjDL41diDMxN4LQUDEMqaa5VVc5sC4\n  Add file to IPFS build/Gravity/abis/Gravity.json\n                .. QmajZTadknSpgsCWRz9fG6bXFHdpVXPMWpx9yMipz3VtMQ\n  Add file to IPFS build/Gravity/Gravity.wasm\n                .. QmbK8QL1GWmsdTsgFYawvxFCjLEFwBsPjMGWpeRh6yaXEk\n✔ Upload subgraph to IPFS\n\nBuild completed: QmXfCx2FYrBhbm7WP8Mn5N6ERbY3jfKVqjntZZYmyNhPRy\n\nDeployed to https://thegraph.com/explorer/subgraph/luisvid/subgraphtest\n\nSubgraph endpoints:\nQueries (HTTP):     https://api.thegraph.com/subgraphs/name/luisvid/subgraphtest\nSubscriptions (WS): wss://api.thegraph.com/subgraphs/name/luisvid/subgraphtest\n```\n\n### 5. Check your logs\n.\n\n### 6. Query your Subgraph\n\nSample query:\n\n```\n{\n  gravatars(first: 5) {\n    id\n    owner\n    displayName\n    imageUrl\n  }\n}\n```\n\n![image](https://user-images.githubusercontent.com/330947/145645990-bc11403a-c34a-45e7-bc25-55e5d525b33b.png)\n\n\n### For more information \n\n- see the docs on https://thegraph.com/docs/developer/quick-start#hosted-service.\n- For great and real examples https://github.com/SimpleFi-finance/subgraphs\n\n \\\n \\\n \n**Have fun! 😀\nLet's #BUIDL 🚀**\n\n![BUIDL_Logo_White](https://user-images.githubusercontent.com/330947/145646882-9319ba26-b56e-41c5-a790-a98f771768de.png)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluisvid%2Fgravatarsubgraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluisvid%2Fgravatarsubgraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluisvid%2Fgravatarsubgraph/lists"}