Skip to main content
Version: V1

Connections

Connections API is used to query fields of connections between a given address and another address or a list of other addresses (5000 max).

You can find the step by step instructions on how to set up GraphQL client in your application and write a simple Get Connection query in the Read Connections section.

Structure

The general pattern of connection query is:

connections(fromAddr: String!, toAddrList: [String!]!, network: Network) [Connection!]!
FieldTypeDescriptionRequired/Optional
fromAddrString!The source address that you want to query connections aboutRequired
toAddrList[String!]!A string list of addresses that you want to check if they have connections with fromAddrRequired
networkNetworkThe blockchain network of the address you are querying aboutOptional. Default value is ETH.

With correct inputs, you will get a list of Connection objects, consisting of the following fields:

FieldTypeDescription
fromAddr StringThe source address that you want to query connections about
toAddrStringAn address that is given in toAddrList
followStatus FollowStatusThe following and followed relationships between fromAddr and toAddr
namespaceStringThe namespace of this connection
aliasStringThe alias set by the fromAddress for toAddr.
networkNetworkThe network that is given as the querying parameter
createdAtStringThe creation time of this connection
updatedAtStringThe latest update time of this connection
latestEventConnectionEventThe latest event of this connection including the proof. Please see Proof of Connection for detail design and implementation.
latestAnchorEventConnectionEventThe latest event of this connection which can be found on Arweave

For followStatus, there will be two boolean variables: isFollowed and isFollowing.

If isFollowed is true, toAddr has followed fromAddr.

If isFollowing is true, fromAddr has followed toAddr.

Examples

Fetch Proof Example

This is an example of a query to fetch proof data that you can also test out in the Playground. With arweaveTxHash you can query it on Arweave to proof the connection.

query ProofQuery {
connections(fromAddr: "jiayi92.eth", toAddrList: ["cyberlab.eth"]) {
fromAddr
toAddr
latestEvent {
...event
}
latestAnchorEvent {
...event
}
}
}

fragment event on ConnectionEvent {
hash
parentHash
fromAddr
toAddr
network
namespace
createdAt
isAnchor
proof {
content
digest
signature
signingKey
signingKeyAuth {
message
signature
address
}
arweaveTxHash
}
}

Fetch followStatus Example

This is an example of a query to fetch the followStatus that you can also test out in the Playground:

query FollowStatusQuery {
connections(
fromAddr: "51je9UThqqhcZbVgY9kZgASthAVCafgqNGDaW3vpyXrr"
toAddrList: ["EPBtp2MmAM68CBnt8KBCMoKzwpQtQ486hWehDhGrtKi8"]
network: SOLANA
) {
fromAddr
toAddr
followStatus {
isFollowed
isFollowing
}
}
}

Full Example

This is a full example for the Connections query that you can also test out in the Playground:

query ConnectionsQuery {
connections(fromAddr: "jiayi92.eth", toAddrList: ["cyberlab.eth"]) {
fromAddr
toAddr
followStatus {
isFollowed
isFollowing
}
namespace
alias
network
createdAt
updatedAt
latestEvent {
...event
}
latestAnchorEvent {
...event
}
}
}

fragment event on ConnectionEvent {
hash
parentHash
fromAddr
toAddr
network
namespace
createdAt
isAnchor
proof {
content
digest
signature
signingKey
signingKeyAuth {
message
signature
address
}
arweaveTxHash
}
}

Designed by