The Graph
Published in

The Graph

November Development Update

Issue 04 / November 2018

We’ve spent the majority of November focused on the Hosted Service. We’ve knocked out several big features and are preparing to launch an internal alpha for testing in the coming weeks. In the meantime, we’ve been working closely with our community to improve the developer experience. Our Discord remains the best place to get in touch as we continue to help teams build their own subgraphs.

New Features

Query subgraphs via GraphQL

All subgraphs currently deployed can now be queried and subscribed to over GraphQL using the dedicated /subgraphs route. A query like

query {
subgraphs {
id
manifest {
repository
description
}
entityCount
}
}

will return the deployed subgraphs with their IDs, repositories, descriptions and the number of entities that have been indexed for them:

{
"data": {
"subgraphs": [
{
"entityCount": "79",
"id": "QmXK7GjPUqwpFRWPE7fP9TnQo4AwcdPfXJ53d4BSzzd8vz",
"manifest": {
"description": "Dharma subgraph",
"repository": "https://github.com/graphprotocol/dharma-subgraph"
}
},
{
"entityCount": "103",
"id": "QmYHHbbVDnT9zjipwZcX9EETjVs97sS5ktJj7F9KTP7z4P",
"manifest": {
"description": "Decentraland subgraph",
"repository": "https://github.com/graphprotocol/decentraland-subgraph"
}
}
]
}
}

We will add information such as subgraph status and progress reporting to this soon.

BigInt math

After aligning the different type systems at play last month, we have landed improvements to the BigInt type. It is now possible to perform basic mathematical operations with BigInt values (e.g. uint256) in your mappings, including +, -, *, / and %. You can also use the methods x.plus(y), x.minus(y), x.times(y), x.dividedBy(y) or x.mod(y) instead.

Improved subgraph validation

Last month, we introduced subgraph validation as part of graph codegen and graph deploy. We have since added more validations to this, including catching invalid contract addresses, invalid ABI references, invalid or unsupported ABI files, events that are not present in the ABI, invalid field types in the GraphQL schema and entity types with missing id fields. Most of these validations will provide you with a list of possible solutions.

New subgraph manifest fields

Additional fields have been added to subgraph manifests: an optional repository (e.g. the subgraph repository on GitHub), an optional description and a network field under each data source.

Configurable ports

The ports used for serving the GraphQL API over HTTP and WebSockets can now be configured with --http-port (defaulting to 8000) and --ws-port (defaulting to 8001). The JSON-RPC admin port has been configurable already via --admin-port (default: 8020).

Elasticsearch logging

When indexing multiple subgraphs at the same time, it can be a little hard to tell them apart in the terminal output. To improve this and to store the subgraph logs for further analysis, subgraph logs can now optionally be written to Elasticsearch in parallel to the terminal.

Other improvements

A number of fixes have landed over the past month. The GraphQL parameter orderBy now works again. Non-derived entity relationships are resolved correctly. Contract addresses starting with 0x are now valid. A concurrency deadlock at Graph Node startup has been fixed.

Exceptions thrown in subgraph mappings are now logged with more detail in order to make debugging easier.

We have added a graph auth command to permanently save access tokens associated with Graph Nodes in the system’s keychain. These will be looked up automatically when running graph deploy against known nodes.

What’s next?

We plan to have an alpha version of the hosted service ready internally by Christmas. As we approach that, we are planning to add features like subgraph status and progress reporting, limiting query complexity, and additional GraphQL features like Interface Support.

Get Involved

Would you like to get involved in developing The Graph? We have easy starting points for new contributors: good first issues in Graph Node, good first issues in Graph CLI.

We always appreciate feedback about The Graph. Don’t be afraid to file issues against Graph Node, Graph CLI or Graph TypeScript.

Have questions or want to chat with the team? Come join our Discord!

If you’re excited about The Graph and would like to explore a position on the team, take a look at our careers page.

Happy Hacking!

— Jannis & The Graph Protocol Team ✌

Follow The Graph on Twitter

Join us on Discord

Join our Telegram group

Subscribe to The Graph’s subreddit

We’re hiring!

The Graph is a query protocol for blockchain data using GraphQL. https://thegraph.com

Recommended from Medium

The Ethics Of Being Nice To Devs Who Try

Introduction to Azure Container Apps

The weirdest Python packages

See Yearn Finance at ETHDenver 2022

A Python Project You Might Not Care About

INT Chain 4.0 ‘Titans’ Testnet Mining Competition-Phase 2

Python Modules

5 ways to learn coding easily

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jannis Pohlmann

Jannis Pohlmann

Tech Lead at Edge & Node, Co-Founder of The Graph

More from Medium

A Metaverse built on privacy and trust — with Nuggets

DIDComm Messaging through libp2p

Moralis Launches Support for Magic

Query ENS records using The Graph Network