Created
April 4, 2022 19:20
-
-
Save saarim-mirror/2605fda5baf8b428385c872f6eb5d6d5 to your computer and use it in GitHub Desktop.
Query for Mirror Content on Arweave
This file contains 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
// GraphQL query to get the Arweave transaction ID of a Mirror post | |
// With the transaction ID we can use `getData()` from the Arweave JS SDK, eg. | |
// arweave.transactions.getData('bNbA3TEQVL60xlgCcqdz4ZPHFZ711cZ3hmkpGttDt_U').then(data => { console.log(data); }); | |
// We can use the explorer at https://arweave.net/graphql, which queries https://arweave.net/graphql to test it out | |
// With the transaction ID we can go to the URL `arweave.net/<YOUR_TRANSACTION_ID>` which will render the JSON | |
// More details on how this works on https://dev.mirror.xyz/GjssNdA6XK7VYynkvwDem3KYwPACSU9nDWpR5rei3hw | |
query GetMirrorTransactions($digest: String!) { | |
transactions(tags:[ | |
{ | |
name:"App-Name", | |
values:["MirrorXYZ"], | |
}, | |
{ | |
name:"Original-Content-Digest", | |
values:[$digest] | |
} | |
], sort:HEIGHT_DESC, first: 1){ | |
edges { | |
node { | |
id | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
RGW8X3ZWkLxCS4kc3eM7m1uHsAd5DXCD5AICzIIC7OQ
this digest cannot be retrieved from grapphql