Import the Facebook GraphQL example data model to eZ Platform
eZ Platform being an application built on the full stack Symfony Framework, this applies to eZ developers as well. One of the things that eZ Platform adds on top of Symfony is obviously the feature complete content repository. Using this together with GraphQL will require some additional glue code, which we will need to take a look at in the future.
At this point we will start off with importing a partial data model describing the Star Wars universe widely used in the GraphQL examples. To import the created datamodel, first install the Kaliop Migrations Bundle and enable it.
Next up is cloning the bundle containing the exports: GraphQLStarwarsEzPlatformBundle
After enabling the bundle in your appkernel you can execute the migrations using the console:
php app/console kaliop:migration:update
Once this is done, then your eZ Platform installation will now contain the following content types with specified content structures:
- Droid
- ID (string)
- Name (string)
- Friends (object relations)
- Appears in (object relations)
- Primary function (string)
- Human
- ID (string)
- Name (string)
- Home planet (string)
- Friends (object relations)
- Appears in (object relations)
in addition there are some content objects as well:
- Droids
- Artoo
- Threepio
- Humans
- Luke Skywalker
- Darth Vader
- Han Solo
- Leia Organa
- Wilhuff Tarkin
This bundle does not expose a GraphQL interface to the created data, but just contains the data structure itself. This can be implemented in the future using the groundwork available for Symfony and GraphQL.