Documentation Center

Connector for Contentful usage in Content Delivery

With the Tridion Connector for Contentful, Content Delivery's open GraphQL interface is capable of retrieving Contentful assets and textual content.

Deployment to the Content Service

You can deploy the connector into the Content Service using the standard extension mechanism provided by the Add-ons Service. The deployment process registers into the GraphQL engine any additional GraphQL capabilities and data types that will be needed to support content from Contentful.

GraphQL requests

This connector supports the following GraphQL requests:
  • externalItem - use to get a single Contentful content item or an asset item
  • externalItems - use to search for or list a set of Contentful content items or assets

Entity types

This connector exposes the following Contentful entity types:
  • ContentfulContent - a Contentful content item
  • ContentfulAsset - a Contentful media asset (such as an image or document)
  • ContentfulSpace - a root folder type that corresponds to a Contentful space
  • ContentfulStatus - a folder type for different statuses (such as Published and Unpublished)
  • ContentfulArticle - a folder type to group a number of content items and assets (optional)

The order for the three folder types is as follows: ContentfulSpace > ContentfulStatus > ContentfulArticle

Example request

The following sample code illustrates getting Contentful data:

{
  externalItem(
    identity: {
      namespace: "contentful", 
      type: "ContentfulContent", 
      id: "1toEOumnkEksWakieoeC6M_Content_dzb4osfv82yc"
    }) {
    ... on ContentfulContent {
      title
      htmlFragment
      contentFields {
        name
        value
        type
      }
    }
  }
}

For more examples, refer to the GraphQL reference section.