Context
Our public example projects (enskit-react-example, enssdk-example) currently use Domain.name instead of Domain.canonical.name.interpreted because v2-sepolia does not yet expose materialized canonical names. We had inline TODO comments tracking the migration; those have been removed from the examples to keep them clean.
examples/enskit-react-example
src/AccountView.tsx
-
GraphQL query AccountDomainsQuery — In account.domains.edges.node, replace:
node { __typename id name }
with:
node { __typename id canonical { name { interpreted } } }
-
Domain list rendering — Replace the edge.node.name branch with canonical-based links:
{edge.node.canonical ? (
<Link to={`/domain/${edge.node.canonical.name.interpreted}`}>
{beautifyInterpretedName(edge.node.canonical.name.interpreted)}
</Link>
) : (
<em>non-canonical domain</em>
)}
src/SearchView.tsx
-
GraphQL query DomainsByNameQuery — In domains.edges.node, replace:
node { __typename id name }
with:
node { __typename id canonical { name { interpreted } } }
-
Search result links — Use edge.node.canonical.name.interpreted for route and display instead of edge.node.name.
src/DomainView.tsx
-
DomainFragment — Add canonical { name { interpreted } } to the fragment (alongside or instead of relying on name).
-
DomainByNameQuery — On parent, replace:
with:
parent { canonical { name { interpreted } } }
-
SubdomainLink — Link and label via domain.canonical.name.interpreted instead of domain.name.
-
Domain page title — Use domain.canonical?.name.interpreted ?? name for the <h2>.
-
Parent breadcrumb — Use data.domain.parent?.canonical for the “← parent” link.
examples/enssdk-example
src/index.ts
-
DomainFragment — Add:
canonical { name { interpreted } }
-
formatDomain() — Derive display name from canonical:
const name = domain.canonical
? beautifyInterpretedName(domain.canonical.name.interpreted)
: "<unnamed>";
examples/omnigraph-graphql-example
Plain GraphQL + fetch example (no ENSKit or ENS SDK). Same v2-sepolia workaround: uses Domain.name instead of Domain.canonical.name.interpreted.
src/index.ts
-
HELLO_WORLD_QUERY — root domain fields — On domain(by: { name: $name }), replace:
with:
canonical { name { interpreted } }
(and drop direct name if no longer needed)
-
HELLO_WORLD_QUERY — subdomain edges — In subdomains.edges.node, replace:
edges { node { __typename name owner { address } } }
with:
edges { node { __typename canonical { name { interpreted } } owner { address } } }
-
Domain interface — Add canonical typing and stop relying on top-level name for display:
interface Domain {
__typename: "ENSv1Domain" | "ENSv2Domain";
canonical: { name: { interpreted: string } } | null;
owner: { address: string } | null;
}
-
formatDomain() — Derive display name from canonical:
const name = domain.canonical?.name.interpreted ?? "<unnamed>";
Context
Our public example projects (
enskit-react-example,enssdk-example) currently useDomain.nameinstead ofDomain.canonical.name.interpretedbecausev2-sepoliadoes not yet expose materialized canonical names. We had inline TODO comments tracking the migration; those have been removed from the examples to keep them clean.examples/enskit-react-examplesrc/AccountView.tsxGraphQL query
AccountDomainsQuery— Inaccount.domains.edges.node, replace:with:
Domain list rendering — Replace the
edge.node.namebranch with canonical-based links:src/SearchView.tsxGraphQL query
DomainsByNameQuery— Indomains.edges.node, replace:with:
Search result links — Use
edge.node.canonical.name.interpretedfor route and display instead ofedge.node.name.src/DomainView.tsxDomainFragment— Addcanonical { name { interpreted } }to the fragment (alongside or instead of relying onname).DomainByNameQuery— Onparent, replace:with:
SubdomainLink— Link and label viadomain.canonical.name.interpretedinstead ofdomain.name.Domain page title — Use
domain.canonical?.name.interpreted ?? namefor the<h2>.Parent breadcrumb — Use
data.domain.parent?.canonicalfor the “← parent” link.examples/enssdk-examplesrc/index.tsDomainFragment— Add:formatDomain()— Derive display name from canonical:examples/omnigraph-graphql-examplePlain GraphQL +
fetchexample (no ENSKit or ENS SDK). Same v2-sepolia workaround: usesDomain.nameinstead ofDomain.canonical.name.interpreted.src/index.tsHELLO_WORLD_QUERY— root domain fields — Ondomain(by: { name: $name }), replace:namewith:
(and drop direct
nameif no longer needed)HELLO_WORLD_QUERY— subdomain edges — Insubdomains.edges.node, replace:with:
Domaininterface — Add canonical typing and stop relying on top-levelnamefor display:formatDomain()— Derive display name from canonical: