py-flask-graph

License: GPL v3

Python application

Run Flask App

bash ./run.sh 

OR

Run App Run profile in PyCharm

Run Flask App (Startup Logs)

 * Serving Flask app 'app.py'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://127.0.0.1:8000
Press CTRL+C to quit

Test Resolver with hello Query via curl:

curl -X POST \
-H "Content-Type: application/json" \
--data '{ "query": "{ hello }" }' \
http://localhost:8000/graphql

JSON Response

{
  "data": {
    "hello": "Hello, GraphQL!"
  }
}

GraphQL PlayGround

flask-graphql-app

Add / Get Item GraphQL Samples

query hi {
  hello
}

query bye {
  goodbye
}

query full_meeting {
  hello
  goodbye
  items {
    name
  }
}

query getItems {
  items {
    name
    quantity
  }
}

mutation addNewItem {
  addItem(name: "Oranges", quantity: 500) {
    name
    quantity
  }
}