From e4e7ff27d2db4292b2af11167850025bc3a89a9f Mon Sep 17 00:00:00 2001 From: David Jay Date: Thu, 16 Feb 2017 16:54:05 -0500 Subject: [PATCH] Adding don't agree action to typedefs. --- graph/typeDefs.graphql | 66 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 61 insertions(+), 5 deletions(-) diff --git a/graph/typeDefs.graphql b/graph/typeDefs.graphql index cabb50985..72696cd86 100644 --- a/graph/typeDefs.graphql +++ b/graph/typeDefs.graphql @@ -91,6 +91,9 @@ enum ACTION_TYPE { # Represents a FlagAction. FLAG + + # Represents a don't agree action + DONTAGREE } # CommentsQuery allows the ability to query comments by a specific methods. @@ -166,7 +169,7 @@ type Comment { ## Actions ################################################################################ -# An action rendered against a parent enity item. +# An action rendered against a parent entity item. interface Action { # The ID of the action. @@ -269,6 +272,28 @@ type FlagAction implements Action { created_at: Date } +# A DONTAGREE action that contains do not agree metadata. +type DontAgreeAction implements Action { + + # The ID of the DontAgree Action. + id: ID! + + # The reason for which the DontAgree Action was created. + reason: String + + # An optional message sent with the flagging action by the user. + message: String + + # The user who created the action. + user: User + + # The time when the DontAgree Action was updated. + updated_at: Date + + # The time when the DontAgree Action was created. + created_at: Date +} + # Summary for Flag Action with a a unique reason. type FlagActionSummary implements ActionSummary { @@ -484,7 +509,7 @@ type CreateLikeResponse implements Response { # The like that was created. like: LikeAction - # An array of errors relating to the mutation that occured. + # An array of errors relating to the mutation that occurred. errors: [UserError] } @@ -508,18 +533,46 @@ input CreateFlagInput { # was created. type CreateFlagResponse implements Response { - # The like that was created. + # The flag that was created. flag: FlagAction - # An array of errors relating to the mutation that occured. + # An array of errors relating to the mutation that occurred. errors: [UserError] } + +# CreateDontAgreeResponse is the response returned with possibly some errors +# relating to the creating the don't agree action attempt and possibly the don't agree that +# was created. +type CreateDontAgreeResponse implements Response { + + # The don't agree that was created. + dontagree: DontAgreeAction + + # An array of errors relating to the mutation that occurred. + errors: [UserError] +} + +input CreateDontAgreeInput { + + # The item's id for which we are to create a don't agree. + item_id: ID! + + # The type of the item for which we are to create the don't agree. + item_type: ACTION_ITEM_TYPE! + + # The reason for not agreeing with the item. + reason: String! + + # An optional message sent with the don't agree action by the user. + message: String +} + # DeleteActionResponse is the response returned with possibly some errors # relating to the delete action attempt. type DeleteActionResponse implements Response { - # An array of errors relating to the mutation that occured. + # An array of errors relating to the mutation that occurred. errors: [UserError] } @@ -551,6 +604,9 @@ type RootMutation { # Creates a flag on an entity. createFlag(flag: CreateFlagInput!): CreateFlagResponse + # Creates a don't agree action on an entity. + createDontAgree(dontagree: CreateDontAgreeInput!): CreateDontAgreeResponse + # Delete an action based on the action id. deleteAction(id: ID!): DeleteActionResponse