Commit f6910cf3 authored by Phil Hughes's avatar Phil Hughes

Merge branch...

Merge branch '36653-remove-leftover-local-resolver-for-design-management-graphql-client' into 'master'

Resolve "Remove leftover local resolver for Design management GraphQL client"

See merge request gitlab-org/gitlab!20463
parents 1cd16360 a96bb845
...@@ -3,43 +3,11 @@ import VueApollo from 'vue-apollo'; ...@@ -3,43 +3,11 @@ import VueApollo from 'vue-apollo';
import _ from 'underscore'; import _ from 'underscore';
import { defaultDataIdFromObject } from 'apollo-cache-inmemory'; import { defaultDataIdFromObject } from 'apollo-cache-inmemory';
import createDefaultClient from '~/lib/graphql'; import createDefaultClient from '~/lib/graphql';
import createFlash from '~/flash';
import { s__ } from '~/locale';
import appDataQuery from './graphql/queries/appData.query.graphql';
import projectQuery from './graphql/queries/project.query.graphql';
const genericErrorMessage = s__(
'DesignManagement|An error occurred while loading designs. Please try again.',
);
Vue.use(VueApollo); Vue.use(VueApollo);
const defaultClient = createDefaultClient( const defaultClient = createDefaultClient(
{ {},
Query: {
design(ctx, { id, version }, { cache, client }) {
const { projectPath, issueIid } = cache.readQuery({ query: appDataQuery });
return client
.query({
query: projectQuery,
variables: {
fullPath: projectPath,
iid: issueIid,
atVersion: version,
},
})
.then(({ data }) => {
const edge = data.project.issue.designCollection.designs.edges.find(
({ node }) => node.filename === id,
);
return edge.node;
})
.catch(() => {
createFlash(genericErrorMessage);
});
},
},
},
// This config is added temporarily to resolve an issue with duplicate design IDs. // This config is added temporarily to resolve an issue with duplicate design IDs.
// Should be removed as soon as https://gitlab.com/gitlab-org/gitlab/issues/13495 is resolved // Should be removed as soon as https://gitlab.com/gitlab-org/gitlab/issues/13495 is resolved
{ {
......
...@@ -5758,9 +5758,6 @@ msgstr "" ...@@ -5758,9 +5758,6 @@ msgstr ""
msgid "DesignManagement|Adding a design with the same filename replaces the file in a new version." msgid "DesignManagement|Adding a design with the same filename replaces the file in a new version."
msgstr "" msgstr ""
msgid "DesignManagement|An error occurred while loading designs. Please try again."
msgstr ""
msgid "DesignManagement|Are you sure you want to delete the selected designs?" msgid "DesignManagement|Are you sure you want to delete the selected designs?"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment