Protean-Labs / mesh

The Mesh Engine that implements the Mesh Language, a computational language for web3.
Apache License 2.0
1 stars 0 forks source link

Queyring subgraph runs forever but is instant on thegraph playground #84

Open ThierryBleau opened 3 years ago

ThierryBleau commented 3 years ago

image

cvauclair commented 3 years ago

@ThierryBleau can you post the code block as a markdown code block (instead of a screenshot) so that I can easily copy it? Also, is there anything of note in the jupyter notebook logs?

cvauclair commented 3 years ago

Update: Querying the hosted service seems to be working for other subgraphs. E.g.: Screenshot from 2021-10-26 09-59-11

ThierryBleau commented 3 years ago

It seems to have to do with the size of the query perhaps.

This one runs forever. Nothing in the logs.

Graphql.execute(```graphql(https://api.thegraph.com/subgraphs/name/convex-community/convex-votium)
      query {
        bribes {
            id
            epoch {
                id
            }
            token
            amount
        }
    }
```);

This one works.

Graphql.execute(```graphql(https://api.thegraph.com/subgraphs/name/graphprotocol/graph-network-mainnet)
      query {
        subgraphs(first: 10) {
            id
            displayName
      }
    }
```);
ThierryBleau commented 3 years ago

This one also runs forever

Graphql.execute(```graphql(https://api.thegraph.com/subgraphs/name/graphprotocol/graph-network-mainnet)
      query {
        subgraph(id: "0x673b6e9fe607f6ddf4a4f25b386b846c5c82995e-2") {
            id
            displayName
            image
            currentVersion {
              id
              subgraphDeployment {
                id
              }
            }
          }
    }
```);

Could there be a deadlock when processing nested records? Since this simpler query works

Graphql.execute(```graphql(https://api.thegraph.com/subgraphs/name/graphprotocol/graph-network-mainnet)
    query {
        subgraph(id: "0x673b6e9fe607f6ddf4a4f25b386b846c5c82995e-2") {
            id
            displayName
            image
        }
    }
```);
cvauclair commented 3 years ago

Could there be a deadlock when processing nested records?

Not sure, the following query works (in the unit tests)

Graphql.execute(```graphql(https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2)
  query {
    pairs(first: 1) {
      token0 {
        symbol
      }
      id
    }
  }
```);
ThierryBleau commented 3 years ago

Could it be something with the returned option types?

cvauclair commented 3 years ago

Managed to craft a breaking test using the failing query to the subgraph subgraph. This is the error: Mesh__Eval.Runtime_error("gql_to_value: Non-matching type-value (TConst string) {\"id\":\"0x666d78959706d7e1ed20befeb1d2c9a4e512a22931d8e22928b1f63ce48fcb40\"}") (indicating that a string is expected by a JSON object is found instead).

Good news: It does not seem to be a deadlock.

Bad news: There seems to be some mismatch between the graphql query's return type and the data that is actually returned. Will do more digging.