ezplatform icon indicating copy to clipboard operation
ezplatform copied to clipboard

[Platform.sh] Inline document support for GraphQL

Open janit opened this issue 5 years ago • 4 comments

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 prodenv mode. In fact, because of the --no-dev flag used for composer, the GraphiQL package will not work even in devenv.

janit avatar Apr 11 '19 08:04 janit

@bdunogier Maybe you can take over on this? @janit is on mission, and me and @vidarl is on easter holliday.

andrerom avatar Apr 17 '19 07:04 andrerom

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

andrerom avatar Apr 17 '19 10:04 andrerom

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.

bdunogier avatar Apr 17 '19 10:04 bdunogier

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.

bdunogier avatar Sep 30 '19 12:09 bdunogier