Skip to content

FENGNUM/codetest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

GraphQL Query

This project contains a Python script to query a GraphQL endpoint and transform the response data. Follow the steps below to set up and run the script locally.

Prerequisites

  • Python 3.6 or higher
  • Homebrew (optional, for installing Python on macOS)

Install Python and run the script

If you don't have Python installed, you can install it using Homebrew on macOS or on Windows you need to download python and add it to your PATH environment. For Unix you can use apt-get or other commands

brew install python

cd /path/to/your/project
python3 -m venv venv

source venv/bin/activate

pip install -r requirements.txt

pthon main.py

Expected output:

{
  "average_swap_size_usd": "0.00",
  "pools": [
    {
      "token": "0xde104342b32bca03ec995f999181f7cf1ffc04d7",
      "current_price": "0"
    },
    {
      "token": "0x6437fdc89ced41941b97a9f1f8992d88718c81c5",
      "current_price": "0"
    },
    {
      "token": "0x22b9fa698b68bba071b513959794e9a47d19214c",
      "current_price": "0"
    }
  ]
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages