{"id":26497686,"url":"https://github.com/robin-thomas/piper-graph","last_synced_at":"2026-04-13T16:02:36.609Z","repository":{"id":41780753,"uuid":"195484761","full_name":"robin-thomas/piper-graph","owner":"robin-thomas","description":"Piper graph","archived":false,"fork":false,"pushed_at":"2022-12-09T17:15:50.000Z","size":733,"stargazers_count":0,"open_issues_count":10,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-20T14:05:56.291Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://thegraph.com/explorer/subgraph/robin-thomas/piper","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/robin-thomas.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}},"created_at":"2019-07-06T01:31:22.000Z","updated_at":"2020-07-20T21:45:55.000Z","dependencies_parsed_at":"2023-01-25T15:46:24.332Z","dependency_job_id":null,"html_url":"https://github.com/robin-thomas/piper-graph","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/robin-thomas/piper-graph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robin-thomas%2Fpiper-graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robin-thomas%2Fpiper-graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robin-thomas%2Fpiper-graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robin-thomas%2Fpiper-graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robin-thomas","download_url":"https://codeload.github.com/robin-thomas/piper-graph/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robin-thomas%2Fpiper-graph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31759540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T15:25:13.801Z","status":"ssl_error","status_checked_at":"2026-04-13T15:25:09.162Z","response_time":93,"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":[],"created_at":"2025-03-20T13:57:23.278Z","updated_at":"2026-04-13T16:02:36.595Z","avatar_url":"https://github.com/robin-thomas.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Piper graph\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\nhttps://thegraph.com/explorer/subgraph/robin-thomas/piper\n\n# Table of Contents\n1. [Introduction](#introduction)\n2. [Entity](#entity)\n   * [Extension](#extension)\n   * [ExtensionVersion](#extensionversion)\n   * [ExtensionRating](#extensionrating)\n3. [Queries](#queries)\n   * [IS_EXTENSION_UPDATED](#is_extension_updated)\n   * [GET_EXTENSION_BY_HASH](#get_extension_by_hash)\n   * [GET_EXTENSIONS](#get_extensions)\n   * [GET_EXTENSION_VERSIONS](#get_extension_versions)\n   * [GET_EXTENSION_REVIEWS](#get_extension_reviews)\n   * [SEARCH_EXTENSIONS](#search_extensions)\n   * [GET_EXTENSIONS_BY_HASH](#get_extensions_by_hash)\n4. [Installation](#installation)\n\n# Introduction\n\u003e While blockchains and storage networks are critical components of the stack, data is rarely stored in a format that can be consumed directly in applications. Applications need to filter, sort, paginate, group, and join data before it can be fetched. Users don’t like looking at spinners and waiting for screens to load. If web3 is going to catch on we need to provide experiences that are as good or better than centralized alternatives.\u003cbr/\u003e\u003cbr/\u003e\n\\- https://medium.com/graphprotocol/introducing-the-graph-4a281b28203e\n\nQuerying from a smart contract is never a good idea. It takes forever, plus the kind of database querying that we are so used to, is next to impossible to replicate on smart contracts. So what to do? Enter [The Graph](https://thegraph.com/), which allows you to create a GraphQL endpoint (with minimal code) by listening to the events emitted from your smart contract. You don't even have to store much data on the blockchain! Plus they even come with their own set of GraphQL resolvers that will solve most of your query problems! Isn't that amazing? \n\n**Piper Graph** is one such graph built for my dapp: [Piper](https://github.com/robin-thomas/piper.git)\n\n# Entity\nPiper Graph supports 3 entities:\n\n### **Extension**\nThis entity is used to track of all latest updates for an extension.\n```\ntype Extension @entity {\n  id: ID!\n  owner: Bytes! # address\n  updated: BigInt! # uint32\n  size: BigInt! # uint32\n  version: String! # string\n  category: String! # string\n  name: String! # string\n  hash: String! # string\n  crx: String! # string\n  iconURL: String! # string\n  developer: String! # string\n  overview: String! # string\n}\n```\n\n### **ExtensionVersion**\nThis entity is used to keep track of all version updates of each extension.\n```\ntype ExtensionVersion @entity {\n  id: ID!\n  hash: String! # string\n  version: String! # string\n  crx: String! # string\n  size: BigInt! # uint32\n  updated: BigInt! # uint32\n}\n```\n\n### **ExtensionRating**\nThis entity is used to keep track of all ratings/reviews of an extension.\n```\ntype ExtensionReview @entity {\n  id: ID!\n  hash: String! # string\n  rating: BigInt! # uint32\n  review: String! # string\n  updated: BigInt! # uint32\n  reviewer: Bytes! # address\n}\n```\n\n# Queries:\n\n### **IS_EXTENSION_UPDATED**\n```\nquery Extension($hash: String!) {\n  extension(hash: $hash) {\n    hash\n      updated\n    }\n  }\n}\n```\n\n### **GET_EXTENSION_BY_HASH**\n```\nquery Extension($hash: String!) {\n  extension(hash: $hash) {\n    hash\n    developer\n    iconURL\n    category\n    version\n    crx\n    overview\n    updated\n    size\n    owner\n    name\n  }\n}\n```\n\n### **GET_EXTENSIONS**\n```\nquery Extensions($skip: Int!) {\n  extensions(orderBy: updated, orderDirection: desc, first: 10, skip: $skip) {\n    hash\n    developer\n    iconURL\n    category\n    version\n    crx\n    overview\n    updated\n    size\n    owner\n    name\n  }\n}\n```\n\n### **GET_EXTENSION_VERSIONS**\n```\nquery ExtensionVersions($hash: String!) {\n  extensionVersions(where: { hash: $hash }) {\n    hash\n    version\n    crx\n  }\n}\n```\n\n### **GET_EXTENSION_REVIEWS**\n```\nquery ExtensionReviews($hash: String!) {\n  extensionReviews(where: { hash: $hash }) {\n    hash\n    rating\n    reviews\n    reviewer\n  }\n}\n```\n\n### **SEARCH_EXTENSIONS**\n```\nquery SearchExtensions($rating: Int!, $category: String!, $name: String!) {\n  extensions(where: { name_starts_with: $name, category: $category }) {\n    hash\n  }\n  extensionReviews(where: { rating_gte: $rating }) {\n    hash\n  }\n}\n```\n\n### **GET_EXTENSIONS_BY_HASH**\n```\nquery Extension($hash: [String!]!) {\n  extensions(where: { hash_in: $hash }) {\n    hash\n    developer\n    iconURL\n    category\n    version\n    crx\n    overview\n    updated\n    size\n    owner\n    name\n  }\n}\n```\n\nYou can see all the queries being used here: https://github.com/robin-thomas/piper/blob/master/components/utils/graphql/Query.js\n\n# Installation:\n```\n$ git clone https://github.com/robin-thomas/piper.git\n$ git clone https://github.com/robin-thomas/piper-graph.git\n$ cd piper\n$ npm run init:graph\n$ cd piper\n```\n\nMake necessary changes to the `schema.graphql` and `src/mapping.ts`. Then copy over all the files (except the `.git` folder and `.gitignore` file) to `piper-graph` directory.\n\n```\n$ cd piper-graph\n$ yarn codegen\n$ npm run deploy\n```\n\nLicense\n----\nMIT\n\n**Free Software, Hell Yeah!**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobin-thomas%2Fpiper-graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobin-thomas%2Fpiper-graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobin-thomas%2Fpiper-graph/lists"}