StackShareStackShare
Follow on
StackShare

Discover and share technology stacks from companies around the world.

Follow on

© 2025 StackShare. All rights reserved.

Product

  • Stacks
  • Tools
  • Feed

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  1. Stackups
  2. Application & Data
  3. Languages
  4. Query Languages
  5. Graphene vs PostGraphile

Graphene vs PostGraphile

OverviewDecisionsComparisonAlternatives

Overview

Graphene
Graphene
Stacks96
Followers142
Votes1
GitHub Stars8.2K
Forks819
PostGraphile
PostGraphile
Stacks85
Followers214
Votes47

Graphene vs PostGraphile: What are the differences?

Introduction

Graphene and PostGraphile are both tools used for building GraphQL APIs, but they have some key differences in how they function and the features they provide. This article will outline the main differences between Graphene and PostGraphile in a concise and specific manner.

  1. Code-first vs Database-first approach: Graphene is a code-first library that allows developers to define GraphQL schema and resolvers using Python code. It gives developers complete control over the schema and allows for easy integration with existing Python codebases. On the other hand, PostGraphile is a database-first library that automatically generates GraphQL schema and resolvers from an existing PostgreSQL database. It provides a powerful and seamless integration with PostgreSQL, making it an ideal choice for projects that prioritize database-centric development.

  2. Flexibility vs Convention: Graphene provides a high degree of flexibility in designing the GraphQL schema and resolvers. It allows developers to define custom types, resolvers, and data sources, providing granular control over the API. On the contrary, PostGraphile follows a convention-over-configuration approach, automatically generating the schema and resolvers based on the database schema. While this makes the development process faster, it may limit the flexibility to customize the schema and resolvers according to specific requirements.

  3. Rich feature set: Graphene offers a rich set of features, including input validation, mutations, subscriptions, and middleware support. It provides a comprehensive toolkit for building complex and feature-rich GraphQL APIs. In contrast, PostGraphile focuses primarily on providing seamless integration with PostgreSQL and generating GraphQL schema and resolvers. While it offers functionalities like filtering and pagination, it may lack some of the advanced features offered by Graphene.

  4. Language support: Graphene is a Python library and is primarily used in Python-based projects. It has extensive support for Python features and integrates well with other Python libraries and frameworks. On the other hand, PostGraphile supports multiple languages and can be used with any project that uses PostgreSQL as its database.

  5. Performance: Graphene is known for its performance and scalability. It allows developers to optimize the GraphQL API by leveraging features like batch loading and resolving N+1 query issues. PostGraphile also provides good performance by generating efficient SQL queries and leveraging PostgreSQL's advanced capabilities. However, as PostGraphile handles the schema generation automatically, developers may have less control over the performance optimizations.

  6. Ecosystem and community support: Graphene has a vibrant and active community and a mature ecosystem with extensive documentation, tutorials, and third-party integrations. It has been widely adopted and used in various production systems. While PostGraphile also has an active community, it may have a smaller ecosystem compared to Graphene.

In summary, Graphene and PostGraphile differ in their approach to schema generation, flexibility, features, language support, performance optimizations, and community ecosystem. Graphene provides a code-first approach with flexibility, rich features, and a strong Python ecosystem, while PostGraphile offers a database-first approach with seamless PostgreSQL integration, convention-over-configuration, and broader language support. Choose Graphene for custom schema design and flexibility, and PostGraphile for fast database-centric development with PostgreSQL integration.

Share your Stack

Help developers discover the tools you use. Get visibility for your team's tech choices and contribute to the community's knowledge.

View Docs
CLI (Node.js)
or
Manual

Advice on Graphene, PostGraphile

Raj
Raj

CTO & Founder at Novvum

Oct 5, 2020

Review

Hey Brian, it's hard to pick a best tool for any situation, however, there are tools that offer advantages dependent on use case.

Server Side

If you're looking to quickly generate a GraphQL API, you can use a Graphql As A Service like FaunaDB, Slash Graphql, or 8base.

If you want something more advanced on the server side: Prisma with Postgres, Nexus, & Apollo Server (js) is a great stack to try out. Examples here

Check out TypeORM and TypeGraphQL too

If you're have some existing data on Postgres, PostGraphile or Hasura are your best bet!

If you are using a lot of AWS services, check out Amplify and AppSync. Tutorial here

On the client side:

Check out Gatsby! Graphql is already configured and used to query static or remote information at build time. It's a great way to get your feet wet!

Apollo Client is often the choice for more advanced use cases. But URLQL and gqless are some pretty good alternatives too!

Hope this helps! 👍

302 views302
Comments
Raj
Raj

Oct 10, 2020

Review

It purely depends on your app needs. Does it need to be scalable, do you have lots of features, OR it is a simple project with very simple needs - many of those parameters clarify which technologies will fit.

If you are looking for a quick solution, that reduces lot of development time, take a look at postgraphile (https://www.graphile.org/postgraphile/). You have to just define the schema and you get the entire graph-ql apis built for you and you can just focus on your frontend.

On frontend, React is good, but also need to remember that it is popular because it introduced one way data writes and in-built virtual dom + diffing to determine which dom to modify. Though personally I liked it, am recently more inclined to Svelte because its lightweightedness and absence of virtual dom and its simplicity compared to the huge ecosystem that React has surrounded itself with.

In all situations, frameworks keep changing over time. What is best today is not considered even good few years from now. What is important is to have the logic in a separate, clean manner void of too many framework related dependencies - that way you can switch one framework with another very easily.

3.77k views3.77k
Comments

Detailed Comparison

Graphene
Graphene
PostGraphile
PostGraphile

Graphene is a Python library for building GraphQL schemas/types fast and easily.

Execute one command (or mount one Node.js middleware) and get an instant high-performance GraphQL API for your PostgreSQL database

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
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; support for PostgreSQL RBAC and RLS; watch mode (monitors for database schema changes) for great DX; standalone server, express middleware, or GraphQL schema; integration with Express auth via pgSettings (e.g. Passport.js, optional); JWT auth (optional); very strong support for PostgreSQL functions; simple to set up and scale
Statistics
GitHub Stars
8.2K
GitHub Stars
-
GitHub Forks
819
GitHub Forks
-
Stacks
96
Stacks
85
Followers
142
Followers
214
Votes
1
Votes
47
Pros & Cons
Pros
  • 0
    The future of API's
  • 0
    Will replace RESTful interfaces
Pros
  • 10
    Postgres based authentication
  • 6
    Great developer support
  • 5
    Database first with no braking changes
  • 5
    Lightning fast
  • 4
    Simple to set up and scale
Integrations
GraphQL
GraphQL
Django
Django
Python
Python
Relay Framework
Relay Framework
Apollo
Apollo
ExpressJS
ExpressJS
Node.js
Node.js
PostgreSQL
PostgreSQL
Koa
Koa
GraphQL
GraphQL
Fastify
Fastify
Relay Framework
Relay Framework
graphql.js
graphql.js

What are some alternatives to Graphene, PostGraphile?

GraphQL

GraphQL

GraphQL is a data query language and runtime designed and used at Facebook to request and deliver data to mobile and web apps since 2012.

Prisma

Prisma

Prisma is an open-source database toolkit. It replaces traditional ORMs and makes database access easy with an auto-generated query builder for TypeScript & Node.js.

OData

OData

It is an ISO/IEC approved, OASIS standard that defines a set of best practices for building and consuming RESTful APIs. It helps you focus on your business logic while building RESTful APIs without having to worry about the various approaches to define request and response headers, status codes, HTTP methods, URL conventions, media types, payload formats, query options, etc.

Oracle PL/SQL

Oracle PL/SQL

It is a powerful, yet straightforward database programming language. It is easy to both write and read, and comes packed with lots of out-of-the-box optimizations and security features.

SQL

SQL

SQL is designed for managing data held in a relational database management system (RDBMS), or for stream processing in a relational data stream management system (RDSMS).

JSON API

JSON API

It is most widely used data format for data interchange on the web. This data interchange can happen between two computers applications at different geographical locations or running within same hardware machine.

graphql.js

graphql.js

Lightest GraphQL client with intelligent features. You can download graphql.js directly, or you can use Bower or NPM.

JsonAPI

JsonAPI

t is a format that works with HTTP. A main goal of the specification is to optimize HTTP requests both in terms of the number of requests and the size of data packages exchanged between clients and servers.

GraphQL Ruby

GraphQL Ruby

Get going fast with the graphql gem, battle-tested and trusted by GitHub and Shopify.

Trino

Trino

It is a fast distributed SQL query engine for big data analytics that helps you explore your data universe. It is designed to query large data sets distributed over one or more heterogeneous data sources.

Related Comparisons

Bootstrap
Materialize

Bootstrap vs Materialize

Laravel
Django

Django vs Laravel vs Node.js

Bootstrap
Foundation

Bootstrap vs Foundation vs Material UI

Node.js
Spring Boot

Node.js vs Spring-Boot

Liquibase
Flyway

Flyway vs Liquibase