Skip to content

Commit

Permalink
edits
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-tortora committed Mar 25, 2024
1 parent 344f2b4 commit 4b008ed
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions docs/build/getting-started/subgraphs.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ significantly enhancing developer efficiency and user experience.

Subgraphs collect and organize blockchain data by application needs, making it readily accessible for developers. Unlike
blockchains that store data without application context, subgraphs allow you to quickly retrieve information pertinent
to your application. Services like Alchemy Subgraphs simplify real-time data access, facilitating the creation of
to your application and simplify real-time data access, facilitating the creation of
dynamic user interfaces and interactions in your applications.

## Subgraph Components and Operations

Subgraphs are built on GraphQL APIs, enabling you to query on-chain transaction data efficiently. This feature is
particularly useful for developers working with complex smart contracts requiring detailed frontend interfaces. For
instance, querying transactions within a specific Uniswap v3 liquidity pool becomes straightforward with subgraphs. By
defining a schema and indexing event data, you can utilize the generated GraphQL API for effective data querying.
Subgraphs are built on [GraphQL](https://graphql.org/) APIs, enabling you to query on-chain transaction data efficiently.
This feature is particularly useful for developers working with complex smart contracts requiring detailed frontend
interfaces. For instance, querying transactions within a specific liquidity pool becomes straightforward with subgraphs.
By defining a schema and indexing event data, you can utilize the generated GraphQL API for effective data querying.

### Subgraph Manifest

Expand All @@ -42,44 +42,46 @@ crucial for structuring your data to support efficient queries.

### Subgraph Mappings

Mappings process incoming blockchain events, specified in your manifest, and store them according to your schema. These
AssemblyScript codes are essential for translating raw blockchain data into a format your application can easily query.
Mappings process incoming blockchain events, specified in your [manifest](#subgraph-manifest), and store them
according to your [schema](#subgraph-schema).
These [AssemblyScript](https://www.assemblyscript.org/) codes are essential for translating raw blockchain data into a
format your application can easily query.

## Popular Use Cases for Subgraphs

Subgraphs have found widespread adoption in various blockchain applications, from DeFi to NFTs and DAOs, due to their
ability to index and query data effectively.

* Custom Smart Contract Indexing: Ideal for developers needing to index data for unique smart contracts, especially
* **Custom Smart Contract Indexing**: Ideal for developers needing to index data for unique smart contracts, especially
those creating frontend interfaces.
* Decentralized Finance (DeFi): Subgraphs provide real-time data on token prices, liquidity, and more, enhancing DeFi
* **Decentralized Finance (DeFi)**: Subgraphs provide real-time data on token prices, liquidity, and more, enhancing DeFi
applications.
* Non-fungible Tokens (NFTs): They allow for efficient querying of NFT ownership, transaction history, and off-chain
* **Non-fungible Tokens (NFTs)**: They allow for efficient querying of NFT ownership, transaction history, and off-chain
data.
* Decentralized Autonomous Organizations (DAOs): Subgraphs facilitate on-chain decision-making and data analysis for
* **Decentralized Autonomous Organizations (DAOs)**: Subgraphs facilitate on-chain decision-making and data analysis for
DAOs.
* Gaming: They support real-time data access, improving gameplay and in-game transactions.
* **Gaming**: They support real-time data access, improving gameplay and in-game transactions.

## Benefits of Using Subgraphs

Subgraphs offer a developer-friendly approach to blockchain data indexing, compatible with various blockchains and
enhancing application security and resilience.

* Ease of Use: With familiar tools like AssemblyScript and GraphQL, subgraphs are accessible to developers, simplifying
* **Ease of Use**: With familiar tools like AssemblyScript and GraphQL, subgraphs are accessible to developers, simplifying
the backend data management.
* Cross-Blockchain Compatibility: They work across multiple EVM-compatible networks, allowing applications to operate
* **Cross-Blockchain Compatibility**: They work across multiple EVM-compatible networks, allowing applications to operate
seamlessly on different blockchains.
* Security and Decentralization: Opting for decentralized querying with subgraphs can reduce reliance on single data
* **Security and Decentralization**: Opting for decentralized querying with subgraphs can reduce reliance on single data
sources, increasing application robustness.

## Considerations for Using Subgraphs

While subgraphs simplify data querying, developing and debugging them can present challenges, including customization
limits and potential costs.

* Development Complexity: Learning the subgraph ecosystem and debugging can be daunting without adequate tooling.
* Customization Limits: If your application requires highly specific indexing, a custom solution might be necessary.
* Cost and Indexing Speed: Managing costs and ensuring efficient indexing are important factors when deciding to use
* **Development Complexity**: Learning the subgraph ecosystem and debugging can be daunting without adequate tooling.
* **Customization Limits**: If your application requires highly specific indexing, a custom solution might be necessary.
* **Cost and Indexing Speed**: Managing costs and ensuring efficient indexing are important factors when deciding to use
subgraphs.

## Subgraph Providers and Tools
Expand All @@ -90,4 +92,4 @@ limits and potential costs.
subgraphs.
It supports scalable, cost-effective solutions for blockchain data management, catering to diverse developer needs.

## TODO add info about the nakama repo, archice nodes and RPC URL
## TODO add info about the nakama repo, how to use archive nodes and RPC URL

0 comments on commit 4b008ed

Please sign in to comment.