Skip to content
Get started

Announcement

One list, four content types

Shapio 0.6.0 adds interfaces: a contract of fields that unrelated types promise to have. One relation on the shapio.dev homepage now holds a blog post, a comparison, a roadmap item, and another post, and one route lists them all.

The Featured band on the shapio.dev homepage: four cards in a row, a blog post about subtypes, the Shapio vs Strapi comparison, the Interfaces roadmap item, and a blog post about webhook signatures, each with a type chip, a title, and a summary

Every homepage has a strip of three or four cards that someone picks by hand. On shapio.dev this week it's the post about subtypes, the Shapio vs Strapi comparison, the Interfaces roadmap item, and a post about webhook signatures. Three content types, four cards, one list.

In most headless CMSs that list is a problem. A relation field points at one content type. So you get a field per type (which fixes the layout), or a "card" component where someone retypes the title, the summary, and the link, which goes stale the day the post is renamed.

Shapio 0.6.0 adds interfaces, so one field can hold all four, and the site can render each card without knowing what type it is. It's the second half of something we started in 0.5.9, when a type could first extend another type. Together they make a content model that works the way a type system does, and I'll come back to why that matters at the end.

What an interface is

An interface is a contract: the fields every member must have. It stores nothing. A content type says which interfaces it implements, and Shapio checks that the type has every contract field, matched by API ID and type.

Here's Featurable, the interface behind shapio.dev's homepage, exactly as shapio schema pull writes it to interfaces/featurable.json:

{
  "apiKey": "featurable",
  "description": "Anything the homepage can feature: a title and a summary.",
  "display": {
    "defaultSort": {
      "direction": "asc",
      "fieldId": "311ac6f2-6f02-4028-aa6b-7ada9d7410da"
    },
    "titleFieldId": "311ac6f2-6f02-4028-aa6b-7ada9d7410da"
  },
  "fields": [
    {
      "apiKey": "title",
      "filterable": true,
      "id": "311ac6f2-6f02-4028-aa6b-7ada9d7410da",
      "label": "Title",
      "localized": false,
      "public": true,
      "required": true,
      "settings": {},
      "sortable": true,
      "type": "string",
      "unique": false
    },
    {
      "apiKey": "summary",
      "filterable": false,
      "id": "a0585365-ac3c-4a28-a1cd-19e05c8920e6",
      "label": "Summary",
      "localized": false,
      "public": true,
      "required": false,
      "settings": {},
      "sortable": false,
      "type": "text",
      "unique": false
    }
  ],
  "id": "06cc67d9-b714-40ac-9bf7-bf4bd41576fe",
  "kind": "interface",
  "label": "Featurable",
  "pluralApiKey": "featurables"
}

Two fields: a title and a summary. Every type that implements it must have both, with the same types and the same flags. title is required, public, filterable, and sortable on the contract, so it must be all four on every member.

Because fields match by API ID, we had one thing to fix first. Blog posts, comparisons, and pages called their summary standfirst, lede, and description, so we renamed all three to summary. A rename changes the API ID, not the data, so no post lost its summary.

A type implements an interface under Implements in the builder, or with one line in its file. The top-level keys of models/blogPost.json, with fields and display left out:

{
  "apiKey": "blogPost",
  "description": "A shapio.dev blog post (/blog/{slug}/): a guide or an opinion piece, with a summary, a body, an optional cover, the frameworks it works with and related posts.",
  "draftAndPublish": true,
  "id": "46b3ffe2-13a9-4786-903b-29b5fb924107",
  "implements": [
    "06cc67d9-b714-40ac-9bf7-bf4bd41576fe"
  ],
  "kind": "collection",
  "label": "Blog post",
  "localized": false,
  "pluralApiKey": "blogPosts"
}

BlogPost, RoadmapItem, Comparison, and Page all implement Featurable. A kind inherits what its parent implements, so a type that extends BlogPost would be Featurable too without saying so. Single types can be members as well.

Nothing changes about storage. Each type keeps its own fields and its own field IDs. The interface only says which fields line up.

One list across four types

An interface gets a route of its own. GET /api/content/featurables lists every member's entries in one page. Here it is against our hub, with shapio.dev's delivery token:

curl -H "Authorization: Bearer $SHAPIO_DELIVERY_TOKEN" \
  "$SHAPIO_URL/api/content/featurables?sort=title&fields=title,summary"
{
  "data": [
    {
      "id": "761d3bc2-fc74-4cd2-8f2a-3204e1fd6e83",
      "__model": "roadmapItem",
      "__kinds": ["roadmapItem"],
      "locale": "en",
      "createdAt": "2026-10-05T01:22:35.000Z",
      "updatedAt": "2026-10-07T11:09:19.272Z",
      "publishedAt": "2026-10-07T11:09:19.272Z",
      "title": "A GraphQL schema per site",
      "summary": "The GraphQL endpoint answers with the requesting site's schema: its own content types plus the shared ones."
    },
    {
      "id": "61655d1e-edcc-46ba-b545-70c418249cb5",
      "__model": "roadmapItem",
      "__kinds": ["roadmapItem"],
      "locale": "en",
      "createdAt": "2026-10-05T01:22:24.246Z",
      "updatedAt": "2026-10-07T11:09:13.193Z",
      "publishedAt": "2026-10-07T11:09:13.193Z",
      "title": "A clearer entry editor",
      "summary": "Every document field shows its heading, an empty list shows an Add row, and the SEO group is always in the strip."
    },
    "… 23 more rows on this page: 18 roadmap items and five blog posts"
  ],
  "meta": {
    "locale": "en",
    "snapshot": 722,
    "pagination": { "page": 1, "pageSize": 25, "total": 84, "pageCount": 4 },
    "members": [
      { "apiKey": "page", "label": "Page", "routeKey": "pages" },
      { "apiKey": "roadmapItem", "label": "Roadmap item", "routeKey": "roadmapItems" },
      { "apiKey": "comparison", "label": "Comparison", "routeKey": "comparisons" },
      { "apiKey": "blogPost", "label": "Blog post", "routeKey": "blogPosts" }
    ]
  }
}

Every row says which type it is in __model, and without fields= each row comes back in its own type's full shape: a roadmap item carries its stage, a blog post its category. meta.members lists the member types your token may read, so a site can build a type filter without reading the schema.

The list filters, sorts, and searches on the contract fields. sort=title sorts across four types, each using its own index, because the contract said title is sortable on every member. A field that isn't in the contract can't be used here, since not every row has it.

A token that may read only blog posts gets only the blog posts, and meta.members shrinks to match. No type is ever shown to someone who can't read it.

The relation

The homepage has one field, featured, a relation to Featurable that holds up to four entries. It accepts an entry of any member, and the picker in the admin searches across all of them, with a type filter.

Populated, each target comes back in its own shape. Here's the homepage with the four cards from the top of this post, trimmed to the fields a card needs:

curl -H "Authorization: Bearer $SHAPIO_DELIVERY_TOKEN" \
  "$SHAPIO_URL/api/content/shapioDevHome?populate=featured"
{
  "data": {
    "__model": "shapioDevHome",
    "heroTitle": "Shape your\ncontent.\nYour API\nfollows.",
    "…": "…",
    "featured": [
      { "__model": "blogPost", "title": "Your content has subtypes. Your CMS should too.", "slug": "your-content-has-subtypes", "category": "announcement", "…": "…" },
      { "__model": "comparison", "title": "Shapio vs Strapi", "slug": "strapi", "competitor": "Strapi", "…": "…" },
      { "__model": "roadmapItem", "title": "Interfaces", "stage": "shipped", "release": "0.6.0", "…": "…" },
      { "__model": "blogPost", "title": "A shared token isn’t a signature", "slug": "a-shared-token-isnt-a-signature", "category": "guide", "…": "…" }
    ]
  },
  "meta": { "locale": "en", "snapshot": 722 }
}

Rendering a card is a function of the two contract fields, plus __model for the link. This is the whole thing, with the same links shapio.dev uses, run with Node against our hub:

const headers = { Authorization: `Bearer ${process.env.SHAPIO_DELIVERY_TOKEN}` };
const url = `${process.env.SHAPIO_URL}/api/content/shapioDevHome?populate=featured`;
const home = await fetch(url, { headers }).then((r) => r.json());

const href = {
  blogPost: (e) => `/blog/${e.slug}/`,
  comparison: (e) => `/compare/${e.slug}/`,
  page: (e) => `/${e.slug}/`,
  roadmapItem: () => '/roadmap/',
};

for (const entry of home.data.featured) {
  console.log({ title: entry.title, summary: entry.summary, href: href[entry.__model](entry) });
}
{
  title: 'Your content has subtypes. Your CMS should too.',
  summary: "Shapio 0.5.9 adds polymorphic content types. A content type can extend another, and its kinds inherit the parent's fields, live in one list with it, and can be pointed at, granted, and changed as a family.",
  href: '/blog/your-content-has-subtypes/'
}
{
  title: 'Shapio vs Strapi',
  summary: 'Shapio and Strapi are both open-source, self-hosted headless CMSs with REST and GraphQL. The difference is how the content model changes, and how a site ships.',
  href: '/compare/strapi/'
}
{
  title: 'Interfaces',
  summary: 'A type can implement any number of interfaces, and a relation can point at an interface or at any entry. The Featured band on this site’s homepage holds a blog post, a comparison, and a roadmap item, even though they share no parent.',
  href: '/roadmap/'
}
{
  title: 'A shared token isn’t a signature',
  summary: 'Every Shapio webhook is signed, so your receiver can tell a real request from a forged, changed, or replayed one. Strapi sends a fixed token instead. Here’s the difference, with a real receiver and real attacks.',
  href: '/blog/a-shared-token-isnt-a-signature/'
}

Rename the blog post and the card updates. Add a fifth type to the strip next month, and the only change is one more line in href.

A relation can also point at any entry. No contract, any collection or single type on the site. It's for the cases where you really do mean anything: an audit record's subject, a comment's parent.

Not just websites

A homepage strip is the easy case. The same shape shows up anywhere unrelated things need to be handled as one.

Take a game that keeps its items in Shapio. Weapons, armor, and potions are different types with different fields: a weapon has damage, armor has defense, a potion has an effect. What they share is what the inventory needs: a name, an icon, and a weight. So:

{
  "apiKey": "carryable",
  "display": {
    "defaultSort": {
      "direction": "asc",
      "fieldId": "4ca85bdd-5547-478a-9805-54523ea4b3cc"
    },
    "titleFieldId": "0b3ef7e0-8b71-4195-95c8-529fc377868e"
  },
  "fields": [
    {
      "apiKey": "name",
      "filterable": true,
      "id": "0b3ef7e0-8b71-4195-95c8-529fc377868e",
      "label": "Name",
      "localized": false,
      "public": true,
      "required": true,
      "settings": {},
      "sortable": true,
      "type": "string",
      "unique": false
    },
    {
      "apiKey": "icon",
      "filterable": false,
      "id": "78449d75-bba4-4029-9372-f72a3adfbdc6",
      "label": "Icon",
      "localized": false,
      "public": true,
      "required": false,
      "settings": {
        "multiple": false
      },
      "sortable": false,
      "type": "media",
      "unique": false
    },
    {
      "apiKey": "weight",
      "filterable": true,
      "id": "4ca85bdd-5547-478a-9805-54523ea4b3cc",
      "label": "Weight",
      "localized": false,
      "public": true,
      "required": true,
      "settings": {},
      "sortable": true,
      "type": "integer",
      "unique": false
    }
  ],
  "id": "9c6d1452-5e82-43ad-b868-2a416d5730a1",
  "kind": "interface",
  "label": "Carryable",
  "pluralApiKey": "carryables"
}

Weapon, Armor, and Potion implement it. A Character has inventory, a relation to Carryable, and the game client reads one list. Here it's trimmed to the two fields the inventory screen sorts by; without fields= each row carries its own damage, defense, or effect, and __model says which:

curl -g -H "Authorization: Bearer $SHAPIO_DELIVERY_TOKEN" \
  "$SHAPIO_URL/api/content/carryables?filters[weight][\$lte]=5&sort=weight&fields=name,weight"
{
  "data": [
    {
      "id": "80e456e4-5ec3-4f82-9ab3-d590e101a640",
      "__model": "potion",
      "__kinds": ["potion"],
      "locale": "en",
      "createdAt": "2026-10-22T15:40:41.483Z",
      "updatedAt": "2026-10-22T15:40:41.489Z",
      "publishedAt": "2026-10-22T15:40:41.489Z",
      "name": "Antidote",
      "weight": 1
    },
    {
      "id": "c065fda7-1393-4f2c-aa16-abc1b1fb1944",
      "__model": "weapon",
      "__kinds": ["weapon"],
      "locale": "en",
      "createdAt": "2026-10-22T15:40:41.365Z",
      "updatedAt": "2026-10-22T15:40:41.381Z",
      "publishedAt": "2026-10-22T15:40:41.381Z",
      "name": "Dagger",
      "weight": 1
    },
    {
      "id": "cfe723bd-cf80-4246-b849-f72029060405",
      "__model": "potion",
      "__kinds": ["potion"],
      "locale": "en",
      "createdAt": "2026-10-22T15:40:41.470Z",
      "updatedAt": "2026-10-22T15:40:41.477Z",
      "publishedAt": "2026-10-22T15:40:41.477Z",
      "name": "Healing draught",
      "weight": 1
    },
    "… three more rows"
  ],
  "meta": {
    "locale": "en",
    "snapshot": 18,
    "pagination": { "page": 1, "pageSize": 25, "total": 6, "pageCount": 1 },
    "members": [
      { "apiKey": "armor", "label": "Armor", "routeKey": "armors" },
      { "apiKey": "weapon", "label": "Weapon", "routeKey": "weapons" },
      { "apiKey": "potion", "label": "Potion", "routeKey": "potions" }
    ]
  }
}

That query is "everything light enough to pick up," across three types, because the contract made weight filterable and sortable on all of them. Add a fourth item type next season, mark it Carryable, and every inventory, shop, and loot table that points at Carryable accepts it, and lists it, the same day.

An app's API works the same way. An activity feed holds orders, messages, and reminders; a Notifiable interface with a title, a body, and a deep link gives the feed one relation and the mobile client one card component. Any entry that implements it can be listed, opened, and turned into a notification the same way, and the types stay free to carry their own fields underneath.

GraphQL

A Shapio interface is a GraphQL interface. Featurable has the contract fields; a fragment gets you a member's own fields:

{
  featurables(sort: [{ title: ASC }], pageSize: 6) {
    totalCount
    nodes {
      __typename
      title
      ... on RoadmapItem {
        stage
      }
      ... on BlogPost {
        category
      }
    }
  }
}
{
  "data": {
    "featurables": {
      "totalCount": 84,
      "nodes": [
        {
          "__typename": "RoadmapItem",
          "title": "A GraphQL schema per site",
          "stage": "shipped"
        },
        {
          "__typename": "RoadmapItem",
          "title": "A clearer entry editor",
          "stage": "shipped"
        },
        {
          "__typename": "RoadmapItem",
          "title": "A new brand",
          "stage": "shipped"
        },
        {
          "__typename": "BlogPost",
          "title": "A product is not a blog post",
          "category": "announcement"
        },
        {
          "__typename": "BlogPost",
          "title": "A shared token isn’t a signature",
          "category": "guide"
        },
        {
          "__typename": "RoadmapItem",
          "title": "API tokens show when they expire",
          "stage": "shipped"
        }
      ]
    }
  }
}

Every schema now has an interface called Entry with the system fields, which every type implements. A relation to any entry returns it.

What Shapio enforces

An interface is only useful if it's true. So:

  • Breaking a contract is refused. Rename, retype, or delete title on BlogPost while it implements Featurable, and the builder refuses on the field, naming the interface. Drop Implements first, or keep the field.

  • Adding to a contract offers the fix. Add a rating field to Featurable while no member has one, and the review lists the four types that lack it and offers to add the field to all of them in one change set. Nothing applies until every member complies.

  • Leaving an interface can't strand a relation. Remove Featurable from RoadmapItem while the homepage still features one, and the change is refused with the count. Remove the reference, then the type.

  • Widening a relation keeps its values. Change a relation from pointing at BlogPost to pointing at Featurable, and every existing value is still valid, so they stay (it's still a breaking change you acknowledge, because the field's type changes for API clients). Narrowing it back clears them, with the usual destructive acknowledgement.

All of this runs live, like every schema change in Shapio. No rebuild, no restart.

Extends, implements, composed of

Step back and the shape is familiar. Since 0.5.9 a type can extend one parent: a kind inherits its parent's fields, keeps the parent's field IDs, and shows up in the parent's list next to it. Since 0.6.0 a type can implement any number of interfaces: BlogPost, RoadmapItem, Comparison, and Page are all Featurable without sharing a parent. And since the beginning a type is composed of components and dynamic zones. One parent, many interfaces, composition. That is the object model of every mainstream programming language, applied to content, and each piece shows up the same way everywhere: REST, GraphQL, the generated TypeScript, the schema files, and the admin.

That is new for a headless CMS. Contentful lets a reference accept several content types (linkContentType), Sanity lets a reference list several to types, and Hygraph has union fields. All three solve the picker. None of them makes the types promise anything, so the site still has to know every type to render a card, and none of them has a type extend another. Strapi's builder gives a relation one target type; its data layer has polymorphic relations, but Strapi marks them non-configurable to keep them out of the admin.

The older, code-first CMSs did have this. Sitecore has base templates, Optimizely's content types are C# classes that inherit from a base class, and Umbraco has compositions. They have it because their content models are code, and that is also why changing one means a build and a deploy. Shapio's models are data. Add an interface, make a type implement it, point a relation at it, and the API changes while the server runs. Nobody has had inheritance and interfaces that way before.

Interfaces are in 0.6.0. The changelog has the details, and Modeling has the rules.