Documentation Center

Content Service extension to transform the Content Delivery data model

You can create an Extension to the Content Service that can transform custom data fetched from the Content Data Store. Using a GraphQL Schema Extension, you can then also query this custom content.

The custom data must be fetched using a data fetcher class, that is, one of the Java classes in the package com.sdl.delivery.content.model.core.datafetcher.

The fetched data can then be transformed by a transformation handler (Java class) that implements the com.sdl.delivery.content.model.core.datafetcher.transformer.ModelTransformer interface. In your transformer class, you specify which model class you want to transform. The model class must be an implementation of the com.sdl.delivery.content.data.ModelData interface.

When you have implemented the transformer class, you add it to an Add-on package (ZIP file) and configure the manifest file of the Add-on to turn it into a Data Model Transformer Extension.

If you want to query the data using a GraphQL query, you must additionally create a GraphQL Schema Extension to make the data queryable.