-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
feat: Use subscription to track changes in Gallery Item #4633
Conversation
✅ Deploy Preview for koda-nuxt ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Tested: the info of gallery item will update after subscription message coming I relist the nft and change the price from another window. https://beta.kodadot.xyz/snek/gallery/659233203-5 |
pay 50 usd |
😍 Perfect, I’ve sent the payout 🪅 Let’s grab another issue and get rewarded! |
@vikiival merge it if good |
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.
Otherwise LGTM
components/gallery/useGalleryItem.ts
Outdated
}, | ||
}) | ||
useSubscriptionGraphql({ | ||
query: ` nftEntities(where: {id_eq: "${params.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.
Why there is a query string? Please use graphqlfile instead as written in the task desc
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.
Largely for two reasons:
- The official demo shows that the subscription query should be a string.
dev docs: https://docs.subsquid.io/develop-a-squid/graphql-api/subscriptions/
- What's more, the graphql file would only export the object type of query. It needs to do some extra work to convert the custom object to string. IMO it's not that necessary to convert it.
https://stackoverflow.com/questions/59810092/how-to-import-graphql-query-as-a-string-instead-of-an-object
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.
Anyway the query is not correct, please check nftByIdMinimal
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.
Thanks. I have updated the query.
Now the query string is composed of querys from queries/rmrk/subsquid/nftByIdMinimal.graphql
and queries/nftByIdMinimal.graphql
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.
Still this is not correct
You
nftEntities(where: {id_eq: "${params.id}"}) {
nftByIdMinimal
nft: nftEntityById(id: $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.
You are right! I have updated it.
related with #2201 |
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.
Smol stuff
components/gallery/useGalleryItem.ts
Outdated
}, | ||
}) | ||
useSubscriptionGraphql({ | ||
query: ` nftEntities(where: {id_eq: "${params.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.
Still this is not correct
You
nftEntities(where: {id_eq: "${params.id}"}) {
nftByIdMinimal
nft: nftEntityById(id: $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.
Let it roll 🎲
Code Climate has analyzed commit 862c822 and detected 0 issues on this pull request. View more on Code Climate. |
bounty has been paid in the previous comment.
✅ Fixed |
Thank you for your contribution to the KodaDot NFT gallery.
👇 _ Let's make a quick check before the contribution.
PR Type
Context
Before submitting pull request, please make sure:
Optional
Had issue bounty label?
Community participation
Screenshot 📸