CoreMedia Content Cloud v12 Upgrade Guide / Version 2404
Table Of ContentsIf you extend not only existing GraphQL types from the content schema but also the query root type itself, the binding between the HTTP transport tier and the schema must be implemented by a Spring controller class containing a method named like the new query root property. The method should deliver your original root object.
Example:
# GraphQL-Schema extension: extend type Query { customRoot: CustomRoot } type CustomRoot { types: [CustomType] } type CustomType { name: String } ------------------------ // Java class @Controller public class CustomRootController { private final CustomRoot customRoot; public CustomRootController (CustomRoot customRoot) { this.customRoot = customRoot; } @QueryMapping public CustomRoot customProperty() { return customRoot; } }