subgrounds
subgrounds copied to clipboard
Generating typing for subgraphs
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
CC @evan-kim2028
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)