Over the past 30 years, there’s been an entrenched tension between IT and the business. As digital transformation becomes increasingly imperative, IT must better re-integrate and align with the business by applying technology to help businesses move from a command-control-manage model to a do-adapt-learn mentality. IT’s strategic alignment with the business is an operational muscle that is brought to life at every level, and at every scale, across the organization—from C-suite alignment to database strategy. In this piece, we’ll zero in on GraphQL and examine the ways that it can more effectively enable the business compared to a typical REST approach.
Reason 1: It’s Language and Data Source Agnostic
There are few barriers to getting started with GraphQL as your query language in any given project. Because it is data source-agnostic, you can use any APIs, databases, or combination of the two you already have in place. It works with your front-end framework of choice, and with GraphQL clients like Apollo (framework agnostic) and Relay (React), tools that assist with common concerns like caching and managing web sockets, it’s easier than ever to get your front-end utilizing GraphQL queries and mutations.
Business value: Because it is data source and framework agnostic, GraphQL is a one-stop shop for data querying and can grow with your organization, regardless of future storage choices or changes. This allows for complete customization based on a project requirements and team needs.
Reason 2: It Emphasizes Relationships and Focuses on Shape
GraphQL is based on the notion of data as a graph without a single root or unidirectional flow. We won’t dive into graph theory here, but the end result we achieve is nodes (slices of data) that can be linked in any number of ways, allowing us to customize data linkage per our needs at any given point.
Business value: Because GraphQL is declarative, it demands we design queries that explicitly describe the shape we expect returned, effectively side stepping a common UI issue in which a single REST endpoint won't return the exact data needed for a specific view. That scenario often arises when working with either bloated endpoints that over fetch or endpoints that under fetch, resulting in the need to chain multiple fetches to retrieve all the desired data or creating a custom endpoint for each use case. A GraphQL layer ensures we are querying purposefully and will get exactly what we need, no more and no less.
Reason 3: It Enables the Development of Customized, Declarative Schema
When implementing a GraphQL server, users are empowered to create their own custom schema to describe and categorize the data you have access to. Having complete control over the schema gives developers the freedom to describe the data in a way that makes sense for the application. The way the data is stored does not limit the associations you can create. Since GraphQL is strongly typed, you have control of what data is returned and how, down to the field.
Business value: Because GraphQL has strongly typed schemas and tooling to easily traverse it, it’s a good choice for large, growing and/or ever-changing teams because it offers full transparency. This feature enables more agile and iterative collaboration across business functions and teams as they seek to design products and solutions that are more responsive to customer needs.
In response to the criticality of digital transformation, IT leaders across industries have an opportunity to strengthen their capacity to advance strategic priorities. Every element of the IT stack – from operations to architecture—plays a role. In its journey to align with the needs of the business, the importance of the database – and specifically GraphQL—cannot be underestimated.