Need advice about which tool to choose?Ask the StackShare community!

Apollo

2.4K
1.8K
+ 1
25
PostGraphile

87
214
+ 1
47
Add tool

Apollo vs PostGraphile: What are the differences?

Introduction

In the realm of GraphQL server libraries and frameworks, two popular options are Apollo and PostGraphile. While both serve the purpose of generating a GraphQL API, they differ in certain key aspects. Here are the main differences between Apollo and PostGraphile:

  1. Integration with Databases: Apollo provides a flexible and agnostic approach when it comes to integrating with different databases. It allows you to connect to various databases, such as MongoDB, MySQL, PostgreSQL, and more, by writing custom resolvers. On the other hand, PostGraphile is specifically designed to work with PostgreSQL databases. It automatically generates a GraphQL schema and resolvers based on the existing database structure, making it easier to get up and running quickly with a PostgreSQL backend.

  2. Schema Generation: Apollo requires you to define your GraphQL schema manually by writing SDL (Schema Definition Language) code. This gives you complete control over the schema structure and types. PostGraphile, on the other hand, automatically generates the GraphQL schema based on the existing PostgreSQL database structure. It analyzes the tables, columns, relationships, and other database entities to create a GraphQL API.

  3. Authentication and Authorization: Apollo provides a flexible approach to handle authentication and authorization. It offers various authentication strategies and allows you to implement custom middleware and resolvers to handle authorization logic. PostGraphile, on the other hand, leverages the existing security features of PostgreSQL, such as roles, permissions, and row-level security. It integrates with PostgreSQL's authentication mechanisms, enabling you to secure your API at the database level.

  4. Flexibility and Customization: Apollo offers a high level of flexibility and customization options. It provides a range of plugins, middlewares, and tools to extend and customize the server functionality. With Apollo, you have greater control over how your server handles queries, mutations, caching, and other features. PostGraphile, on the other hand, focuses on simplicity and convention over configuration. It automates many of the common tasks and aims to provide a "batteries included" approach, reducing the need for extensive configuration.

  5. Real-time Subscriptions: Apollo has built-in support for real-time subscriptions using GraphQL subscriptions. It allows clients to subscribe to specific data changes and receive updates in real-time. This feature is particularly useful for applications that require real-time updates, such as chat applications or collaborative tools. PostGraphile, on the other hand, does not natively support real-time subscriptions. However, you can integrate external libraries or services, such as WebSocket libraries, to add real-time capabilities to your PostGraphile API.

  6. Community and Ecosystem: Apollo has a large and active community, with a wide range of resources, tutorials, and plugins available. It is widely used in production environments and has extensive documentation and support. PostGraphile also has a growing community, but it may not be as mature or widely adopted as Apollo. However, being specifically designed for PostgreSQL, it offers deeper integration and optimization for PostgreSQL database features.

In summary, Apollo provides flexibility, extensive customization options, and support for various databases, while PostGraphile focuses on simplicity, automatic schema generation, and tight integration with PostgreSQL. The choice between Apollo and PostGraphile depends on your specific requirements, database choice, and development preferences.

Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of Apollo
Pros of PostGraphile
  • 12
    From the creators of Meteor
  • 8
    Great documentation
  • 3
    Open source
  • 2
    Real time if use subscription
  • 10
    Postgres based authentication
  • 6
    Great developer support
  • 5
    Lightning fast
  • 5
    Database first with no braking changes
  • 4
    Simple to set up and scale
  • 4
    Bye bye Resolvers
  • 3
    Back to database first
  • 3
    9 Automatically generates your GraphQL schema
  • 3
    Easy setup of relationships and permissions
  • 3
    Instant production ready GraphQL
  • 1
    Works with new and existing databases

Sign up to add or upvote prosMake informed product decisions

Cons of Apollo
Cons of PostGraphile
  • 1
    File upload is not supported
  • 1
    Increase in complexity of implementing (subscription)
    Be the first to leave a con

    Sign up to add or upvote consMake informed product decisions

    What is Apollo?

    Build a universal GraphQL API on top of your existing REST APIs, so you can ship new application features fast without waiting on backend changes.

    What is PostGraphile?

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

    Need advice about which tool to choose?Ask the StackShare community!

    What companies use Apollo?
    What companies use PostGraphile?
    Manage your open source components, licenses, and vulnerabilities
    Learn More

    Sign up to get full access to all the companiesMake informed product decisions

    What tools integrate with Apollo?
    What tools integrate with PostGraphile?

    Sign up to get full access to all the tool integrationsMake informed product decisions

    Blog Posts

    GitHubPythonNode.js+47
    55
    72767
    What are some alternatives to Apollo and PostGraphile?
    Helios
    Helios is a Docker orchestration platform for deploying and managing containers across an entire fleet of servers. Helios provides a HTTP API as well as a command-line client to interact with servers running your containers.
    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.
    Python
    Python is a general purpose programming language created by Guido Van Rossum. Python is most praised for its elegant syntax and readable code, if you are just beginning your programming career python suits you best.
    Relay Framework
    Never again communicate with your data store using an imperative API. Simply declare your data requirements using GraphQL and let Relay figure out how and when to fetch your data.
    NGINX
    nginx [engine x] is an HTTP and reverse proxy server, as well as a mail proxy server, written by Igor Sysoev. According to Netcraft nginx served or proxied 30.46% of the top million busiest sites in Jan 2018.
    See all alternatives