What is cardano-graphql?
cardano-graphql is a Cardano query language for API and a runtime for fulfilling queries with existing data extracted from the cardano-db-sync PostgreSQL database. It provides a complete and understandable description of this data and gives clients the power to request the necessary information. This, in turn, makes it easier to evolve client API’s overtime and enables powerful developer tools.
cardano-graphql is the alternative to the traditional cardano-rest available on GitHub. It is built on a similar stack to cardano-rest which uses an extensible framework to retrieve transactions, addresses, and time periods (epochs and slots) from the cardano-db-sync component. For more information on these components please see the Adrestia GitHub page here.
Building and Running
cardano-graphql and cardano-db-sync have been built and tested on Linux and Docker images are available on DockerHub. The recommended method to build cardano-graphql is docker-compose and a sample docker-compose file is provided here.
The cardano-graphql and cardano-db-sync are designed to work with a locally running cardano-node. For instructions on how to build and deploy cardano-graphql please see the cardano-graphql README file
Accessing cardano-graphql playground
Once cardano-graphql is up and running, the graphql playground should accessible at the
Accessing the playground at this location confirms everything is running correctly.
Building cardano-graphql queries
cardano-graphql offers an independent API fully customizable to any requirement or need. To start constructing cardano-graphql queries using playground search the doc pages on the right for the available attribute upon which you can build the query like below: