Query examples
Query examplesPages

Pages

These are examples of queries to fetch page data.

Fetching pages

A single page:

query {
  page(by: { id: 2 }) {
    id
    title
    content
    url
    date
  }
}

A list of pages:

query {
  pages(pagination: { limit: 5 }) {
    id
    title
    excerpt
    url
    dateStr(format: "d/m/Y")
  }
}

Top-level pages with their children:

query {
  pages(filter: { parentID: 0 }) {
    ...PageProps
    children {
      ...PageProps
      children(pagination: { limit: 3 }) {
        ...PageProps
      }
    }
  }
}
 
fragment PageProps on Page {
  id
  title
  date
  urlAbsolutePath
}
Prev
Next