Query Examples

sidebar_position: 3 title: Sample Queries

Querying

Below are some sample queries you can use to gather information from the Domains contracts.

You can build your own queries using a GraphQL Explorer and enter your endpoint to limit the data to exactly what you need.

Get the top domain for an account based on the longest registry.

query getDomainForAccount {
 account(id: "0xa508c16666c5b8981fa46eb32784fccc01942a71") {
   registrations(first: 1, orderBy: expiryDate, orderDirection: desc) {
     domain {
       name
     }
   }
   id
 }
}

Returns

{
 "data": {
   "account": {
     "registrations": [
       {
         "domain": {
           "name": "datanexus.tomi"
         }
       }
     ],
     "id": "0xa508c16666c5b8981fa46eb32784fccc01942a71"
   }
 }
}

Search for subdomain

Returns

Get an expiration for an Domains domain

Returns

Last updated