Graphene vs PostGraphile: What are the differences?
Developers describe Graphene as "GraphQL framework for Python". Graphene is a Python library for building GraphQL schemas/types fast and easily. On the other hand, PostGraphile is detailed as "Instant GraphQL API for your PostgreSQL database; use standalone or as a Node.js middleware; MIT-licensed OSS". Execute one command (or mount one Node.js middleware) and get an instant high-performance GraphQL API for your PostgreSQL database.
Graphene and PostGraphile can be categorized as "Query Languages" tools.
Some of the features offered by Graphene are:
- Easy to use: Graphene helps you use GraphQL in Python without effort.
- Relay: Graphene has builtin support for Relay
- Django: Automatic Django model mapping to Graphene Types. Check a fully working Django implementation
On the other hand, PostGraphile provides the following key features:
- instant GraphQL schema via reflection over PostgreSQL database API
- compiles complex GraphQL queries into very few SQL statements resulting in high performance
- built entirely from plugins - heavily customisable
Graphene and PostGraphile are both open source tools. PostGraphile with 7.49K GitHub stars and 364 forks on GitHub appears to be more popular than Graphene with 4.71K GitHub stars and 502 GitHub forks.
What is Graphene?
What is PostGraphile?
Need advice about which tool to choose?Ask the StackShare community!
Sign up to add, upvote and see more prosMake informed product decisions
What are the cons of using Graphene?
What are the cons of using PostGraphile?
Sign up to get full access to all the companiesMake informed product decisions
Sign up to get full access to all the tool integrationsMake informed product decisions
We recently switched from MongoDB and the Python library MongoEngine to PostgreSQL and Django in order to:
- Better leverage GraphQL (using the Graphene library)
- Allow us to use the autogenerated Django admin interface
- Allow better performance due to the way some of our pages present data
- Give us more a mature stack in the form of Django replacing MongoEngine, which we had some issues with in the past.
MongoDB was hosted on mlab, and we now host Postgres on Amazon RDS .
We recently implemented GraphQL because we needed to build dynamic reports based on the user preference and configuration, this was extremely complicated with our actual RESTful API, the code started to get harder to maintain but switching to GraphQL helped us to to build beautiful reports for our clients that truly help them make data-driven decisions.
Our goal is to implemented GraphQL in the whole platform eventually, we are using Graphene , a python library for Django .
I've been using Django for quite a long time and in my opinion I would never switch from it. My company is currently using Django with REST framework and a part in GraphQL using Graphene. On the frontend we use Next.js and so far everything has been running quite good. I've found limitations but manage to solve it.
As someone mentioned before, if you are comfortable with Django, don't switch. There's no need since with django you can basically achieve anything. Of course this will depend on the project you want to build, but the scalability and flexibility django can offer it's just out of this world. (Don't want to sound like a fan boy haha but it really is).