Skip to content

Commit

Permalink
Fixed queries and resolvers
Browse files Browse the repository at this point in the history
  • Loading branch information
NataliaTepluhina committed Apr 30, 2019
1 parent fbcd37c commit 4abbf38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/graphql/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ export const checkItemMutation = gql`

export const addItemMutation = gql`
mutation($text: String!) {
addItem(text: $text) @client
addItem(text: $text) @client {
id
text
done
}
}
`;

Expand Down
2 changes: 1 addition & 1 deletion src/resolvers.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const resolvers = {
const currentItem = data.todoItems.find(item => item.id === id);
data.todoItems.splice(data.todoItems.indexOf(currentItem), 1);
cache.writeQuery({ query: todoItemsQuery, data });
return data.todoItems;
return true;
},
},
};

0 comments on commit 4abbf38

Please sign in to comment.