Skip to main content

Connection

Connection 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!]!
FieldTypeDescription
fromAddrString!The source address that you want to query connections about
toAddrList[String!]!A string list of addresses that you want to check if they have connections with fromAddr
networkNetworkThe blockchain network of the address you are querying about. Default is ETH. you can also use SOLANA for the Solana network

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
proofStringThe proof of this connection. Please see Proof of Connection for detail design and implementation

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:

query ProofQuery {
connections(
fromAddr: "51je9UThqqhcZbVgY9kZgASthAVCafgqNGDaW3vpyXrr"
toAddrList: ["EPBtp2MmAM68CBnt8KBCMoKzwpQtQ486hWehDhGrtKi8"]
network: SOLANA
) {
fromAddr
toAddr
proof
}
}

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: "51je9UThqqhcZbVgY9kZgASthAVCafgqNGDaW3vpyXrr"
toAddrList: ["EPBtp2MmAM68CBnt8KBCMoKzwpQtQ486hWehDhGrtKi8"]
network: SOLANA
) {
fromAddr
toAddr
followStatus {
isFollowed
isFollowing
}
namespace
alias
network
createdAt
updatedAt
proof
}
}