Skip to content

mybestpocket/example-graphql-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Requirements

You will need to have Python3 (>= 3.4+) as well as virtualenv and pip >= 15.0+.

We use a virtual environment for this example, all dependencies are listed in the requirements.txt at the root of this project.

Quickstart

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:

./install_deps.sh

Once your environment is setup properly, simply run the example.py script:

python3 example.py YOUR_API_KEY_HERE

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 91.6%
  • Shell 8.4%