-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPIKE Investigate making default location of .graphql-generated folder inside /tmp #465
Comments
That was our use case, generating on CI server and packaging it all up with composer dependencies installed and FE files compiled in a deployable package, so that the webserver can serve it right away. I would also add to the ACs to test it in multi-server environments where the temp folder may not be shared by the instances behind a load balancer whereas assets folder would be. |
Have added to ACs |
Looks like Installer then might add yml config that sets it to
EDIT: We've talked a bit about this on slack. The short version is that the above is okay if we're defaulting to putting the generated schema inside the |
The decision was made to leave this as-is in order to retain our release schedule. We will need to ensure our documentation clearly indicates that a change may be required for all projects which don't currently have a writable project root. |
Timebox: 2 days
Defaulting the .graphql-generated folder in the project root could be problem because this folder needs to be writable. Existing webservers may suddently break on upgrade if they are configured in a way that does not allow this folder to be created or be writable.
A safer/better alternative for the majority of use cases may be to default the .graphql-generated folder somewhere in /tmp (
TEMP_FOLDER
), possibly within the regular/tmp/silverstripe-cache-*
where other files such as template files converted to php files are storedThere may be some reasons for wanting to have the .graphql-generated folder in the project root, for instance if the schema is generated in CI/CD as part of a packaged deployment. So we would need the ability to configure if the folder is stored in /tmp or in the project root. There is already configuration available through
CodeGenerationStore.$dirName
to configure the name of the folder.Likely that there would only need to be minimal code changes in
CodeGenerationStore.php
madeACs
.graphql-generated
located the/tmp
folder is viable.4.0
(which is still pre-stable)Questions
PRs
The text was updated successfully, but these errors were encountered: