/subgraph

InterRep subgraph definition (The Graph).

Primary LanguageTypeScriptMIT LicenseMIT

Interep subgraph

Interep subgraph definition (The Graph).

Linter eslint Code style prettier Repository top language

The Interep subgraph allows groups and group members to be queried using GraphQL. It is available at https://thegraph.com/hosted-service/subgraph/interep-project/kovan, currently only for testnet data.


Install

Clone this repository and install the dependencies:

$ git clone https://github.com/interep-project/subgraph.git
$ cd subgraph
$ yarn # or `npm i`

Usage

The subgraph definition consists of a few files:

  • subgraph.yaml: a YAML file containing the subgraph manifest,
  • schema.graphql: a GraphQL schema that defines what data is stored for the subgraph, and how to query it via GraphQL,
  • src/mappings.ts: AssemblyScript code that translates from the event data to the entities defined in the schema.

Lint

Lint the src AssemblyScript code:

yarn lint

Code generation

Generate AssemblyScript types for the subgraph (required every time the schema changes):

yarn codegen

Authorization

Set the authorisation code that links your account on thegraph.com:

yarn auth <access-token>

Deploy

Deploy the subgraph to the hosted service:

yarn deploy <subgraph-name>