Introduction to GraphQL API

Agility CMS now supports GraphQL 🥳

We've recently launched v1 of our GraphQL API which provides you with a GraphQL Playground Interface where you can query content from your Agility CMS Instance.

Each Instance comes with a GraphQL schema based on its defined content models, and you can use the GraphQL API to consume both Published and Staging versions of your content.

What We'll Cover

What is GraphQL

An Example

Benefits of GraphQL

GraphQL Limitations

Explore the GraphQL Playground

What is GraphQL?

Created by Facebook in 2012 and open-sourced in 2015, GraphQL is rapidly becoming the standard for API-based data access.

Simply put, GraphQL is a query language for APIs used to request data - or send queries to a database. GraphQL is designed to make APIs flexible, fast, precise, and developer-friendly.

The real power of GraphQL ensures that developers and applications only load the relevant and absolute necessary data in a single request (even if it's from multiple sources) - meaning no more over or under fetching of data.

An Example

The best way to help illustrate an example GraphQL and its difference between a traditional REST API is to watch this 30-second clip from the folks over at Shopify!

Benefits of GraphQL

  • Designed to make APIs fast, flexible, and developer-friendly.
  • Makes it easier to evolve APIs over time, and enables powerful developer tools.
  • GraphQL queries always return predictable results.
  • Sites & Apps using GraphQL are fast and stable because they control the data they get, not the server.
  • Query content from multiple sources in a single request
  • Much more!

GraphQL Limitations

Currently, you can use our GraphQL API to fetch the Content Models (Content Items or Content Lists) from your Instance in Agility.

Using GraphQL to fetch Pages, Page Template, or Page Modules is currently not supported, but we do intend on implementing this in the future.

Explore the GraphQL Playground

Explore the GraphQL Playground for yourself in your Agility CMS Instance, check out this article to learn how you can get started today!

7 out of 7 found this helpful

Comments

0 comments

Please sign in to leave a comment.