Welcome to mirror list, hosted at ThFree Co, Russian Federation.

submit_content_changes.js « resolvers « graphql « static_site_editor « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6c4e3a4d973a9776a6ca98da473a5da82c16d2b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import submitContentChanges from '../../services/submit_content_changes';
import savedContentMetaQuery from '../queries/saved_content_meta.query.graphql';

const submitContentChangesResolver = (
  _,
  { input: { project: projectId, username, sourcePath, content } },
  { cache },
) => {
  return submitContentChanges({ projectId, username, sourcePath, content }).then(
    savedContentMeta => {
      cache.writeQuery({
        query: savedContentMetaQuery,
        data: {
          savedContentMeta: {
            __typename: 'SavedContentMeta',
            ...savedContentMeta,
          },
        },
      });
    },
  );
};

export default submitContentChangesResolver;