-
Notifications
You must be signed in to change notification settings - Fork 15
feat(ensadmin): add new saved GraphQL queries #780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
djstrong
commented
Jun 11, 2025
- Introduced multiple new GraphQL queries for domain and resolver functionalities, including fetching domains by name, label, and namehash.
- Added a category field to saved queries for better organization.
- Enhanced existing queries to support additional data retrieval options, improving overall functionality.
… resolver operations - Introduced multiple new GraphQL queries for domain and resolver functionalities, including fetching domains by name, label, and namehash. - Added a category field to saved queries for better organization. - Enhanced existing queries to support additional data retrieval options, improving overall functionality.
🦋 Changeset detectedLatest commit: d7b9608 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 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 |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…records - Introduced a new query to fetch historical resolver records, including resolver details and changes over time. - Enhanced saved queries with additional operation for improved data retrieval related to ENS domains.
- Introduced a new query to retrieve domains with pagination support, allowing for efficient data fetching. - Enhanced saved queries to include the new operation for improved data management related to ENS domains.
lightwalker-eth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djstrong Cool this is moving in a nice direction 👍 Shared a few suggestions
apps/ensadmin/src/components/graphiql-editor/plugins/saved-queries/saved-queries-plugin.tsx
Show resolved
Hide resolved
…tter clarity - Added descriptive text for various saved queries to improve understanding of their functionality and usage. - Updated the SavedQuery interface to include an optional description field for enhanced documentation.
|
All review comments are addressed and a few new queries are added. |
lightwalker-eth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djstrong Hey awesome to see this! Appreciate this is a big effort 👍 Nice work 🙌
I have various feedback. Overall I think it's best to merge this in more eagerly as soon as you resolve the points you're comfortable to resolve and then we create separate PRs for additional refinements later 😄
apps/ensadmin/src/components/graphiql-editor/plugins/saved-queries/saved-queries-plugin.tsx
Outdated
Show resolved
Hide resolved
apps/ensadmin/src/components/graphiql-editor/plugins/saved-queries/saved-queries-plugin.tsx
Outdated
Show resolved
Hide resolved
| name: "Get Latest Domains", | ||
| category: "Domain", | ||
| description: | ||
| "Retrieves the most recently created domains in descending order by creation time. Useful for monitoring new domain registrations and understanding recent activity on the ENS network.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should note here the distinction of Domains vs Registrations. There's a long story here. Please setup a call with me and we can discuss.
| name: "Get Domain by Name", | ||
| category: "Domain", | ||
| description: | ||
| "Looks up a domain by its human-readable name (e.g., 'ens.eth'). This is more user-friendly than using namehash but may be slightly less efficient for programmatic access.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The key issue here is not that it's less efficient. The key issue is that it's not always reliable. See https://ensnode.io/docs/usage/querying-best-practices/#stable-name-identification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected.
| category: "Domain", | ||
| description: | ||
| "Retrieves only the domain-level events (transfers, ownership changes, wrapping events) without registration or resolver events. Use this when you're specifically interested in domain ownership and management events.", | ||
| //events(orderBy: blockNumber, orderDirection: desc) is not working |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. Why isn't it working? Is this something we should be concerned about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works on the ENS Subgraph.
| { | ||
| operationName: "getRegistrationByTokenId", //similar to getSubgraphRegistrant - remove? | ||
| id: "28", | ||
| name: "Get Registration by Token ID", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I don't think it's right to call this a TokenId in all cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is right only for:
"For an unwrapped .eth 2LD (second-level domain), the token ID for the ERC-721 NFT is the same as the labelhash for the second-level part of the domain."
…ed queries with structured categories - Added SavedQueryCategory enum to standardize query categories across the application. - Updated existing saved queries to utilize the new enum for improved clarity and consistency in categorization. - Enhanced descriptions for several queries to provide better context and usability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the saved-queries plugin by adding categorical metadata and descriptions to each saved GraphQL query, and wires these new fields into the sample page.
- Introduce
SavedQueryCategoryenum and addcategory+descriptiontoSavedQueryinterface - Export new enum in plugin index for external use
- Update sample
savedQueriesinpage.tsxto include the new fields
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/ensadmin/src/components/graphiql-editor/plugins/saved-queries/saved-queries-plugin.tsx | Added SavedQueryCategory enum and new category/description properties on SavedQuery |
| apps/ensadmin/src/components/graphiql-editor/plugins/saved-queries/index.ts | Exported the SavedQueryCategory enum |
| apps/ensadmin/src/app/gql/ponder/page.tsx | Updated sample queries to supply category and description |
| .changeset/shy-glasses-sip.md | Bumped ensadmin to minor and described the feature addition |
Comments suppressed due to low confidence (3)
apps/ensadmin/src/components/graphiql-editor/plugins/saved-queries/saved-queries-plugin.tsx:9
- [nitpick] Add a JSDoc comment above
SavedQueryCategoryto explain its purpose and the criteria for each category to improve maintainability.
export enum SavedQueryCategory {
apps/ensadmin/src/components/graphiql-editor/plugins/saved-queries/saved-queries-plugin.tsx:21
- Making
categoryanddescriptionrequired may break existing persisted queries missing these fields. Consider marking them optional or providing defaults for backward compatibility.
category: SavedQueryCategory;
apps/ensadmin/src/components/graphiql-editor/plugins/saved-queries/saved-queries-plugin.tsx:22
- New fields
categoryanddescriptionintroduce UI logic (e.g., filtering or display). Add or update unit tests to verify these fields are handled correctly.
description: string;