Commit 45c907e1 authored by Fernando Arias's avatar Fernando Arias

Working corpus commit

* Add constant and ID utility function
parent d35eea3d
......@@ -15,3 +15,4 @@ export const TYPE_USER = 'User';
export const TYPE_VULNERABILITY = 'Vulnerability';
export const TYPE_NOTE = 'Note';
export const TYPE_DISCUSSION = 'Discussion';
export const TYPE_PACKAGES_PACKAGE = 'Packages::Package';
......@@ -6,6 +6,8 @@ import getCorpusesQuery from '../queries/get_corpuses.query.graphql';
import updateProgress from '../mutations/update_progress.mutation.graphql';
import uploadComplete from '../mutations/upload_complete.mutation.graphql';
import corpusCreate from '../mutations/corpus_create.mutation.graphql';
import { convertToGraphQLId } from '~/graphql_shared/utils';
import { TYPE_PACKAGES_PACKAGE } from '~/graphql_shared/constants';
export default {
Query: {
......@@ -60,7 +62,7 @@ export default {
client.mutate({
mutation: corpusCreate,
variables: { fullPath: projectPath, packageId },
variables: {input:{ fullPath: projectPath, packageId: convertToGraphQLId(TYPE_PACKAGES_PACKAGE, packageId) }},
});
},
deleteCorpus: (_, { name, projectPath }, { cache }) => {
......
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