What is GraphQL?

Query and manipulate application data easily

What is GraphQL?

GraphQL is a query and manipulation language for APIs. GraphQL provides a flexible and intuitive syntax to describe data requirements and interactions. It enables developers to ask for exactly what is needed and get back predictable results. It also makes it possible to access many sources in a single request, reducing the number of network calls and bandwidth requirements, therefore saving battery life and CPU cycles consumed by applications. 

Making updates to data is made simple with mutations, allowing developers to describe how the data should change. GraphQL also facilitates quick set up of real-time solutions via subscriptions. All of these features combined, coupled with powerful developer tools, make GraphQL essential to managing application data.

How to GraphQL on AWS?

Front-End Developer Guide Series for Building on AWS with AWS AppSync

8-part guide series containing step-by-step tutorials for front-end developers building full-stack apps on AWS with AWS AppSync.

Why use GraphQL?

GraphQL can be used to build modern web and mobile applications faster by simplifying data management. Developers can query and retrieve multiple pieces of information across different sources in a single network request, ensuring faster response times even on slow connections. In a GraphQL request, developers can specify how to structure the data when it is returned by the server. This makes it possible for to query only the data needed, in the format needed.

GraphQL enables you to drastically reduce the number of endpoints required to manage your application data needs. You can retrieve or manipulate data across multiple resources with one single request. GraphQL also allows developers to discover the data available, queries supported, and data types without requiring knowledge of the backend.

GraphQL allows you to change your data types and structure without impacting existing queries or backend schemas. You can easily add new fields and types to an existing API without changing your front-end code or creating new versions of your API. GraphQL is not tied to any specific database engine, platform, or codebase so you to use it in many scenarios.

GraphQL allows you to request and receive just the data you need, when you need it. There is no over-fetching or under-fetching of data giving your application overall improved performance. GraphQL lets you specify which portions of your data should be available in real time using Subscriptions, eliminating the need to build complex distributed architectures.

When to use GraphQL?

GraphQL is applicable to all types of mobile and web applications across industries, verticals, and categories where the apps require data from multiple sources, real-time data updates, and offline capabilities. Here are some examples of apps that can particularly benefit from being built with GraphQL:

Real-time applications

GraphQL makes building applications that rely on real-time data, like social media or chat, easier by enabling subscriptions across multiple devices, as well as offline access to data. GraphQL can also help by managing application messaging among multiple users with a variety of data types and sources.

Data driven applications

GraphQL creates a single point of entry for all data sources and microservices, so you can build applications that rely on multiple and heterogeneous data sources faster.

Mobile backends

GraphQL optimizes network requests by minimizing the number of queries required to retrieve data from your backend. It also allows you to specify how to structure the data to be received so your application only receives the data it needs, resulting in better network utilization and performance, especially on mobile devices.

Looking for a fully managed GraphQL service? Explore AWS AppSync

AWS AppSync is an enterprise level, fully managed serverless GraphQL service with real-time data synchronization and offline programming features. AppSync makes it easy to build data driven mobile and web applications by securely handling all the application data management tasks such as real-time and offline data access, data synchronization, and data manipulation across multiple data sources.

Read Quick Start documentation

Learn more about AWS AppSync