Interep subgraph definition (The Graph).
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/interep-groups-kovan, currently only for testnet data.
Clone this repository and install the dependencies:
$ git clone https://github.com/interep-project/subgraph.git
$ cd subgraph
$ yarn # or `npm i`
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 the src
AssemblyScript code:
yarn lint
Generate AssemblyScript types for the subgraph (required every time the schema changes):
yarn codegen
Set the authorisation code that links your account on thegraph.com:
yarn auth <access-token>
Deploy the subgraph to the hosted service:
yarn deploy