close

Filter

loading table of contents...

Headless Server Developer Manual / Version 2512.0

Table Of Contents

4.11.1 Default name convention

If the GraphQL interface name matches the CMS content type name exactly, the default resolver automatically resolves content of that type to the GraphQL object type whose name is the interface name with an Impl suffix appended. If no such GraphQL type is found, it walks up the CMS content type parent hierarchy until a matching GraphQL *Impl type is found.

To add a custom GraphQL type and interface that maps to the content type CustomArticle, add the following to the GraphQL schema:

interface CustomArticle @inherit(from: ["CMTeasable"]) {
  text: String
}

type CustomArticleImpl implements CustomArticle @inherit(from: ["CMTeasableImpl"]) {
  text: String @fetch(from: "text")
}

The built-in contentTypeNameResolver resolves content of type CustomArticle to __typename: "CustomArticleImpl".

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.