0.1.7 • Published 10 months ago

@analog-labs/timegraph-js v0.1.7

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

@analog-labs/timegraph-js

A typed GraphQL API wrapper for fetching and creating resources on Analog Timegraph.

Usage

import { TimegraphClient } from '@analog-labs/timegraph-js';

async function useTimegraphClient(){
  
  // Instantiate
  const client = new TimegraphClient({
    url: 'https://timegraph.testnet.analog.one/graphql',
    sessionKey: '0;2Evg4riXZjyK3...'
  });

  // Get a specific view detail
  const getView = await client.view.get({ hashId: 'QmfVym1oXGXpidFEd1sRkCGJSfuzC2V5TpK3Qp5pyXhWnM' });
  
  // Alias another user's view to your own subgraph
  const aliasView = await client.alias.add({ hashId: 'QmfVym1oXGXpidFEd1sRkCGJSfuzC2V5TpK3Qp5pyXhWnM', name: "view_name" });

  // Query a view
  const queryView = await client.view.data({
    _name: "view_name",
    fields: ["_clock", "_index", "name"],
    limit: 10
  });

  // Publish a new view
  const createView = await client.view.create({
    view: {
      identifier: "unique_identifier",
      name: "view_name",
      description: "description should be between 20 to 273 char",
      sql: "SELECT a._clock, a._index ...",
      tags: ["Defi", "ERC20"]
    }
  });

}
useTimegraphClient();
0.1.7

10 months ago

0.1.4

11 months ago

0.1.3

11 months ago

0.1.6

11 months ago

0.1.5

11 months ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.8

1 year ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago