Headless Basics Query

This is an example GraphQL Query to the CaaS API of the CoreMedia Headless Server.

Learn more about the Headless CoreMedia Content-as-a-Service on our Website at https://www.coremedia.com/en/content-cloud/headless-plus-content-management

query PageQuery {
  content {
    pageByPath(path: "corporate") {
      __typename
      ...Reference
      title
      teaserTitle
      teaserText
      creationDate
      grid {
        cssClassName
        rows {
          placements {
            name
            viewtype
            items {
              ...Teasable
              ...ImageMap
              ... on CMCollection {
                viewtype
                items {
                  ...Teasable
                }
              }
            }
          }
        }
      }
    }
  }
}

fragment ContentInfo on Content_ {
  name
  creationDate
}

fragment Reference on CMLinkable {
  ...ContentInfo
  title
  segment
  link {
    id
    type
  }
}

fragment ImageMap on CMImageMap {
  displayTitle
  displayShortText
  displayPicture
  transformedHotZones {
    crops {
      name
      coords {
        x
        y
      }
    }
    points {
      x
      y
    }
    alt
    shape
    target
    displayAsInlineOverlay
    inlineOverlayTheme
    linkedContent {
      ...Reference
      ...QuickInfo
    }
  }
}

fragment Teasable on CMTeasable {
  ...Reference
  teaserTitle
  teaserText
  teaserTarget {
    ...Reference
  }
  teaserTargets {
    target {
      ...Reference
    }
    callToActionEnabled
    callToActionText
  }
  teaserOverlaySettings {
    style
    enabled
    positionX
    positionY
    width
  }
  picture {
    ...Picture
  }
  video {
    ...Video
  }
}

fragment QuickInfo on CMTeasable {
  ...Reference
  teaserTitle
  teaserText
  picture {
    ...Picture
  }
}

fragment Picture on CMPicture {
  ...ContentInfo
  title
  alt
  link {
    id
    type
  }
  uriTemplate
  base64Images {
    cropName
    base64
  }
}

fragment Video on CMVideo {
  ...ContentInfo
  title
  alt
  link {
    id
    type
  }
  data {
    uri
  }
  dataUrl
}

Post a comment

Comment

ABOUT THE AUTHOR

Sascha Leyer

Sascha Leyer

Sascha is a solution architect and has been with CoreMedia since 2013, supporting clients across Europe in using CoreMedia Content Cloud to its full potential. A techie at heart, he loves to dissect software to understand its inner workings. When not doing that, he is often on stage with his band, where he plays bass guitar and sings. He has a masters degree in computational engineering from the Technical University of Hamburg.

Anastasia Eckstedt 

Hi, my name is Anastasia Eckstedt.

Feel free to call me at +49.40.325587.209  
or send me an email to info@coremedia.com