Outcomes

Retrieve outcomes' details

Get all Outcomes

The following fields can be queried to retrieve all outcomes data:

query {
  outcomes {
    UUID
    match {
      UUID
      createdAt
    }
    createdAt
    response {
      ... on MailResponse  {
        messageId
      }
      ... on WebhookResponse {
        httpCode
        body
      }
      ... on ErrorResponse {
        error
      }
    }
    payload {
      ... on MailPayload {
        to
        subject
        body
      }
      ... on EventsTriggerWebhookPayload {
        decoded {
          method {
            name
          }
          arguments
        }
        log {
          address
        data
          topics
        }
        block {
          number
          hash
          timestamp
        }
        transaction {
          hash
        }
      }
      ... on ContractsTriggerWebhookPayload {
        contract {
          address
        }
        method{
          name
        }
        returnedValues {
          matched
          all
        }
        block {
          number
          hash
          timestamp
        }
      }
      ... on TransactionsTriggerWebhookPayload {
        decoded {
          method {
            name
          }
          arguments
        }
        block {
          number
          hash
          timestamp
        }
        transaction {
          hash
          nonce
          from
          to
          value
          gasPrice
          gas
          inputData
        }
      }
    }
  }
}

Obtain all outcomes of a trigger

The most common scenario when it comes to querying outcomes is to fetch all the outcomes for a specific trigger. You can do just that using filters:

query {
  outcomes(filter: {triggerUUID: {eq: "0f96098d-e505-47d7-a60b-452681523ca9"}}) {
    UUID
    match {
      UUID
      createdAt
    }
    createdAt
    response {
      ... on MailResponse  {
        messageId
      }
      ... on WebhookResponse {
        httpCode
        body
      }
      ... on ErrorResponse {
        error
      }
    }
    payload {
      ... on MailPayload {
        to
        subject
        body
      }
      ... on EventsTriggerWebhookPayload {
        decoded {
          method {
            name
          }
          arguments
        }
        log {
          address
        data
          topics
        }
        block {
          number
          hash
          timestamp
        }
        transaction {
          hash
        }
      }
      ... on ContractsTriggerWebhookPayload {
        contract {
          address
        }
        method{
          name
        }
        returnedValues {
          matched
          all
        }
        block {
          number
          hash
          timestamp
        }
      }
      ... on TransactionsTriggerWebhookPayload {
        decoded {
          method {
            name
          }
          arguments
        }
        block {
          number
          hash
          timestamp
        }
        transaction {
          hash
          nonce
          from
          to
          value
          gasPrice
          gas
          inputData
        }
      }
    }
  }
}

Please refer to the filtering record section of this guide to understand how to use filters.

Last updated