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- The unique identifier of the document.
categoryCategory- The category this document belongs to.
coverImageCoverImage- The cover image of the document.
excerptString- The excerpt of the document.
htmlString!required- The HTML content of the document.
isPublishedBoolean!required- Indicates if the document is published.
markdownString!required- The Markdown content of the document.
metaDescriptionString- A brief description of the document for SEO purposes.
metaTitleString- The title of the document for SEO purposes.
publishedAtString- The publication date of the document in ISO 8601 format.
slugString!required- The unique slug of the document, used in URLs.
subtitleString- The subtitle of the document, if any.
titleString!required- The title of the document.
Category#
Represents a category, which is a grouping of related documents.
Fields
idID!required- The unique identifier of the category.
categoryCategory- The parent category of this category, if any.
descriptionString- A brief description of the category.
nameString!required- The name of the category.
slugString!required- The unique slug of the category, used in URLs.
CoverImage#
Fields
urlString!required- The image’s URL.
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!): Categorycategories: [Category!]!document(id: ID!): DocumentdocumentBySlug(slug: String!): Documentdocuments(includeDrafts: Boolean, limit: Int, offset: Int): [Document!]!documentsInCategory(categoryId: ID!, includeDrafts: Boolean, limit: Int, offset: Int): [Document!]!}type Document {id: ID!category: CategorycoverImage: CoverImageexcerpt: Stringhtml: String!isPublished: Boolean!markdown: String!metaDescription: StringmetaTitle: StringpublishedAt: Stringslug: String!subtitle: Stringtitle: String!}type Category {id: ID!category: Categorydescription: Stringname: String!slug: String!}type CoverImage {url: String!}
Previous
Queries
Next
Pagination and drafts