Inspired by The Graph, it gives a smooth way to provide powerful GraphQL queries to app developers over your Substrate blockchain state and history.
Doing multiple read operations across multiple block heights is often required, and the pure latency of fetching the data is very bad. Some reads may depend on the result of prior ones, which results in sequential reads, which is even slower.
The client has to do all the work of filtering, sorting, paginating or otherwise computing on the resulting data, and this takes time, resulting in a slow client experience and CPU load on the user device.
The fetching and processing logic is reproduced in all apps, and adds to the complexity of application development.
Your chain may have transactional or state commitments to free-text data, but doing real full-text search client-side is not an option.
You cannot select the data you want, you have to read full state objects as they are, wasting both connection and full node capacity.
User requests which involve multiple read operations. To fetch a consistent dataset, you will often have to read at some specific block height, as always reading at the tip can break atomicity. This means such read requests will depend on the full node being archival. As your user base scales, that will become a very costly infrastructure.
{
hero {
name
# Queries can have comments!
friends {
name
}
}
}
{
"data" : {
"hero" : {
"name" : "R2-D2",
"friends" : [
{
"name" : "Luke Skywalker"
},
{
"name" : "Han Solo"
},
Decorate any number of String fields in the input schema with @fulltext(query: "myquery") to seach across different fields and entities.
# Input schema
type Post @entity {
text: String @fulltext(query: "forum-text-query"),
title: String @fulltext(query: "forum-text-query")
}
type Comment @entity {
text: String @fulltext(query: "forum-text-query"),
title: String @fulltext(query: "forum-text-query")
}
This site uses cookies and external trackers to improve our services and your experience. By continuing to use our site, you agree to their use.