Questions tagged [thegraph]

TheGraph is a solution for accessing blockchain data from SQL via GraphQL interface implemented as, as well as an approach to generate schema and mappings from smart contracts.

TheGraph is a solution for accessing blockchain data from SQL via GraphQL interface implemented as graph_node, as well as an approach to generate schema and mappings from smart contracts.

44 questions
1
vote
1 answer

How to query data from my UNISWAP FACTORY? (GQL)

I want to fetch first 10 swaps of a pair , in my contract. I've read that its possible to fetch from the subGraph of uniswap: https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2 Here is an example to fetch a pair from the MAINNET (Im working…
ofirthedev
  • 177
  • 1
  • 3
  • 9
1
vote
0 answers

TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type

I user typeScript in GraphQl (in TheQraph project) , this is my entity: type UserBorrow @entity{ id: ID! userCollateral: UserCollateral! market: Market! balance: BigDecimal! accumulatedInterest: BigDecimal! lastBorrowIndexTime: BigInt! timeStamp:…
1
vote
2 answers

Getting error when defining object Type '' is not assignable to type in assembly script (thegraph development)
I'm developing subgraph for indexing blockchain events, but I get error when defining and object ⠋ Compile subgraphERROR TS2322: Type '' is not assignable to type 'i32'. export const FARMS_CONTRACT_NAMES = { BALANCER_LIQUIDITY:…
Mohammad Ranjbar Z
  • 1,487
  • 1
  • 10
  • 20
1
vote
1 answer

TheGraph: one graph-node for several blockchains?

graph-node from TheGraph can get data from blockchain. From https://github.com/graphprotocol/graph-node/blob/master/docs/getting-started.md cargo run -p graph-node --release -- \ --postgres-url…
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
1
vote
0 answers

SubQuery vs TheGraph for blockchain data

Within Ethereum blockchain ecosystem TheGraph https://thegraph.com/ became almost standard solution to build GraphQL access to blockchain data (indexed in PostgreSQL) SubQuery https://www.subquery.network/ does the same but for Polkadot chain. What…
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
1
vote
3 answers

thegraph.com How to update data source programmatically to track new contract?

Based on the doc, it seems that we need to specify the address of the contract we want to track. How could I track the new contract? eg. After deploying a factory contract, we also need to track all the new contract created by the…
noooooooob
  • 1,872
  • 3
  • 21
  • 27
0
votes
0 answers

Cannot find name 'abort' during npm run build

/node_modules/@graphprotocol/graph-ts/chain/ethereum.ts:47:7 export class Value { constructor(public kind: ValueKind, public data: ValuePayload) {} @operator('<') lt(_: Value): boolean { abort("Less than operator isn't supported…
0
votes
0 answers

thegraph Unable to synchronize after deployment

error :Subgraph instance failed to run: A matching Ethereum network with NodeCapabilities { archive: false, traces: true } was not found. enter image description here Redeploy a Subgraph to the Hosted Service graph deploy --product hosted-service…
lfhuang
  • 1
  • 1
0
votes
0 answers

Failed to generate code from ABI and GraphQL schema: How to fix 'Cannot find module' error?

When initializing graph studio I get the following error Failed to generate code from ABI and GraphQL schema: Command failed: yarn codegen warning ..\package.json: No license field » ModuleLoadError: [MODULE_NOT_FOUND] require failed to load » …
natty
  • 1
0
votes
0 answers

How to use dynamic variables using GraphQL in NEXTjs

So I am trying to build an application in which I need to pass the account as queury. How can I achieve this? My proposed solution (which is not working obviously): let account = '0x74c7b157af4E5418F03eb928DF309cc98CE38E66'; const GET_ACTIVE_ITEM…
0
votes
0 answers

Does returning values from an event handler makes the Subgraph to crash?

I tried returning the entity objects from the event handlers on the AssemblyScript Subgraph code to simplify unit testing. For example, this works fine: // Original code export function handleEventCreation( event: EventCreation ): void…
gagiuntoli
  • 475
  • 5
  • 13
0
votes
0 answers

How do I deploy the Uniswap v3 Subgraph repo on my own subgraph?

With "Hosted Service" on The Graph being retired soon, I am interested in duplicating this repo to run on a local Graph node. I tried to clone the repository and initialize the subgraph but I ran into a few errors with incompatible versions. Any…
0
votes
0 answers

getting Type Error even after getting Response

const express = require("express"); const app = express(); const axios = require("axios"); const ethers = require("ethers"); require("dotenv").config(); app.get("/:address", async (req, res) => { const SUBGRAPH = process.env.SubGraph_URL; const…
0
votes
0 answers

theGraph: create subgraph loading but not working

subgraph Recently I have been having problem with the graph. Any time I try to create a subgraph. It shows the loading spinner but nothing shows up. I tried this for hours but still nothing. I changed networks, used vpn and nothing worked. I…
0
votes
1 answer

Subgraph on hosted service issue with selecting based on an ethereum address

I have created the schema for my subgraph inside the .graphql file, here is a sample: ` type Post @entity { id: ID! title: String! # string body: String! # string createdAt: BigInt! # uint256 groupID: BigInt! # uint256 } type User…