Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 1.3 KB

File metadata and controls

54 lines (40 loc) · 1.3 KB

The Graph Client / NodeJS (TS)

This examples integrates The Graph Client with NodeJS/TypeScript usage, with 2 Subgraphs that has similar GraphQL schemas. The goal of this example is to do requests to different subgraphs with dynamic context values

The example here is using the following tools/concepts:

flowchart TB
    linkStyle default interpolate basis
    c1[(Chain 1)]-->t1
    c2[(Chain 2)]-->t2

    subgraph "Subgraph A"
    t1("type Something")
    end

    subgraph "Subgraph B"
    t2("type Something")
    end

    t1---ccc
    t2---ccc
    ccc["Client-side composition"]---gc["Graph Client"]

    subgraph m["Composed Schema"]
    t3("type Something {
      # ... rest of the fields
      chainId: String!
    }")
    end

    gc---m
Loading

Getting Started

To run this example, make sure to install the dependencies in the root of the monorepo, build the client locally, and then run this example:

# In the root directory
$ yarn install
$ yarn build
$ cd examples/cross-chain-extension
$ yarn build-client
$ yarn start

DevTools

You can also run The Graph Client DevTools by running: yarn graphiql.