paint-brush
Playing With GraphQL + Python Flaskby@rahulmfg
17,313 reads
17,313 reads

Playing With GraphQL + Python Flask

by Rahul MJuly 16th, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

A good friend😉 suggested me to learn <a href="https://hackernoon.com/tagged/graphql" target="_blank">GraphQL</a> and just when I was looking for resources, <a href="https://www.howtographql.com/" target="_blank">HOW TO GRAPHQL</a> was launched.
featured image - Playing With GraphQL + Python Flask
Rahul M HackerNoon profile picture

A good friend😉 suggested me to learn GraphQL and just when I was looking for resources, HOW TO GRAPHQL was launched.

I went with fundamentals of GraphQL in it and found Graphene later. It’s a GraphQL framework for Python. I was more interested in Graphene-SQLAlchemy.

So I learned those stuff as well and came out with a simple project for using GraphQL with Python-Flask using Graphene-SQLAlchemy.

In the demo project I created a simple table “users” with field id, name, email, username. And, created a schema(schema.py) to

  • Add a new user.
  • Get all users list.
  • Find a user with username.
  • Update username with email ID.

Below are the example screenshots of GraphQL query execution:

Query to find a user

Mutation to change username

You can try the demo project here. Looking forward to use React with the demo project stack. And do let me know if you find any typo or bugs. 👨‍💻 🙌