Hey everyone!
With this 3Speak Video & Hive post, @sagarkothari88 illustrates how to use GraphQL Queries based on Union Indexer.
SPK Network is always Open-source:
- Mobile app source code
- Legacy / Current website
- Legacy / Current creator studio
- Union Indexer
What is GraphQL?
- GraphQL is a query language for APIs and a runtime for fulfilling those queries with existing data
- GraphQL provides an interactive way of building the queries & play around them.
- You can select the attributes/fields/properties of your choice for the response.
Why is GraphQL now on Mobile App?
- The mobile app shows different feeds but is not sorted as per the curation amount.
- For each video, payout info, votes, etc., values are fetched, over & over, when displayed on the screen.
- This consumes internet bandwidth & you may want to avoid it if you are on mobile data.
- There are other issues with the existing feed.
- Feed needs to be updated.
- With GraphQL, we can fix these issues & have needed data in a single request.
- @sagarkothari88 is now implementing GraphQL-based feeds on 3Speak-Mobile application.
How to use GraphQL?
- Please view the video to understand in detail with a live demo.
- Open this link - https://union.us-02.infra.3speak.tv/api/v2/graphql
- Select the feed of your choice.
- Social Feed
- Trending Feed
- Select attributes that you need for your User Interface
- Do not forget to apply this filter if you only want the data for Videos.
- Hit the run button.
Ready-made GraphQL Queries for you
Trending feed
query MyQuery {
trendingFeed(spkvideo: {only: true}) {
items {
... on HivePost {
spkvideo
stats {
num_comments
num_votes
total_hive_reward
}
lang
title
tags
permlink
created_at
body
}
}
}
}
New Videos Feed
query MyQuery {
socialFeed(spkvideo: {only: true}) {
items {
... on HivePost {
spkvideo
stats {
num_comments
num_votes
total_hive_reward
}
lang
title
tags
permlink
created_at
body
}
}
}
First Uploads Feed
query MyQuery {
socialFeed(spkvideo: {only: true, firstUpload: true}) {
items {
... on HivePost {
spkvideo
stats {
num_comments
num_votes
total_hive_reward
}
lang
title
tags
permlink
created_at
body
}
}
}
Related Videos
query MyQuery {
relatedFeed(permlink: "sdltslwo", author: "leofinance") {
items {
... on HivePost {
spkvideo
stats {
num_comments
num_votes
total_hive_reward
}
lang
title
tags
permlink
created_at
body
}
}
}
}
My Published Videos
query MyQuery {
socialFeed(
spkvideo: {only: true}
feedOptions: {byCreator: {_eq: "sagarkothari88"}}
) {
items {
... on HivePost {
body
title
tags
stats {
num_comments
num_votes
total_hive_reward
}
spkvideo
permlink
lang
community
created_at
}
}
}
}
3Shorts
query MyQuery {
socialFeed(
spkvideo: {only: true, isShort: true}
) {
items {
... on HivePost {
body
title
tags
stats {
num_comments
num_votes
total_hive_reward
}
spkvideo
permlink
lang
community
created_at
}
}
}
}
Leaderboard
Coming soon.
Community Details
query MyQuery {
community(id: "hive-181335") {
title
about
created_at
images {
avatar
cover
}
roles {
role
title
username
}
subscribers
}
}
Videos from a community
query MyQuery {
community(id: "hive-181335") {
title
about
created_at
images {
avatar
cover
}
roles {
role
title
username
}
subscribers
trendingFeed {
items {
... on HivePost {
spkvideo
stats {
num_comments
num_votes
total_hive_reward
}
lang
title
tags
permlink
created_at
body
}
}
}
}
}
About the SPK Network:
The SPK Network is a decentralized Web 3.0 protocol that rewards value creators and infrastructure providers appropriately and autonomously by distributing reward tokens so that every user, creator, and platform can earn rewards on a level playing field.
Check out the SPK Network Light Paper: https://peakd.com/hive/@spknetwork/spk-network-light-paper
Our Website: https://spk.network/
Telegram Group: https://t.me/spknetwork
Discord Server: https://discord.gg/JbhQ7dREsP
SPK Network Linktree: https://linktr.ee/spknetwork
Important Links:
Vote for 3Speak as Witness -
Vote for Sagarkothari88 as Witness -
▶️ 3Speak
Buy DHEDGE on Tribaldex or earn some daily by joining one of our many delegation pools at app.dhedge.cc.This post has been selected for upvote from our token accounts by @seckorama! Based on your tags you received upvotes from the following account(s):- @dhedge.bonus- @dhedge.leo- @dhedge.ctp@seckorama has 9 vote calls left today.Hold 10 or more DHEDGE to unlock daily dividends and gain access to upvote rounds on your posts from @dhedge. Hold 100 or more DHEDGE to unlock thread votes. Calling in our curation accounts currently has a minimum holding requirement of 100 DHEDGE. The more DHEDGE you hold, the higher upvote you can call in.
!DHEDGE
This may be an ignorant question but how does SPK benefit Hive? I believe I've asked before, so forgive me.
Provides peer to peer incentivised, offchain storage, content deliver networks and encoding of content as well as offchain content indexing, easy to spin up content platforms amongst other things such as community liquidity pools, wrapping hive to btc and community tokens
This reminds me the following intro scene of Queen of the Dragon (in game of thrones)
MISSANDEI INTRODUCING DAENERYS TARGARYEN TO JON SNOW
@neopch - Can you do a mix video of above context? It will gain a lot of traction.
@neopch / @starkerz giving intro of @threespeak (in the way Missandei gave intro of Queen of Dragon)
https://www.ailoitte.com/
When you say off-chain storage is it more focused on persistence or integrity of data? For instance, IPFS is great until no one is storing the files any longer. Is this an additional layer on top of an existing technology or is it completely novel?
.
it allows platforms or communities or creators to autonomously incentivise peers with crypto for storing data on IPFS. nothing else like it out there
So essentially it's a layer written on top of IPFS? What's the expected cost and estimated persistence of the data?
The system is built so that the market will sort that out to the cheapest possible, longest storage period. When ppl are using spare storage space and agreeing on variable time locked storage contracts, the market will find its way
So free market economics. I'm down with that.
We are working with SPK to build the next generation of BTC, LTC, DOGE and more wrapping onto HIVE in a fully decentralzied secure and autonomous manner.
What value does VSC offer that HiveEngine could not? I have some assumptions, but I was curious about your take.
Here is a list:
Hive Engine only focuses on a set of a few use cases. VSC aims to handle so much more.
I suspected a lot of this. EVM based engine or something else completely?
JS based engine
!PGM
BUY AND STAKE THE PGM TO SEND A LOT OF TOKENS!
The tokens that the command sends are: 0.1 PGM-0.1 LVL-0.1 THGAMING-0.05 DEC-15 SBT-1 STARBITS-[0.00000001 BTC (SWAP.BTC) only if you have 2500 PGM in stake or more ]
5000 PGM IN STAKE = 2x rewards!
Discord
Support the curation account @ pgm-curator with a delegation 10 HP - 50 HP - 100 HP - 500 HP - 1000 HP
Get potential votes from @ pgm-curator by paying in PGM, here is a guide
I'm a bot, if you want a hand ask @ zottone444
hello @spknetwork thank you for sharing your story, I always follow you, always inspiring many people, thank you