GraphQL

Usage

Protocol.

GET /core/graphql?query=...

GET /res/graphql?query=...

POST /core/graphql

IDE

GET /core/graphiql

Schema

type Query {
    posts(filters: PostsFilters, slice: PostsSlice): [Post]
    authors(filters: AuthorsFilters, slice: AuthorsSlice): [Author]
}

input PostsFilters {
    includedIds: [Int]!
    includedStatuses: [PostStatus]!
}

enum PostStatus {
    PUBLISHED
}

input PostsSlice {
    order: PostsOrder
    limit: Int
    allowDuplicates: Boolean  # doesn't work yet
}

enum PostsOrder {
    RATING
    RECENCY
}

interface Particle {
    pages: PageMap
    title: String!
    subtitle: String!
    linkOut: LinkOut!
    image: Image!
    video: Video!
}

type Post implements Particle {
    id: Int
    content: ContentTree
    authors: [Author]
    primaryTags: [Tag]
    regularTags: [Tag]
    publishedAt: Int
}

input AuthorsSlice {
    order: AuthorsOrder
    limit: Int
}

enum AuthorsOrder {
    TITLE
    RATING
}

input AuthorsFilter {
    includedIds: [Int]!
}

type Author implements Particle {
    id: Int
}

type Tag {
    id: String
    slug: String
    pages: PageMap
    title: String
}

type ContentTree {
    rootRef: String
    tree: [ContentNode]
}

interface ContentNode {
    ref: String
    parentRef: String!
}

type GroupContentNode implements ContentNode {
    layout: ContentLayout
}

interface ContentLayout {
    kind: ContentLayoutKind
}

enum ContentLayoutKind {
    PLAIN
    LISTICLE
    SLIDESHOW
}

type PlainContentLayout implements ContentLayout {
}

type ListicleContentLayout implements ContentLayout {
    flags: [ListicleContentLayoutFlag]
    numeration: Numeration!
}

enum ListicleContentLayoutFlag {
    ECOMMERCE
    MULTICOLUMN
}

type SlideshowContentLayout implements ContentLayout {
    flags: [SlideshowContentLayoutFlag]
    numeration: Numeration!
}

enum SlideshowContentLayoutFlag {
    COUNTER
    PARALLAX
    FULLSCREEN
    THUMBNAILS
}

type Numeration {
    order: NumerationOrder
}

enum NumerationOrder {
    ASCENDING
    DESCENDING
}

type ParticleContentNode implements Particle, ContentNode {
    id: Int!
}

type MediaContentNode implements ContentNode {
    kind: MediaContentKind
    code: String
    html(device: Device): String
}

enum MediaContentKind {
    TEXT
    IMAGE
}

enum Device {
    AMP
}

type Video {
    href: String
}

type Image {
    id: Int
    crops(sizes: List[String]!): [ImageCrop]
    flags: [ImageFlag]
    title: String!
    credit: String!
    altText: String!
}

type ImageCrop {
    size: String
    href: String
}

type ImageFlag {
    ANIMATED
    GIF
}

type LinkOut {
    pages: PageMap
    target: String
}

type PageMap {
    web: Page
    amp: Page
}

type Page {
    href: String
}