📖
Pulse Domains
  • 👋Introduction
  • đŸŸĸRegistration FAQ
  • 📒Terminology
  • Guides
    • đŸĒ„Domain Registration
    • đŸ§â€â™€ī¸Updating Your Profile
    • đŸĨˇPreserving Your Privacy
    • đŸ‘ĨCreating Subdomains
    • đŸ›Šī¸Domain Transfer
    • 🤝DNS Domain Setup
    • 🍭Brand Guidelines
    • 💸Referrals
    • 📜Whitelist & Claims
    • 🌟Registration Widget
    • đŸĒ…CCIP & PNS
    • đŸĒ…Name Renewal
  • Deep Dives
    • đŸŦName Wrapper
      • đŸ”ĨFuses
      • âŗExpiry
      • ✅Approved Operators
    • 👨‍🔧Managing a Name
    • 🔤Homoglyphs
  • pls.fyi Profile
    • ✨Your Web3 Profile
  • PLS.TO dWeb
    • đŸĒInterPlanetary FileSystem (IPFS)
    • 🌐Your Decentralized Website
    • đŸ’ģIPFS & PLS.TO Guide
  • Partner Sites
    • 📈PulseCoinList.com
    • 💱PulseSwap.io: The Aggregator of Aggregators
      • 📈 Integration for Developers and Projects
  • Dapp Developer Guide
    • đŸ› ī¸Getting Started
      • PNS Enabling your DApp
      • PNS Libraries
      • Working with PNS
      • Resolving Names
      • Managing Names
      • Registering & Renewing Names
      • PNS Front-End Design Guidelines
      • PNS as NFT
      • PNS Data guide
    • 🐛Bug Bounty Program & Audit
  • âš™ī¸Contract Api Reference
    • 📜Deployed Contracts
    • Name Processing
    • Registry
    • ReverseRegistrar
    • TestRegistrar
    • PublicResolver
    • .pls Permanent Registrar
      • Registrar
      • Controller
    • DNS Registrar
    • Name Wrapper
      • Expiry
      • Fuses
      • Wrapped States
    • Subgraph
      • Entities
      • Queries
  • 📙Contract Developer Guide
    • Resolving Names On-chain
    • Writing a Resolver
    • Writing a Registrar
  • đŸĻ¸â€â™‚ī¸Community
    • Community Dev Resources
  • Links
    • đŸ•šī¸PNS App
    • đŸĻTwitter
    • âœˆī¸Telegram
    • 💡PNS Name Ideas (Community Site)
Powered by GitBook
On this page
  • Querying
  • Get the top domain for an account based on the longest registry.
  • Search for subdomain
  • Get an expiration for an PNS domain

Was this helpful?

  1. Contract Api Reference
  2. Subgraph

Queries

PreviousEntitiesNextResolving Names On-chain

Last updated 1 year ago

Was this helpful?

sidebar_position: 3 title: Sample Queries


Querying

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

You can build your own queries using a 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: "0xfee51ebbf276c1c3d91910a0b9a029e3ce731619") {
    registrations(first: 1, orderBy: expiryDate, orderDirection: desc) {
      domain {
        name
      }
    }
    id
  }
}

Search for subdomain

query getSubDomains($Account: String = "richard.pls") {
  domains(where: { name: "richard.pls" }) {
    name
    id
    subdomains(first: 10) {
      name
    }
    subdomainCount
  }
}

Get an expiration for an PNS domain

{
 query getDomainExp($Account: String = "richard.pls") {
  registrations(
    where: {domain_: {name: $Account}}
    first: 1
    orderBy: expiryDate
    orderDirection: desc
  ) {
    expiryDate
  }
}
âš™ī¸
GraphQL Explorer