Hasura connects GraphQL to the REST of the world

graphql-2.jpg

Roughly six months after introducing its cloud service last summer, Hasura is joining the rest, or shall we say, REST of the world, so to speak. It is adding a new capability that exposes the GraphQL calls as RESTful APIs with a single click. With the new REST conversion capability, the query still runs as GraphQL, but externally looks like just another REST API and can be managed as just another REST client.

At first glance, that sounds like we’re traveling forward into the past. The rationale behind adding the REST capability is a bridging strategy. REST APIs have become the workhorse of modern, API-driven application development. By adding this new conversion utility, IT organizations do not have to create and manage a separate set of APIs. Instead, the GraphQL calls developed and run in Hasura will be surfaced as REST, and if an organization uses tools to manage all their APIs, the Hasura APIs will appear as REST.

To recap, GraphQL picks up where REST leaves off. For the bulk of enterprise applications, GraphQL will not replace REST. Instead, GraphQL is meant for supporting apps with highly compact footprints that must minimize overhead. That’s exactly the scenario for mobile or IoT apps which typically require retrieving only tiny bits of data. REST typically requires multiple back and forth statements, and thereby hogs bandwidth. GraphQL is far more efficient, which can typically get just the specific data required by the app with a single statement.

GraphQL originated as a query language developed by Facebook for its mobile clients querying JSON data, and was added by MongoDB last summer as the query language for its Realm mobile app sync platform. While Facebook and MongoDB used GraphQL for querying JSON documents, Hasura has primarily focused on relational targets. It currently supports many of the usual suspects: PostgreSQL, MySQL, SQL Server, and BigQuery. As there are still gaps, we expect the list of databases for which Hasura can autogenerate GraphQL queries will fill out over the course of the year.

The new release also beefs up security with support with several capabilities. They include fine-grained authorization and role-based access control (RBAC) through integrations with Active Directory and Amazon Cognito. Additionally, Hasura is adding support for VPC peering with AWS, allowing customers to work within their own their private networks.

Hasura offers both an on-premises enterprise edition, and since last summer, also offers a cloud service for its development and runtime for developing GraphQL queries. Its implementation of GraphQL is an open source project with downloads that went viral last year, increasing from 2 million in 2019 to 100 million in 2020.

Leave a Reply

Your email address will not be published. Required fields are marked *