Create GraphQL mutations for pages settings
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
In order to move Pages Settings to vue we have to create a Graphql mutation for toggling the below two pages settings:
type Project {
pagesForceHttps: Boolean
pagesUseUniqueDomain: Boolean
}
Note: the mutations should return the updated project in order for Apollo to update the state in its cache, something like this:
mutation PagesForceHttps {
setPagesForceHTTPS(input: { id: "<PROJECT_ID>", value: true }) {
project {
id
pagesForceHttps
}
errors
}
}
Implementation guide
The current implementation is part of the update method in app/controllers/projects/pages_controller.rb (the project_params in praticular).
For each mutation there should be a new file in app/graphql/mutations/pages that implements the mutation. There is already one mutation in that folder (mark_onboarding_complete.rb) that is a good implementation example.
The mutation classes then need to be added to app/graphql/types/mutation_type.rb to make them available.
Lastly, there should be a unit test for each mutation in spec/graphql/mutations/pages/, again the mark_onboarding_complete_spec.rb can be a good implementation example.