THE GRAPH CHEAT SHEET
A developer’s cheat sheet for getting up to speed with subgraphs in 15 minutes
Learn more at thegraph.com/ecosystem/learn/
subgraph.yaml: A YAML file that describes the subgraph configuration such as smart contract address, entities, events, etc.
schema.graphql: A GraphQL schema that defines the data you want your GraphQL API to query to serve to your frontend client
AssemblyScript Mappings: AssemblyScript code that translates from the event data emitted from the smart contract to the entities defined in your schema (e.g.
mapping.tsin this cheatsheet)
<aside> 💡 Note: The subgraph folder structure includes several other files and folders such as generated, node_modules, build, etc. The above list only delineates the files that are involved in the subgraph definition process.
graph init --index-events
💡 Currently, the product option
subgraph-studio is only available for subgraphs on Ethereum Mainnet