Delivery API

Types

The Document and Category types and every field on them.

The delivery API returns two kinds of objects: documents and categories. Fields marked required are never null; the others can be, so check them before you use them.

Notes on content

html and markdown are always the published version of a document, even for drafts listed with includeDrafts.

Document#

Represents a document, which could be an article, blog post, or any written content.

Fields
idID!required
categoryCategory
coverImageCoverImage
excerptString
htmlString!required
isPublishedBoolean!required
markdownString!required
metaDescriptionString
metaTitleString
publishedAtString
slugString!required
subtitleString
titleString!required

Category#

Represents a category, which is a grouping of related documents.

Fields
idID!required
categoryCategory
descriptionString
nameString!required
slugString!required

CoverImage#

Fields
urlString!required

The full schema#

Point your GraphQL tooling, like a code generator or an editor plugin, at the schema below. It’s the exact schema the API serves. Try your queries in the GraphQL validator first.

schema.graphql
type Query {
category(id: ID!): Category
categories: [Category!]!
document(id: ID!): Document
documentBySlug(slug: String!): Document
documents(includeDrafts: Boolean, limit: Int, offset: Int): [Document!]!
documentsInCategory(categoryId: ID!, includeDrafts: Boolean, limit: Int, offset: Int): [Document!]!
}
type Document {
id: ID!
category: Category
coverImage: CoverImage
excerpt: String
html: String!
isPublished: Boolean!
markdown: String!
metaDescription: String
metaTitle: String
publishedAt: String
slug: String!
subtitle: String
title: String!
}
type Category {
id: ID!
category: Category
description: String
name: String!
slug: String!
}
type CoverImage {
url: String!
}