Get a document by the slug

Find a document by its slug.

Query

query($slug: String!) {
  documentBySlug(slug: $slug) {
    id

    category {
      id
      name
    }

    html
    isPublished
    markdown
    metaDescription
    metaTitle
    publishedAt
    slug
    subtitle
    title
  } 
}

Arguments

slug: String!

The slug of the document.

Example Response

{
  "data": {
    "documentBySlug": {
      "id": "a6bb3400def15d00249ec98c",
      "category": {
        "id": "36bb3280def15d00249ec97b",
        "name": "Reports"
      },
      "html": "<p>Lorem ipsum dolor sit amet.</p>\n",
      "isPublished": true,
      "markdown": "Lorem ipsum dolor sit amet.",
      "metaDescription": null,
      "metaTitle": null,
      "publishedAt": "2024-08-13T10:23:05.939Z",
      "slug": "the-2024-state-of-marketing-and-trends-report:-data-from-1400+-global-marketers",
      "subtitle": "Discover the trends, winning opportunities and challenges brands will face this year, with data from 1,400+ global B2B and B2C marketers.",
      "title": "The 2024 State of Marketing & Trends Report: Data from 1400+ Global Marketers"
    }
  }
}