-
Notifications
You must be signed in to change notification settings - Fork 17
add records resolution #1974
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
Open
sevenzing
wants to merge
34
commits into
main
Choose a base branch
from
ll/omnigraph-resolution-api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
add records resolution #1974
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
eae25f6
add records resolution
sevenzing bbf391c
Merge branch 'main' into ll/omnigraph-resolution-api
sevenzing e8653a4
small docker fixes
sevenzing 6ff2930
add graphql styled records selection
sevenzing 713f1ee
add primary names field in omnigraph
sevenzing 319a99d
forgot introspection
sevenzing 32f53c8
remove default chain id and add disableAcceleration
sevenzing 09b1435
fix docs
sevenzing 7668d50
fix tests a little bit
sevenzing e1e5680
refactor
sevenzing 2e00efe
Merge branch 'main' into ll/omnigraph-resolution-api
sevenzing c88dde2
fix tests
sevenzing 380dadf
forgot changeset
sevenzing 4fef571
Merge branch 'main' into ll/omnigraph-resolution-api
sevenzing cf7cf01
Merge branch 'main' into ll/omnigraph-resolution-api
sevenzing b1232ab
fix PR suggestions
sevenzing bf275b9
fix the cast problem
sevenzing cbdca11
remove seed-cli
sevenzing 8acc0b2
Merge branch 'main' into ll/omnigraph-resolution-api
sevenzing 60d2793
Merge branch 'main' into ll/omnigraph-resolution-api
sevenzing 0550de5
Merge branch 'main' into ll/omnigraph-resolution-api
sevenzing 7c80a61
update resolution api
sevenzing caa8f76
fix PR comments
sevenzing ab2b849
lint + generate
sevenzing 5b0b1d2
default chain id
sevenzing 4e94c06
add resolve { } object and trace to resolve { }
sevenzing f5bacdd
self review
sevenzing c5330f0
fix for greptile review
sevenzing 6f50a9d
add EMBEDDED_DATA for AccelerationStatus
sevenzing a0008ea
self review again
sevenzing c5d7818
fix no selection bug
sevenzing e0d7f4d
rename constants
sevenzing fdd1b72
fix for comments on PR review from @shrugs
sevenzing c0bbdb8
apply more PR comment fixes
sevenzing File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| import type { CoinType } from "enssdk"; | ||
|
|
||
| import { builder } from "@/omnigraph-api/builder"; | ||
|
|
||
| /////////////////////// | ||
| // ResolveSelectionInput | ||
| /////////////////////// | ||
| export const ResolveSelectionInput = builder.inputType("ResolveSelectionInput", { | ||
| description: | ||
| "Specifies which ENS records to resolve. At least one field must be set to receive any records.", | ||
| fields: (t) => ({ | ||
| reverseName: t.boolean({ | ||
| description: "Whether to resolve the `name` record (used in Reverse Resolution, ENSIP-19).", | ||
| required: false, | ||
| }), | ||
| texts: t.stringList({ | ||
| description: "Text record keys to resolve (e.g. `avatar`, `description`, `com.).", | ||
|
sevenzing marked this conversation as resolved.
Outdated
|
||
| required: false, | ||
|
sevenzing marked this conversation as resolved.
Outdated
|
||
| }), | ||
| addresses: t.field({ | ||
| description: "Coin types to resolve address records for (e.g. `60` for ETH).", | ||
| type: ["CoinType"], | ||
| required: false, | ||
| }), | ||
| }), | ||
| }); | ||
|
|
||
| /////////////////////// | ||
| // ResolvedTextRecord | ||
| /////////////////////// | ||
| export const ResolvedTextRecordRef = builder | ||
| .objectRef<{ key: string; value: string | null }>("ResolvedTextRecord") | ||
| .implement({ | ||
| description: "A resolved text record for an ENS name.", | ||
| fields: (t) => ({ | ||
| key: t.exposeString("key", { | ||
| description: "The text record key.", | ||
| nullable: false, | ||
| }), | ||
| value: t.exposeString("value", { | ||
| description: "The text record value, or null if not set.", | ||
| nullable: true, | ||
| }), | ||
| }), | ||
| }); | ||
|
|
||
| /////////////////////////// | ||
| // ResolvedAddressRecord | ||
| /////////////////////////// | ||
| export const ResolvedAddressRecordRef = builder | ||
| .objectRef<{ coinType: CoinType; address: string | null }>("ResolvedAddressRecord") | ||
| .implement({ | ||
| description: "A resolved address record for an ENS name.", | ||
| fields: (t) => ({ | ||
| coinType: t.field({ | ||
| description: "The coin type for this address record.", | ||
| type: "CoinType", | ||
| nullable: false, | ||
| resolve: (r) => r.coinType, | ||
| }), | ||
| address: t.exposeString("address", { | ||
| description: "The address value, or null if not set.", | ||
| nullable: true, | ||
| }), | ||
| }), | ||
| }); | ||
|
|
||
| //////////////////// | ||
| // ResolvedRecords | ||
| //////////////////// | ||
| export const ResolvedRecordsRef = builder | ||
| .objectRef<{ | ||
|
sevenzing marked this conversation as resolved.
Outdated
|
||
| name: string | null | undefined; | ||
| texts: Record<string, string | null> | undefined; | ||
| addresses: Record<CoinType, string | null> | undefined; | ||
| }>("ResolvedRecords") | ||
| .implement({ | ||
| description: | ||
| "Records resolved for a specific ENS name via the ENS protocol. Only selected records are populated.", | ||
| fields: (t) => ({ | ||
| reverseName: t.string({ | ||
| description: | ||
| "The `name` record value used in Reverse Resolution (ENSIP-19), or null if not set or not selected.", | ||
| nullable: true, | ||
| resolve: (r) => r.name ?? null, | ||
| }), | ||
| texts: t.field({ | ||
| description: "Resolved text records for selected keys.", | ||
| type: [ResolvedTextRecordRef], | ||
| nullable: false, | ||
| resolve: (r) => | ||
| r.texts ? Object.entries(r.texts).map(([key, value]) => ({ key, value })) : [], | ||
| }), | ||
| addresses: t.field({ | ||
| description: "Resolved address records for selected coin types.", | ||
| type: [ResolvedAddressRecordRef], | ||
| nullable: false, | ||
| resolve: (r) => | ||
| r.addresses | ||
| ? Object.entries(r.addresses).map(([coinType, address]) => ({ | ||
| coinType: Number(coinType) as CoinType, | ||
| address, | ||
| })) | ||
| : [], | ||
| }), | ||
| }), | ||
| }); | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.