Skip to content

Use GraphQL to submit changes in the Static Site Editor

Enrique Alcántara requested to merge 216186-submit-changes-resolver into master

What does this MR do?

This MR replaces Vuex actions with a VueApollo mutation to submit changes in the Static Site Editor. It effectively removes Vuex from the Static Site Editor. GitLab’s GraphQL API does not support the operations required to submit changes in the Static Site Editor like creating branches or committing. To circumvent this blocker, we’ve created an Apollo client-side resolver that uses the same REST API used by Vuex behind the scenes.

Context

I’ve changed my strategy to ship submitting changes using GraphQL and VueApollo. My initial intention was creating four client-side resolvers:

  • Create branch
  • Commit
  • Create Merge Request
  • Submit content changes that would call the previous three.

I realized that creating the first three resolvers is a waste of time because we will eventually remove that code to use actual GraphQL APIs implemented in the backend. Rather than spending time on writing temporary code, I just implemented the submit content changes resolver that uses the underlying REST-based API.

This MR is part of the effort to adopt GraphQL in the Static Site Editor. You can see more details of the frontend efforts at #216186 (closed).

To understand the whole effort, see &3183 (closed)

Edited by Enrique Alcántara

Merge request reports