steemQL 0.6.1 - Query related steem data with GraphQL

Words
290
Reading
2 min
Listen
Play
9y

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 of posts inside a user 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@sarasate

Projects using steemQL:

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.

Screen Shot 2018-02-09 at 11.01.00.png

If you're not familiar with GraphQL, here you go.



Posted on Utopian.io - Rewarding Open Source Contributors