You will learn how to build and deploy new subgraphs by grafting existing subgraphs.
For larger subgraphs or when continuously deploying smart contracts as part of a project, developers often encounter challenges when indexing a subgraph from its inception, which can lead to resource inefficiency and time consumption.
For more experienced developers, there is the option to utilize the Grafting feature. Grafting involves reusing data from a compatible existing subgraph and initiating indexing from a custom-defined later block. This approach can prove beneficial for testing new features within the underlying smart contract or subgraph entity, particularly when indexing from scratch would be excessively time-consuming. Additionally, Grafting can help swiftly address simple mapping errors during development or temporarily restore the functionality of an existing subgraph that has encountered issues.
The new grafted subgraph does not have to have an identical GraphQL schema as the old base subgraph. It only needs to be compatible with it. It may deviate from the base subgraph's schema in the following ways:
Adding or removing entity types.
Removing attributes from entity types.
Adding nullable attributes to entity types.
Turning non-nullable attributes into nullable attributes.
Adding values to enums.
Adding or removing interfaces.
Changing for which entity types an interface is implemented.