mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
refactored resolvers, cleaned
This commit is contained in:
@@ -1,40 +1,23 @@
|
||||
const Subscription = {
|
||||
commentAdded(comment) {
|
||||
return comment;
|
||||
},
|
||||
commentEdited(comment) {
|
||||
return comment;
|
||||
},
|
||||
commentAccepted(comment) {
|
||||
return comment;
|
||||
},
|
||||
commentRejected(comment) {
|
||||
return comment;
|
||||
},
|
||||
commentReset(comment) {
|
||||
return comment;
|
||||
},
|
||||
commentFlagged(comment) {
|
||||
return comment;
|
||||
},
|
||||
userBanned(user) {
|
||||
return user;
|
||||
},
|
||||
userSuspended(user) {
|
||||
return user;
|
||||
},
|
||||
usernameApproved(user) {
|
||||
return user;
|
||||
},
|
||||
usernameRejected(user) {
|
||||
return user;
|
||||
},
|
||||
usernameFlagged(user) {
|
||||
return user;
|
||||
},
|
||||
usernameChanged(payload) {
|
||||
return payload;
|
||||
},
|
||||
};
|
||||
const Subscription = {};
|
||||
|
||||
// All of the subscription endpoints need to have an object to serialize when
|
||||
// pushing out via PubSub, this simply ensures that all these entries will
|
||||
// return the root object from the subscription to the PubSub framework.
|
||||
[
|
||||
'commentAdded',
|
||||
'commentEdited',
|
||||
'commentAccepted',
|
||||
'commentRejected',
|
||||
'commentReset',
|
||||
'commentFlagged',
|
||||
'userBanned',
|
||||
'userSuspended',
|
||||
'usernameApproved',
|
||||
'usernameRejected',
|
||||
'usernameFlagged',
|
||||
'usernameChanged',
|
||||
].forEach(field => {
|
||||
Subscription[field] = obj => obj;
|
||||
});
|
||||
|
||||
module.exports = Subscription;
|
||||
|
||||
Reference in New Issue
Block a user