dfuse GraphQL Python Example
This simple program demonstrates how easy it is to query our GraphQL API over gRPC in Python. It:
- Request a token from our authentication API
- Creates a gRPC connection with credentials
- Instantiates a GraphQL client
- Executes a simple GraphQL query
- Prints the response
You will need to have Python3 (>= 3.4+) as well as
We use a virtual environment for this example, all dependencies are listed
requirements.txt at the root of this project.
First of all, visit https://app.dfuse.io to get a free API key for your project.
First, clone this repository to your work folder:
git clone https://github.com/dfuse-io/example-graphql-python.git cd example-graphql-python
Setup the virtual environment and pull all dependencies:
Once your environment is setup properly, simply run the
python3 example.py YOUR_API_KEY_HERE