Skip to main content
query GetReferrals($after: String, $before: String, $first: Int, $last: Int) {
  referrals(after: $after, before: $before, first: $first, last: $last) {
    nodes {
      createdAt
      id
      status
      type
      updatedAt
      contacts {
        email
        firstName
        id
        isPrimary
        lastName
        phoneNumber
      }
      customAttributes {
        id
        key
        type
        value
      }
      primaryContact {
        email
        firstName
        id
        isPrimary
        lastName
        phoneNumber
      }
      ... on PurchasePropertyClosingReferral {
        propertyAddress {
          city
          country
          latitude
          longitude
          mapImageUrl
          postalCode
          province
          shortTitle
          street
          title
          unitNumber
        }
        purchaseAmount {
          amount
          currencyCode
        }
      }
      ... on RefinanceReferral {
        mortgageAmount {
          amount
          currencyCode
        }
        propertyAddress {
          city
          country
          latitude
          longitude
          mapImageUrl
          postalCode
          province
          shortTitle
          street
          title
          unitNumber
        }
      }
      ... on SalePropertyClosingReferral {
        propertyAddress {
          city
          country
          latitude
          longitude
          mapImageUrl
          postalCode
          province
          shortTitle
          street
          title
          unitNumber
        }
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
{
  "data": {
    "referrals": {
      "nodes": [
        {
          "createdAt": "2025-01-15T10:30:00Z",
          "id": "gid://ownright/Object/1",
          "status": "CONVERTED",
          "type": "PURCHASE_PROPERTY_CLOSING",
          "updatedAt": "2025-01-15T10:30:00Z",
          "contacts": [
            {
              "email": "[email protected]",
              "firstName": "Jane",
              "id": "gid://ownright/Object/1",
              "isPrimary": true,
              "lastName": "Doe",
              "phoneNumber": "+14165551234"
            }
          ],
          "customAttributes": [
            {
              "id": "gid://ownright/Object/1",
              "key": "example-key",
              "type": "BOOLEAN",
              "value": "example-value"
            }
          ],
          "primaryContact": {
            "email": "[email protected]",
            "firstName": "Jane",
            "id": "gid://ownright/Object/1",
            "isPrimary": true,
            "lastName": "Doe",
            "phoneNumber": "+14165551234"
          },
          "propertyAddress": {
            "city": "Toronto",
            "country": "CANADA",
            "latitude": 1,
            "longitude": 1,
            "mapImageUrl": "https://example.com",
            "postalCode": "M5V 1A1",
            "province": "ALBERTA",
            "shortTitle": "123 Main St, Toronto",
            "street": "123 Main St",
            "title": "123 Main St, Toronto",
            "unitNumber": "Suite 100"
          },
          "purchaseAmount": {
            "amount": "100.00",
            "currencyCode": "CAD"
          },
          "mortgageAmount": {
            "amount": "100.00",
            "currencyCode": "CAD"
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "cursor_abc123"
      }
    }
  }
}

Query field

referrals

Arguments

after
String
Returns the elements in the list that come after the specified cursor.
before
String
Returns the elements in the list that come before the specified cursor.
first
Int
Returns the first n elements from the list.
last
Int
Returns the last n elements from the list.

Return fields

referrals
ReferralConnection!
required
Returns all referrals the business contact is involved in.

Types