FuelLabs / fuel-indexer

🗃 The Fuel indexer is a standalone service that can be used to index various components of the Fuel blockchain.
https://docs.fuel.network/docs/indexer/
140 stars 66 forks source link

enhancement: revamp GraphQL query generation #1450

Closed deekerno closed 7 months ago

deekerno commented 10 months ago

Description

This PR rewrites the indexer service's GraphQL query resolution layer.

The following breaking changes have been made:

In addition to the above, the following non-breaking changes and fixes have been made:

Testing steps

First, build the Fuel explorer example; you can use bash scripts/utils/build_modules.bash to build all examples. Then, start the Fuel explorer example with the service (be sure to adjust the Postgres details if they differ from the following command):

cargo run -p fuel-indexer -- run --fuel-node-host beta-4.fuel.network --fuel-node-port 80 --database postgres --postgres-host 127.0.0.1 --postgres-port 5432 --postgres-user postgres --postgres-password 'my-secret' --postgres-database 'postgres'

Examples coming soon...

Notes

Yes, this PR is quite large. However, given that the block explorer will be served by an indexer backend, we needed to support as much GraphQL functionality as we possibly can; we do not have the luxury of enshrining certain types and queries as part of our code so we need to be able to support anything that a user may feasibly create.