Skip to content

Commit

Permalink
Includes memoirId in the memoir fragment query
Browse files Browse the repository at this point in the history
  • Loading branch information
n8e committed Feb 15, 2017
1 parent c02f81c commit 982bbbb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions data/mutations/UpdateMemoirMutation.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { mutationWithClientMutationId } from 'graphql-relay';

import MemoirType from '../types/MemoirType';

import { updateMemoir } from '../remote/api/createMemoir';
import { updateMemoir } from '../remote/api/updateMemoir';

const UpdateMemoirMutation = mutationWithClientMutationId({
name: 'UpdateMemoir',
Expand All @@ -18,7 +18,7 @@ const UpdateMemoirMutation = mutationWithClientMutationId({
resolve: ({ memoir }) => memoir,
}
},
mutateAndGetPayload: (_, args) => updateMemoir(args),
mutateAndGetPayload: (args) => updateMemoir(args),
});

export default UpdateMemoirMutation;
4 changes: 3 additions & 1 deletion js/mutations/UpdateMemoirMutation.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default class UpdateMemoirMutation extends Relay.Mutation {
fragment on UpdateMemoirPayload{
memoir {
id
memoirId
title
content
}
Expand All @@ -29,7 +30,7 @@ export default class UpdateMemoirMutation extends Relay.Mutation {
return [{
type: 'FIELDS_CHANGE',
fieldIDs: {
memoir: this.props.viewer.memoir.memoirId
memoir: this.props.viewer.memoir.id
},
}];
}
Expand All @@ -40,6 +41,7 @@ UpdateMemoirMutation.fragments = {
fragment on User {
memoir {
id
memoirId
title
content
}
Expand Down

0 comments on commit 982bbbb

Please sign in to comment.