Conversation
…r traversal of the unified ENSv1/ENSv2 namegraph without needing to select a type-specific fragment.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 76b66dd The changes in this PR will be included in the next version bump. This PR includes changesets to release 19 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughA new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR introduces a unified Domain.subdomains field to the GraphQL API, providing a single interface-level abstraction for traversing both ENSv1 and ENSv2 domain hierarchies without requiring type-specific fragments.
Changes:
- Added
Domain.subdomainsconnection field that handles both v1 (parent-child) and v2 (registry-based) domain relationships - Removed an unrelated TODO comment about partial names
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/ensapi/src/graphql-api/schema/domain.ts | Adds Domain.subdomains connection with proper v1/v2 traversal logic and removes obsolete TODO comment |
| .changeset/seven-cows-call.md | Documents the new feature as a minor version bump |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/ensapi/src/graphql-api/schema/domain.ts`:
- Around line 213-250: The ENSv1 query logic in Domain.subdomains and
ENSv1Domain.children is duplicated; extract a helper (e.g., findV1ChildDomains)
that encapsulates the db.query.v1Domain.findMany call and cursor decoding (use
cursors.decode<ENSv1DomainId>), accepting the parent id and cursor args
({before, after, limit, inverted}) and returning the result, then replace the
duplicated blocks in Domain.subdomains (ENSv1 branch) and ENSv1Domain.children
to call findV1ChildDomains(parent.id, cursorArgs) so both resolvers delegate to
the single implementation.
Greptile SummaryAdded
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Domain.subdomains Query] --> B{Check Domain Type}
B -->|ENSv1Domain| C[Query v1Domain.findMany]
B -->|ENSv2Domain| D{Has subregistryId?}
D -->|null| E[Return empty array]
D -->|exists| F[Query v2Domain.findMany]
C --> G[Filter by parentId]
F --> H[Filter by registryId = subregistryId]
G --> I[Apply cursor pagination]
H --> I
I --> J[Return unified Domain connection]
Last reviewed commit: 76b66dd |
#1582
Summary
Domain.subdomainsabstraction for downward traversal of the namegraphWhy
Testing
Pre-Review Checklist (Blocking)