close

Filter

loading table of contents...

Headless Server Developer Manual / Version 2406.1

Table Of Contents

4.10.4 Site Query

To query a specific site, issue a query containing the content/site field, either with the root segment of the associated homepage or with the site ID as a parameter (for example, ID of the Corporate home page, "abffe57734feeee"). You will find the site ID in the Site Indicator content of the site:

Note

Note

The former argument 'id' is deprecated as of version 2004 in favor of the more specific argument name 'siteId'. The argument 'id' may still be used, but will be removed in future versions!

query SiteQuery($id: String!) {
  content {
    site(siteId: $id) {
      name
      id
      root {
        ...Reference
        ...Navigation
      }
      crops {
        name
        aspectRatio {
          width
          height
        }
        sizes {
          width
          height
        }
      }
    }
  }
}

fragment ContentInfo on Content_ {
  name
  creationDate
}

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

fragment NavigationEntry on CMLinkable {
  ...Reference
  title
}

fragment Navigation on CMNavigation {
  ...NavigationEntry
  ... on CMNavigation {
    children {
      ...NavigationEntry
      ... on CMNavigation {
        children {
          ...NavigationEntry
          ... on CMNavigation {
            children {
              ...NavigationEntry
              ... on CMNavigation {
                children {
                  ...NavigationEntry
                }
              }
            }
          }
        }
      }
    }
  }
}
}

Alternatively you may query a site using the root segment parameter instead (example shortened):

query SiteQueryByRootSegment($rootSegment: String!) {
  content {
    site(rootSegment: $rootSegment) {
      name
      id
      locale
    }
  }
}

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

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