subgrounds icon indicating copy to clipboard operation
subgrounds copied to clipboard

Generating typing for subgraphs

Open 0xMochan opened this issue 2 years ago • 2 comments
trafficstars

Is your feature request related to a problem? Please describe. I want type information when using subgraph and fieldpath objects.

Describe the solution you'd like Generating .pyi files for full type information, likely thru a CLI command in contrib.

Describe alternatives you've considered

  • Using notebooks
    • Large projects are easier with packages

Additional context Likely would be a tall ordering and would only work on CLI or first time .load_subgraph is invoked.

Implementation checklist

  • [ ] Task 1

0xMochan avatar Aug 18 '23 20:08 0xMochan

CC @evan-kim2028

0xMochan avatar Aug 18 '23 20:08 0xMochan

I would also be interested in this - namely to auto-generate Python classes from a given subgraph after loading.

I'm trying this (without success)

$ UNISWAP_SUBGRAPH = 'https://api.thegraph.com/subgraphs/name/messari/aave-v2-ethereum' 
$ a = sg.load_subgraph(UNISWAP_SUBGRAPH, True)

Error:

    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

gabrielfior avatar Mar 21 '24 20:03 gabrielfior