diff --git a/plugins/coral-plugin-respect/index.js b/plugins/coral-plugin-respect/index.js index a1f9a0c1c..140a19ddf 100644 --- a/plugins/coral-plugin-respect/index.js +++ b/plugins/coral-plugin-respect/index.js @@ -10,12 +10,22 @@ module.exports = { } }, hooks: { + Action: { + __resolveType: { + post({action_type}) { + switch (action_type) { + case 'RESPECT': + return 'RespectAction'; + } + } + } + }, ActionSummary: { __resolveType: { post({action_type}) { switch (action_type) { - case 'RESPECT': - return 'HappyActionSummary'; + case 'RESPECT': + return 'RespectActionSummary'; } } } diff --git a/plugins/coral-plugin-respect/server/typeDefs.js b/plugins/coral-plugin-respect/server/typeDefs.js index f7666debf..f13aa71ca 100644 --- a/plugins/coral-plugin-respect/server/typeDefs.js +++ b/plugins/coral-plugin-respect/server/typeDefs.js @@ -29,6 +29,15 @@ module.exports = ` # The time when the Action was created. created_at: Date } + + type RespectActionSummary implements ActionSummary { + + # The count of actions with this group. + count: Int + + # The current user's action. + current_user: RespectAction + } type CreateRespectResponse implements Response {