Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1.06 KB

graphql-data-layer.md

File metadata and controls

39 lines (30 loc) · 1.06 KB

GraphQL Data Layer

LEO boasts a composable GraphQL data layer which can be reused with any scaffolding. That is to say, switching from React to Preact or Inferno won't make you rewrite that nice medium-style Blog Post content type with computed time-to-read metrics. The data layer consists of Content Types, post processing and querying.

It can be queried with any valid GraphQL client (such as Apollo or GraphiQL for development).

Content Types

Content Types are the fundamental units of data when working with LEO based sites. They are exposed through GraphQL schemas which yield introspection capabilities.

Post Processing

Local data can be post-processed to enable archives, category pages, and RSS Feeds.

Querying

Data

Data in LEO is exposed through a composable, extensible GraphQL Schema defining Content Types.

query BlogPostPage {
  post(slug: $slug) {
    attributes { title, date, timeToRead }
    body
  }
}