GraphQL Schema Extension
You can extend the default GraphQL Schema in order to enable querying of custom content originating from a third-party source. Extending the GraphQL Schema makes this content queryable. This type of Extension is typically developed alongside a Model Transformer Extension, which actually fetches and transforms the content from the third-party source.
A GraphQL Schema Extension is configured as follows in the
extensions array in your Add-on manifest file:
{
"type": "CDGraphQLSchemaExtension",
"name":"EXTENSIONNAME",
"supportedVersions":"11.6.0.0",
"properties": {
"entryPoint": "com.sdl.delivery.content.graphql.SchemaExtensionActivator",
"loadingPhase": "AFTER_APP_INITIALIZED",
"configurationSources": [
{
"name": "SCHEMAEXTENSIONCHANGE",
"type": "CHANGETYPE",
"properties": {
"typeClass": JAVACLASSNAME
}
},
...
],
"capabilities": ["ContentServiceCapability"]
}
}
where:
- EXTENSIONNAME is the unique name you want to give to this GraphQL Schema Extension
configurationSourcesis an array of changes to the GraphQL Schema- SCHEMAEXTENSIONCHANGE is the unique name you want to give to one change to the GraphQL Schema
- CHANGETYPE is the type of change, either
SchemaType(to indicate a change that adds XML to the Schema (that is, defines new elements or attributes) orExtensionType(to indicate a change that adds new elements to the GraphQL queries you can make) - JAVACLASSNAME is the fully qualified classname of your Java class that implements the change.