Skip to content

Instantly share code, notes, and snippets.

@ries9112
Created June 30, 2021 04:22
Show Gist options
  • Save ries9112/eeeb9defd2931d8acae68a0d492c16db to your computer and use it in GitHub Desktop.
Save ries9112/eeeb9defd2931d8acae68a0d492c16db to your computer and use it in GitHub Desktop.
This is Ricky's CV script of the gallery that displays the most recent artwork from hic et nunc (https://www.cryptovoxels.com/play?coords=SE@6922W,34S). This is an adaptation where the GraphQL query returns data for audio objkts (as requested by @Mighty_33)
feature.on('click',e=>{
fetch('https://api.hicdex.com/v1/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
query: `
query MyQuery {
hic_et_nunc_token(order_by: {timestamp: desc}, limit: 10, where: {mime: {_eq: "audio/wav"}}) {
display_uri
id
mime
timestamp
royalties
supply
title
}
}
`,
}),
})
.then((res) => res.json())
.then((result) => {
// do stuff here
console.log(result);
console.log(result.data);
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment