Giter Club home page Giter Club logo

headless's Introduction

Headless API for Neos CMS

Description

This package is highly experimental, don't use it at home.

Lots of inspiration and foundation taken from from Wwwision.Neos.GraphQL and the API took a lots of inspiration from the Simple API of GraphCMS.

Goals

The goal of the package is to create a Domain centric GraphQL API. The queries/mutations semantics are automatically generated from Node Types definitions and currently look like:

{
  NeosNeosNamespace {
    allShortcuts {
      id
      createdAt
      updatedAt
      title
      targetMode
      target
    }
  }
  NeosDemoNamespace {
    Chapter(identifier: "23f35ab0-0d82-21e7-0006-dd63c5b3dce8") {
      title
    }
    allChapters {
      id
      title
      chapterDescription
    }
    allHomepages {
      title
      layout
      subpageLayout
    }
  }
}

System Property

  • id: the node identifier
  • createdAt: node creation time
  • updatedAt: node last modification time

Roadmap

The initial goal is to have a read only API, the next step will to add mutation support.

1.0

  • Automatic query generation based on the node configuration
  • Image support
  • Asset(s) support
  • Reference(s) support
  • Pagination support
  • Content Collection support
  • More advanced API, like a good support for Facebook Relay

1.2

  • Management of Permanent Auth Token to access to API
  • An API to register custom query generation per node type

2.0

  • Intelligent cache layer with auto flushing
  • Automatic mutations generation based on the node configuration
  • An API to register custom query not directly attached to a node type

3.0

  • Mutation support with fine grained access permissions (CRUD configuration per node type and per property)

Examples

By example if you use the Neos CMS demo site. This package include a Chapter node type.

So a query to get a specific chapter should look like this:

{
  Chapter(identifier: "6db34628-60c7-4c9a-f6dd-54742816039e") {
    title
    description
    createdAt
    
    # Get all the content of the given collection, recursively
    _collection(path: "main", baseType: "Neos.Neos:Content") {
      _type
      title
      text
    }
    
    # Single image from the node property "image"
    image {
      fileName
      url
      mimeType
      size
    }
    
    # One or more images from the node property "gallery"
    gallery {
      fileName
      url
      mimeType
      size
    }
  }
}

To get all chapters:

{
  allChapters(limit: 20) {
    title
    description
    createdAt
    
    # Get all the content of the given collection, recursively
    _collection(path: "main", baseType: "Neos.Neos:Content") {
      _type
      title
      text
    }
    
    # Single image from the node property "image"
    image {
      fileName
      url
      mimeType
      size
    }
    
    # One or more images from the node property "gallery"
    gallery {
      fileName
      url
      mimeType
      size
    }
  }
}

Sponsors & Contributors

The development of this package is sponsored by ttree (https://ttree.ch).

headless's People

Contributors

dfeyer avatar

Watchers

James Cloos avatar Markus Günther avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.