Skip to content

Latest commit

 

History

History
123 lines (106 loc) · 2 KB

DocumentQueries.md

File metadata and controls

123 lines (106 loc) · 2 KB

Document Queries

Experimental + not feature complete! Subject to change without notice.

Supported Document types

  • Email
  • Hardlink
  • Link
  • Page
  • Snippet

Supported Page Element types

  • Checkbox
  • Date
  • Image
  • Input
  • Link
  • Multiselect
  • Numeric
  • Pdf
  • Relation
  • Relations
  • Select
  • Table
  • Textarea
  • Video
  • Wysiwyg
  • ...

Sample 1 (Link Document)

Get Link Document and resolve the target news text.

{
  getDocument(id: 76) {
    ... on document_link {
      fullpath
      object {
        ...on object_news {
          shortText
        }
      }      
    }
  }
}

Sample 2 (Page Document Elements)

  • get object 61
  • get manytoone relation
  • get target page document
  • get link tag
  • get referenced page document / or news object
  • get input elements of referenced page document / or shorttext of news object
{
  getTest3(id: 61) {
    manytoone {
      ... on document_page {
        fullpath
        elements {
          ... on document_tagLink {
            _tagType
            _tagName
            data {
              internal
              path
              target {
                __typename
                ... on document_page {
                  id
                  fullpath
                  elements {
                    ... on document_tagInput {
                      name
                      text
                    }
                  }
                }
                ... on object_news {
                  shortText
                }
              }
            }
          }
        }
      }
    }
  }
}

Sample 3 (Date Element Tag)

{
  getDocument(id: 25) {
    ... on document_page {
      fullpath
      elements {
        ...on document_tagDate {
          _tagName
          # unix timestamp
          timestamp
          # as formatted string
          formatted(format:"Y-m-d")
        }
      }      
    }
  }
}

Sample 4 (Document Properties)

see Element Properties