https://github.com/flowpack/neos-cr-graphql-distribution
Experimental distribution for setting up Neos CMS with GraphQL
https://github.com/flowpack/neos-cr-graphql-distribution
Last synced: 3 months ago
JSON representation
Experimental distribution for setting up Neos CMS with GraphQL
- Host: GitHub
- URL: https://github.com/flowpack/neos-cr-graphql-distribution
- Owner: Flowpack
- Created: 2019-10-15T10:37:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-15T11:40:28.000Z (over 6 years ago)
- Last Synced: 2025-03-13T02:34:44.971Z (about 1 year ago)
- Language: PHP
- Homepage:
- Size: 29.3 KB
- Stars: 3
- Watchers: 12
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Neos Content Repository Graphql Adapter
This is a prototype distribution to add a headless approach to the Neos ContentRepository
## Idea
Based on a discussion at the Vienna Sprint (14.10.2019) we agreed to kickstart a prototype
to add a headless option to the Neos ContentRepository. This should be achieved with GraphQL.
While providing only all basic types and queries the package should be easily extensible.
The Content Repository adapter should be able to read all available NodeTypes and create
a autogenerated sdl including GraphQL Types for all of your NodeTypes.
## Get started
1) Generate the missing schema:
```bash
./flow schemagenerator:generate
```
This command will output a types.grapqhl file at PROJECT_DIR/Data/SchemaGenerator.
Move this file to DistributionPackages/CustomApp/Resources/Private/GraphQL/schema.nodetypes.graphql
This step should be handled later via the console just like we do it with doctrine migrations.
2) Generate some node data
````bash
./flow fixtures:insert
````
Generate some random nodes and persist them.
3) Start the server:
```bash
./flow server:run
```
You should now be able to run GraphQL queries against the endpoint http://127.0.0.1:8081/graphql:
```graphql
query {
nodeByPath(path: "/dac9b396-35c9-4e85-b2f4-e2f89febeaa3"}) {
identifier
path
name
workspace {
name
title
}
context {
workspaceName
}
... on NeosContentRepositoryTestingText {
properties {
text
}
}
... on NeosContentRepositoryTestingHtml {
properties {source
}
}
}
}
```
## Packages included in this distribution
### Neos.CR.GraphQL
This package acts as an Adapter to the Neos ContentRepository. It will provide all base
resolver and type definitions for a Node, Context, Workspace etc.
It will also provide a SchemaGenerator that converts all available NodeTypes to a valid
GraphQL schema.
### Custom.App
This is a fake package that acts as the actually "Application". Later on the app has to
configure the GraphQL Endpoint.
## Missing Packages
### Neos.CR.GraphQL.Read
Provide some basic queries to fetch node data as well as some filter mechanism to scroll
through your result list
### Neos.CR.GraphQL.Write
Running mutations against the ContentRepository