ezplatform
ezplatform copied to clipboard
[Platform.sh] Inline document support for GraphQL
eZ Platform v2.5 supports GraphQL by default. To enable support also on eZ Platform Cloud / Platform.sh the following changes are needed:
- Add mount:
app/config/graphql
- Add automatic execution of schema generation:
php bin/console ezplatform:graphql:generate-schema
Note that this will NOT enable the commonly used GraphiQL client in prod
env mode. In fact, because of the --no-dev
flag used for composer, the GraphiQL package will not work even in dev
env.
@bdunogier Maybe you can take over on this? @janit is on mission, and me and @vidarl is on easter holliday.
Thanks @bdunogier , from what I can gather then we should not adapt platform.sh config like this, but rather start to check in the schema file on ezplatform-demo
and ezplatform-ee-demo
, and make sure it is updated whenever there are content type changes in demo data (?)
/cc @damianz5 & @SylvainGuittard
As for demo, @andrerom, if we consider it as a standard project (e.g. not the headless case where you never touch the config / templates), then yes, it is what we should do.
we should not adapt platform.sh config like this, but rather start to check in the schema file on ezplatform-demo and ezplatform-ee-demo, and make sure it is updated whenever there are content type changes in demo data (?)
This would be a good option for the time being. There is a drawback though: it implies that we version the schema files, meaning that they would show up as modified when the script is executed. Alternatively, we could make that step part of the installer, and copy the schema files to the schema directory on install. As a bonus, we would be sure that the schema matches the install type, since it would come with it.
A short-term alternative is to make the schema files writable in var
. It requires a few changes to the extension code, but it would work, I think.
The long-term solution is to make the GraphQL schema fully dynamic (e.g. updated whenever content types / config is modified). (Much) more complex.