steemQL 0.6.1 - Query related steem data with GraphQL
Another step forward for steemQL, the GraphQL server for Steem. This update adds the ability to query related data.
This enables you to fetch data for a single user including e.g. his 10 last posts in just one query. And you can decide which properties of user and posts you need to get, something like user.name, user.id, user.post.title, user.post.body
. No need to transfer unused data over the wire for your app. Also these subqueries take their own params, so you can configure the number of posts or or truncate the text of the body of posts inside a user queries. Have fun..
New Features
- Get users with related posts in one query (for an example see below and screenshot)
- Get posts with complete related user data in one query (the above reversed)
Roadmap
- Improve the above queries with more related data, e.g. get all
comments
ofposts
inside auser
query (building a ‘Graph’ of data) - Simplified return values for complex data structures like
json_metadata
, no need to parse it on your own - Subscriptions for post/comment related queries, to use with GraphQL Clients like Apollo
Contribution
Any kind of contribution is welcome, mainly feedback and feature requests.
GitHub: steemQL
Discord: https://discord.gg/NgezG
steemit.chat: @sarasate
Projects using steemQL:
- Insteem Web
- Insteem App (React Native, available via Expo)
steemQL In Action
The whole Insteem Site is using steemql. If you wanna figure out who mentioned you in a post or comment, have a look here: https://www.insteem.com/mentions/@sarasate
Here is a sample query to get user including his latest posts in 1 query:
{
user(username: "sarasate") {
id
name
balance
created
posts(query: {limit: 5, truncate_body: 10}) {
id
title
body
created
}
}
}
Play with it: steemQL Server. To get documentation for available queries, hit the green Schema
button on the right.
If you're not familiar with GraphQL, here you go.
Posted on Utopian.io - Rewarding Open Source Contributors
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Hey @ms10398, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!
Hey @sarasate I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x