Closed incrypto32 closed 6 hours ago
Latest commit: b75cda90f8fd1bb83f513f92b71f85888170fa6c
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Latest commit: |
b75cda9
|
Status: | ✅ Deploy successful! |
Preview URL: | https://f66a91d8.graph-tooling.pages.dev |
Branch Preview URL: | https://feat-subgraph-composition.graph-tooling.pages.dev |
Hey @incrypto32, thanks for the PR !
Gonna take a bit of time to review. In the meantime if you can provide some more context/information as to what these feature would bring to developers, would be very much appreciated thanks :+1:
Given the context, we'll also wait for some of the related PRs in graph-node
to be merged before merging this one as well.
Hey @0237h , i'll write up the required context soon. TL;DR is this will support the code generation and the new type of datasource thats being added as part of the subgraph composition feature. As you mentioned. Yes those graph-node PR's need to be merge before getting this out. I'll write a detailed comment on the changes later.
@0237h I just added a description to the PR. let me know if more info is needed
Doesn't seem to work for me. After running graph init
and selecting "subgraph" as a protocol it tries to download ABI for I don't know what. I assume it shouldn't, since I never specified the contract address?
What's the flow here @incrypto32 ?
Oops, i think i didn't check the graph init
support just the codegen and build. I tested with an existing subgraph that i modified to use the new datasource.
Thanks for testing it out @YaroShkvorets, i'll add the init support too.
@YaroShkvorets just added the init command. Please re review
❯ ./bin/run init --skip-install --skip-git
› Warning: @graphprotocol/graph-cli update available from 0.87.0 to 0.90.1.
› Warning: In next major version, this flag will be removed. By default we will stop initializing a Git repository.
✔ Protocol · subgraph
✔ Subgraph slug · asdf
✔ Directory to create the subgraph in · asdf
? Subgraph network …
? Subgraph network …
? Subgraph network …
✔ Subgraph network · mainnet
✔ Source subgraph identifier · QmTZ8ejXJxRo7vDBS4uwqBeGoxLSWbhaA7oXa1RvxunLy7
✔ IPFS node to use for fetching subgraph manifest · https://api.thegraph.com/ipfs/api/v0
✔ Start Block · 0
Generate subgraph
✖ Failed to create subgraph scaffold: Cannot read properties of undefined (reading 'length')
TypeError: Cannot read properties of undefined (reading 'length')
Let's merge it @0237h , then let @incrypto32 polish out any bugs. There is a lot of overlap with what I'm doing so I don't want to keep this PR open much longer to avoid merge hell.
This PR adds new types for subgraph datasources to graph-ts and codegen functionality to generate schema code for the source subgraphs. Detailed docs about subgraph datasources here.
This PR
EntityTrigger
type tograph-ts
which is the Assemblyscript represenation of entity triggers.EntityOp
which represents the entity operations done on the source subgraph