Use GraphQL protocol

Overview

GraphQL is a high-performance query language for working with RESTful API services. The GraphQL protocol is integrated with the existing user interface for managing web services in Sitefinity CMS backend. When creating a web service, you have to specify the protocol that this service uses.

Install the GraphQL NuGet package

GraphQL is not included in the default installation of Sitefinity CMS version 14.2. It is distributed as an optional package, which implements the integration. To enable and set up GraphQL, perform the following:

  1. Download Progress.Sitefinity.GraphQL NuGet package from Sitefinity CMS NuGet packages repository.
    The NuGet package is in prerelease state, so make sure that you filter by prerelease packages.
  2. Install the package in your Sitefinity CMS project.
  3. Build and run your project.

Create a GraphQL web service

You must create a new web service by following procedure Create a RESTful API service.
In Protocol dropdown box that lists the available protocol options, make sure to select GraphQL.
Once you are done with the procedure, you are navigated back to the Web services grid and a GraphQL link is displayed.

Browse the GraphQL web service

The GraphQL web services that are exposed through Sitefinity CMS, come with an introspection schema that allows third-party tools to integrate and browse the schema.
After creating a GraphQL service, you can browse the schema at (api/{urlofservice}/graphql) using third-party tools, such as:

  • GraphiQL explorer
  • Postman

For information, see GraphiQL explorer example on GitHub.
For information about using Postman, see Postman documentation » GraphQL overview.

NOTE: When using third-party tools that have a web interface, make sure to set the Allow access from other domains property of the web service (CORS). 

Limitations

The GraphQL protocol implementation in Sitefinity CMS only supports queries. The GraphQL web services are read-only and do not support mutations.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?