-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add artifactUri, thumbnailUri, and displayUri to top level of Objkt #32
base: dev
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,30 @@ export class ObjktResolver { | |
return ctx.genTokLoader.load(objkt.issuerId) | ||
} | ||
|
||
@FieldResolver((returns) => String, { | ||
description: "IPFS uri pointing to the web page hosting the Generator code.", | ||
}) | ||
artifactUri(@Root() objkt: Objkt, @Ctx() ctx: RequestContext) { | ||
if (objkt.artifactUri) return objkt.artifactUri; | ||
return ctx.genTokLoader.load(objkt.metadata?.artifactUri); | ||
} | ||
|
||
@FieldResolver((returns) => String, { | ||
description: "IPFS uri pointing to the 300x300 (contained) thumbnail", | ||
}) | ||
thumbnailUri(@Root() objkt: Objkt, @Ctx() ctx: RequestContext) { | ||
if (objkt.thumbnailUri) return objkt.thumbnailUri; | ||
return ctx.genTokLoader.load(objkt.metadata?.thumbnailUri); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The genTokLoader is a DataLoader designed to batch queries to get a Generative Token from the database. Its load function accepts a Generative Token ID. Ultimately, requesting the DataLoader in here is not required, as the data is already available in |
||
} | ||
|
||
@FieldResolver((returns) => String, { | ||
description: "IPFS uri pointing to the full res image", | ||
}) | ||
displayUri(@Root() objkt: Objkt, @Ctx() ctx: RequestContext) { | ||
if (objkt.displayUri) return objkt.displayUri; | ||
return ctx.genTokLoader.load(objkt.metadata?.displayUri); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same remark as |
||
} | ||
|
||
@FieldResolver(returns => [Split], { | ||
description: "A list of the royalties split for this gentk." | ||
}) | ||
|
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 resolver should be removed as it can be derived from the Generative Token
generativeUri
and the objktgenerationHash
https://gateway.fxhash.xyz/ipfs/${cid(generativeUri)}/?fxhash=${generationHash}