mirror of
https://github.com/vale981/Vulcan
synced 2025-03-12 13:36:37 -04:00
18 lines
399 B
JavaScript
18 lines
399 B
JavaScript
/*
|
|
|
|
GraphQL config
|
|
|
|
*/
|
|
|
|
import { addGraphQLMutation, addGraphQLResolvers } from 'meteor/vulcan:core';
|
|
|
|
const specificResolvers = {
|
|
Mutation: {
|
|
increasePostViewCount(root, { postId }, context) {
|
|
return context.Posts.update({_id: postId}, { $inc: { viewCount: 1 }});
|
|
}
|
|
}
|
|
};
|
|
|
|
addGraphQLResolvers(specificResolvers);
|
|
addGraphQLMutation('increasePostViewCount(postId: String): Float');
|