Custom Content Management API development
Overview of custom CMA development
For stable production functionality, it typically makes more sense to build a custom Content Management endpoint via code, rather than entirely through editorial configuration. An endpoint class can ensure that a fixed set of APIs are exposed with configuration that should not change between different environments.
Implementing custom CMAs
Create a new Java class extending ContentManagementApiEndpoint.Implement required methods:
getPathSuffix—appended to/graphql/management/to create the path where the API endpoint is available.getEntryFields—objects wrapping Dari record types used to generate the schema and expose APIs.
Example:
showLineNumbers
1public class FooContentManagementApiEndpoint extends ContentManagementApiEndpoint {23@Override4protected String getPathSuffix() {5return "foo"; // API endpoint is available at path '/graphql/management/foo'6}78@Override9public List<ContentManagementEntryPointField> getEntryFields() {10return Arrays.asList(11new ContentManagementEntryPointField(Foo.class, true),12new ContentManagementEntryPointField(Bar.class, true));13}14}