SPK Network - Using GraphQL for 3Speak Mobile App
Hey everyone!
With this 3Speak Video & Hive post, 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.
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: @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:
| 3Speak Linktree | SPK Network Linktree |
Vote for 3Speak as Witness - 
Vote for Sagarkothari88 as Witness - 
▶️ 3Speak
Leave SPK Network - Using GraphQL for 3Speak Mobile App to:
Read more #graphql posts
Best Posts From SPK Network
We have not curated any of spknetwork's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From SPK Network
- SPK Network - Final Test net AMA Recording
- SPK Network Final Test Net AMA
- SPK Network White Paper
- Breakaway Communities Released
- Recording of SPK Network Meeting: SPK Drive, Dlux, StoreToEarn, and More
- SPK Network - Final Testnet Sprint is Live!
- SPK Tokenomics and Economy
- SPK Network - Final Testnet Sprint: Call to Action!
- What is the SPK Network and How it Works
- SPK Network - Testnet Sprint Results & Prizes
- Call to Action! Contribute to the Development of the SPK Network's Breakaway Communities
- SPK Network - Testnet Sprint AMA Recording
- SPK Network Testnet AMA - Join us this Sunday!
- Win $2,000 USD in Rewards! Join the SPK Network Testnet First Two-Week Sprint
- SPK Network - SPK Testnet Introduction Video
- SPK Network Team Meeting #31
- SPK Network Team Meeting #30
- SPK Network Team Meeting #29
- SPK Network Team Meeting #28
- SPK Network Team Meeting #27