Figment proposals: Network Graph and GraphQL in Subgraph Processing

Hello Graph Community!
I’m Łukasz, the Lead Software Engineer of the Graph project at Figment.

I’m happy to present our ideas on the different ways we intend to contribute to the Graph community and ecosystem. You might already have read about that in our previous post, Figment joins The Graph as Core Dev Team.

After our long initial research we’ve created proposals on which we would very much like to get your feedback. These two proposals are meant to define the essentials of network integrations.

In order to efficiently bring future networks into the ecosystem, we decided to define the expectations about the data being gathered from blockchain networks and the way subgraphs will retrieve this data. Straightforward definition of the Network Graph and Network Graph API allows to add new networks in an easy, unequivocal way.

Figment GIP-13: Network Graph

The second thing that needed to be done was to define a subgraph data flow in different networks. Operating on many different data types from different blockchain ecosystems is extremely hard. This is where another idea came from.
Instead of only pushing data to subgraphs we would like to empower subgraph developers to use graphQL inside subgraph generation to retrieve data. GraphQL is already widely used in the community and it’s a perfect way to describe data in the processing flow. More than that - graphQL queries may be used to fetch additional data inaccessible in events. The addition of this one function also enables the possibility to call different subgraphs during their generation (which was requested by the community). GraphQL interface may be also used as a more expressive database query mechanism, used in complex statistical calculations.

We see GraphQL as a way to describe data used in subgraph generation, that thanks to different optimizations techniques (eg. prefetching), does not necessarily mean real graphql request - It may be just the memory operation. At the same time thanks to special GraphQL properties - many graphQL queries can be merged together into one, significantly lessening the network traffic.

Figment GIP-14: Subgraph GraphQL Processing

This form of a definition and data interface allows us to propose a way of introducing many networks into the graph. You can find it in the 3rd proposal.

Have a nice read!

4 Likes