close

Filter

loading table of contents...

Headless Server Developer Manual / Version 2307

Table Of Contents

4.9 Building Links

In GraphQL, Objects may contain cross references (relations, "links") to other objects:

  • Typically, a special field holds some kind of identifier or ID of this object, and other objects refer to it with the value of this ID.

  • Another kind of reference is a hyperlink, for example the URL of some binary resource.

The CoreMedia Headless Server supports both types of references by a unified Link Composing API. This API is a generalization of the CAE link schemes and post processors (see Section 4.3.2.2, “Writing Link Schemes” in Content Application Developer Manual and Section 4.3.2.3, “Post Processing Links” in Content Application Developer Manual).

A LinkComposer is a PartialFunction from some domain object type to a resulting link type.

All link composers are partial functions: if they are not able to map an object to a proper link of the given target type, they return an empty Optional. If no configured link composer returns a non-empty Optional, the GraphQL query response will contain a null value for the link.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

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