Skip to content

Conversation

@rdig
Copy link
Member

@rdig rdig commented Dec 1, 2020

This is a simple PR that adds to the current Events system a new context type, TransactionMessageEvent which will be used to add comments on the various transactions in the dApp.

Changes

  • Added sendTransactionMessage mongo api
  • Added getTransactionMessages mongo data source
  • Added sendTransactionMessage mutation resolver
  • Added transactionMessages query resolver
  • Added in, an generated the various types needed for this

Query

fragment EventFields on Event {
  createdAt
  initiator {
    id
    profile {
      avatarHash
      displayName
      username
      walletAddress
    }
  }
  initiatorAddress
  sourceId
  sourceType
  type
}

fragment EventContext on Event {
    context {
    ... on TransactionMessageEvent {
      type
      transactionHash
      message
      colonyAddress
    }
  }
}

fragment TransactionMessage on Event {
  ...EventFields
  ...EventContext
}

query TransactionMessages($transactionHash: String!) {
  transactionMessages(transactionHash: $transactionHash) {
    transactionHash
    messages {
    	...TransactionMessage
    }
  }
}

Having the following query variables:

{
  "transactionHash": "0x123"
}

Mutation

mutation SendTransactionMessage($input: SendTransactionMessageInput!) {
  sendTransactionMessage(input: $input)
}

Having the following mutation input:

{
  "input": {
    "transactionHash": "0x123",
    "message": "Hello World!",
    "colonyAddress": "0x123"
  }
}

@rdig rdig self-assigned this Dec 1, 2020
transactionHash: String!
message: String!
colonyAddress: String!
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be sure, we're not missing here person which added comment?

transactionHash: String!
message: String!
colonyAddress: String!
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we also need to return person which added comment and time when this person added comment

@rdig rdig merged commit 16fb118 into master Dec 2, 2020
@rdig rdig deleted the feature/actions-page-comment-system branch December 2, 2020 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants